// javascript file for common DHD utilities
var cookieInfo = {
	domain: '.designhousedigital.com', 
	path: '/', 
	secure: false
};
var sidCookie = "dhd_sid";
function getCustomHeaderLinks() {
	// don't do this from within the forums
	if (window.location.pathname.indexOf('/forums/') == 0) {
		// return;
	}
	// Create a YUI instance and use the cookie and io-base modules
	YUI().use('cookie', 'io-base', function(Y){
		var sid = Y.Cookie.get(sidCookie) || '';
		
		//if (sid != null) {
			// the uri for the ajax call
			var uri = "/forums/ajax.php?sid=" + sid;
	
			// event; runs when the ajax call is returned
			function complete(id, o, args) {
			  
			  // drop the header links into the proper div
			  document.getElementById('header-links').innerHTML = o.responseText;
			};
	
			// set up the 'complete' event
			Y.on('io:complete', complete, this, []);
	
			// Make the actual HTTP request to get the header links
			var request = Y.io(uri);
		//}
	});
}
function setSid(sid) {
	
	// Create a YUI instance and use the cookie and io-base modules
	YUI().use('cookie', 'io-base', function(Y){

    // save the session id in our own cookie since YUI can't seem to read the forums session id
    Y.Cookie.set("dhd_sid", sid, { domain: '.designhousedigital.com', path: '/', secure: false } );
  });
}
				