// cookies anyone?



function getCookie(name) {
dc = document.cookie;
cname = name + "=";
clen = dc.length;
cbegin = 0;

while (cbegin < clen) {
vbegin = cbegin + cname.length;

if (dc.substring(cbegin, vbegin) == cname) {
vend = dc.indexOf (";", vbegin);
if (vend == -1) vend = clen;

return unescape(dc.substring(vbegin, vend));
}

cbegin = dc.indexOf(" ", cbegin) + 1;

if (cbegin== 0) break;
}
return null;
}
function sc2 () {
cjdata =  getCookie("localize");
document.write(cjdata);
}
function showCookie() {
expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
localize="localize";
cjdata =  getCookie("localize");
/*  
do something if if cjdata is not found
if (cjdata.indexOf("|", 0) == -1)  { alert("291:  not found"); }
*/
}

function delCookie(name) {
expireNow = new Date();
document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}


function startCookie () {
expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
localize="localize";
cookievar = yourcity+"|"+stateprov+"|"+lonD+"|"+lonM+"|"+latD+"|"+latM;
document.cookie = localize + "=" + escape (cookievar) + "; expires=" + expdate.toGMTString();
// test the read 

}
function cookieInitialize()
{
// declarations
expdate = new Date();
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365));
localize="localize";
showCookie();
}
