// JavaScript Document
function cookieSet(name, value,theDays){
	if (!theDays){
		theDays=30;
	}
	var thepath = "/";	
	var exp = new Date( );
	var nowPlus = exp.getTime( ) + (theDays * 24 * 60 * 60 * 1000);
	exp.setTime(nowPlus);
	document.cookie = name+"="+value+";expires=" + exp.toGMTString() + ";path=" + thepath;
	//document.cookie = name + "=" + escape( value ) +
		( ( expires ) ? ";expires=" + exp.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + thepath : "/" );
}
function cookieGet( 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;	
}
function eraseCookie(name) {
  cookieSet(name, "", -1);
}