// set cookie time
function setCookieTime(name, value, mSecond) { 
    var today  = new Date(); 
    var expire = new Date(today.getTime() + mSecond); 

	if (mSecond == 0) {
		window.document.cookie = name + "=" + escape(value) 	
        	+ "; path=/;"; 	
	} else {
    	window.document.cookie = name + "=" + escape(value) 
        	+ ((expire) ? "; expires=" + expire.toGMTString() : ""); 
	}
} 

// set cookie
function setCookie(name, value, days) { 
    setCookieTime(name, value, days * 24 * 60 * 60 * 1000); 
} 

// get cookie info
function getCookie(uName) { 
    var strCookie = " " + window.document.cookie; 
    var ptrFr = strCookie.indexOf(" " + uName + '='); 

    if (ptrFr != -1) { 
        ptrFr = ptrFr + uName.length + 2; 
        ptrTo = strCookie.indexOf(';', ptrFr); 

        if (ptrTo == -1) { 
            ptrTo = strCookie.length; 
        } 
        return unescape(strCookie.substring(ptrFr, ptrTo)); 
    } else { 
        return ""; 
    } 
}

// set cookie current YUI-dataTable paginator
function fnInitList(sURL) {
	setCookie('currpage', '1',0);
	location.href=sURL;
}

