/***** COOKIE FUNCTIONS *****/


// Check cookie to see if the cookie already exists
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');

	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

// Write the cookie
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
		var expires = "";
	}
	document.cookie = name+"="+value+expires+"; path=/";
	}

// Delete the cookie
function eraseCookie(name) {
	createCookie(name,"",-1);
}

// Javascript for Popunders
function jsad() {
	/*if (!readCookie("sadman")) {
		createCookie('sadman','am',1);
		document.write('<script type="text/javascript" src="http://ad.doubleclick.net/adj/pgacom.home/all;sz=400x450;ord=' + ord + '?" ><\/script>');
	}*/
	/*if (!readCookie("06_2006_survey")) {
		createCookie('06_2006_survey','true',1);
		window.open("/usopen/2006/survey.html", "surveyWindow", 'toolbar=no,resizable=no,scrollbars=no,menubar=no,location=no,width=500,height=250,top=0,left=0' );
	} else  if (!readCookie("sadman2")) {
		createCookie('sadman2','am',1);
		document.write('<iframe src="http://simg.zedo.com/intercept/tag/int313.html" frameborder=0 marginheight=0 marginwidth=0 scrolling="no" allowTransparency="true" width=1 height=1><\/iframe>');
	} */
}

