function getCookie(key){
    tmp=document.cookie+";";
   tmp1=tmp.indexOf(key, 0);
    if(tmp1!=-1){
        tmp=tmp.substring(tmp1,tmp.length);
        start=tmp.indexOf("=",0)+1;
        end=tmp.indexOf(";",start);
        return(unescape(tmp.substring(start,end)));
    }
    return("");
}

function getCookie1(cname){
var tempstr, namestart, tname, tend;
    tempstr = document.cookie;
    tname = cname + "=";
    namestart = tempstr.indexOf(tname);

    if (namestart >= 0) {
        tempstr = tempstr.substring(tname.length, tempstr.length);
        tend = tempstr.indexOf(";");

        if (tend < 0) {
            return tempstr;
        }
        else {
            tempstr = tempstr.substring(0, tend);
            return tempstr;
        }
    }
    else {
        return "";
    }
}