var scoreA="";
var sep="SE9P";
function getCookieVal (offset) {
     var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    }
function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (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) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
    }

function DeleteCookie (name,path,domain) {
     if (GetCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
    }

function doCookie360(name,value){
	var myDate = new Date;
	myDate.setDate(myDate.getDate( ) + 360);	
	document.cookie = name +'='+ escape(value) + '; expires=' + myDate.toGMTString( ) + ';';
	}

function getMyCookie(){
	if(!(GetCookie("jibe"))){
//var today=new Date();
//today=today.toGMTString();
//var tod=today.substring(4,17);
//separator is SE9P
var cookieValue="00100SE9P";
SetCookie("jibe",cookieValue);
		}
if(!(GetCookie("jibe"))){
	document.forms["f0"].speedL[2].checked;
	}
	else
	{
	jibe=GetCookie("jibe");
	//alert("jibe="+jibe);
	}
splitCookie(jibe);
popuForm();

return jibe;
}

function splitCookie(theStr){
	scoreA=theStr.split("SE9P");
	}
	
function popuForm(){


var i,myS;
for(i=0;i<5;i++){

myS=scoreA[0].charAt(i);
if(myS==1){
document.forms["f0"].speedL[i].checked=true;
}else{
document.forms["f0"].speedL[i].checked=false;
}
}
}


function saveMyCookie(){
var cookieValue=""
for(i=0;i<5;i++){

cookieValue+=(document.forms["f0"].speedL[i].checked)?1:0;
}
//cookieValue+="SE9P";
SetCookie("jibe",cookieValue);
}

function addToC(ic){
if(!(GetCookie("jibe"))){return;
}else{jibe=GetCookie("jibe");
ic=jibe+ic+sep;
SetCookie("jibe",ic);
}}
