function setCookie(name,value,expire) {
	if (!expire) {
		expire = (1000*60*60*24*1000)
	}

	expDate=new Date();
	expDate.setTime(expDate.getTime()+(expire!=0?expire:0));
	document.cookie=name+"="+escape(value)+";path=/"+(expire?";expires="+expDate.toGMTString()+";":"");
}

function getCookie(name) {
	cV=document.cookie;
	keyPos=cV.indexOf(name+"=");
	if(keyPos==-1) return "";
	cV=cV.substring(keyPos+(name+"=").length,cV.length);
	cD=cV.indexOf(";");
	
	if(cD==-1) cD=cV.length;
	return cV.substring(0,cD);
}

