function deleteCookie(cookieName) {
        window.document.cookie=cookieName+"="+";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function getCookie(name) {
	var clength=document.cookie.length;
	var carg=name+"=";
	var arglength=carg.length;
	var i=0;
	while(i<=clength) {
		var j=(i+arglength);
		if(document.cookie.substring(i,j)==carg) return getCookieValue(j);
		i=document.cookie.indexOf(" ",i) + 1;
		if(i==0) break;
	}
	return null;
}

function setCookie(name,value,expires,path,domain,secure) {	
	document.cookie=name+ "=" +escape(value)+
	((expires) ? "; expires=" + expires.toGMTString() : "") +	
	"; path=/" +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");	
}

function getCookieValue(val) {
	if((endstr=document.cookie.indexOf(";",val))==-1)
		endstr=document.cookie.length;
	return unescape(document.cookie.substring(val,endstr));
}

/*
	if ($('testJS').style.display == 'none') {  
		tmp = 'this is a test!';
		setCookie('tmptest',tmp);
		tmp2 = getCookie('tmptest');
		if (tmp2!=tmp) {
			$('testCookie').style.display = 'block';
		} else { 
			$('testCookie').style.display = 'none';
		}	
	}	
*/
