// JavaScript Document
function validate(){
a=checkEmail(document.login.email.value);
if(!a){
alert("Your Email address does not look valid");
document.login.email.focus();
return false;
}
if(document.login.remember.checked){
setCookie("circEmail", document.login.email.value);
}else{
delCookie("circEmail");
}
return true;
}

function delCookie(name){
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/";
}

function getCookie(name){
cky=document.cookie;
var index=cky.indexOf(name + "=");
if(index == -1) return null;
index = cky.indexOf("=", index)+1;
var endstr = cky.indexOf(";", index);
if (endstr == -1) endstr = cky.length;
return unescape (cky.substring(index, endstr));

}

function setCookie(name, value) {
var today = new Date();
var expiry = new Date(today.getTime() + 366*24*60*60*1000);
if(value !=null && value != "")
document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString()+"; path=/";
cky = document.cookie;
}
