//MARBLE CAKE
//Cookie Writer Script
//Version 1.3(2003-08-31 > 2009-10-28)

function kwCheckCookie(StrName){
	if(document.cookie.indexOf(StrName, 0) != -1){
		First = document.cookie.indexOf(StrName,0);
		if(document.cookie.indexOf(';', First) != -1){
			return document.cookie.substring(First + StrName.length + 1, document.cookie.indexOf(';', First));
		}else{
			return document.cookie.substring(First + StrName.length + 1);
		}
	}else{
		return false;
	}
}

function kwWriteCookie(StrName,Input,path,maxage){
	if(!path){
		path = '/';
	}
	if(!maxage){
		maxage = 63072000;
	}
	cookiedate = new Date();
	cookiedate.setTime(cookiedate.getTime() + maxage * 1000);
	
	document.cookie = StrName + '=' + Input + '; path=' + path + '; expires=' + cookiedate.toGMTString() + ';';
}