/*
--------------------------------------------------------------------------------------------------------------------
	For Using Cookie
--------------------------------------------------------------------------------------------------------------------
*/

/*
regist--------------------------------------------------------------------------------------------------------------
Regist Cookie by Hour
cookieName	cookie name
cookieValue	cookie value
expireTime	expire time(by hour)
*/

function setCookie(cookieName,cookieValue,expireTime,cPath){
var expdate=new Date();
expdate.setTime(expdate.getTime()+expireTime*(60*60*1000))
document.cookie=cookieName+"="+escape(cookieValue)+
((expdate==null)?"":("; expires="+expdate.toGMTString()))+
((cPath==null)?"; path=/":("; path="+cPath));
}

/*
loading-------------------------------------------------------------------------------------------------------------
Loding Cookie value by name
cookieName	cookie name
*/

function getCookie(cookieName){
var cname=cookieName+"=";
var i=0;
while(i<document.cookie.length){
var j=i+cname.length;
if(document.cookie.substring(i,j)==cname){
var leng=document.cookie.indexOf(";",j);
if(leng==-1)
leng=document.cookie.length;
return unescape(document.cookie.substring(j,leng));
}
i=document.cookie.indexOf(" ",i)+1;
if(i==0)break;}return "";
}

/*
enable checker-----------------------------------------------------------------------------------------------------
checking can use Cookie
variable=function	>>	variable=true or false
*/

function canCookie(){
var checkValue=navigator.cookieEnabled;
if(!checkValue){
setCookie("test","true",1);checkValue=getCookie("test");
}
return checkValue;
}