<!--//hidden

function getCookie(cookieName) {
	var theCookies = document.cookie;
	// split into NVP's
	theCookies = theCookies.split(";");
	for (var x = 0; x < theCookies.length; ++x) {
		// trim spaces
		theCookies[x] = trim(theCookies[x]," "); 
		// split into name and value 
		theNVP = theCookies[x].split("="); 
		// once we find the variable return the value
		if (theNVP[0] == cookieName) {
			return (theNVP[1]);
		}
	}
	return ("none");
}

function trim(theString,theTrim) {
	countBegin = 0;
	countEnd = theString.length;
	for (x=0; x < theString.length; x++) {
		if (theString.charAt(x) != theTrim) {
			break;
		}
		countBegin++;
	}

	for (x=theString.length - 1; x > 0; x--) {
		if (theString.charAt(x) != theTrim) {
			break;
		}
		countEnd--;
	}
	
	return(theString.substring(countBegin,countEnd));
}

function setCookie (name,value,expires,path) {
	if (document.domain) {
		if (document.domain.substring(0,4) == "www.") { 
			var domain = document.domain.substring(4);
		} else {
			var domain = document.domain;
		}
	} else {
		var domain = false;
	}

	document.cookie = name + "=" + escape (value) + 
	((expires) ? "; expires=" + expires.toGMTString() : "") + 
	((path) ? "; path=" + path : "") + 
	((domain) ? "; domain=" + domain : ""); 
	
	return;
}
// -->