function glow(item){item.className='active'}
function fade(item){item.className=''}

function validateentryform(thisForm){
    with(thisForm){
        var items=thisForm.length;
        var alertMessage="The following required fields\nhave not been completed:\n";
        var backcolour='#f00';
        for(var i=0;i<items;i++){
            var e=elements[i];
            if(e.required){
                if(e.value==""){alertMessage += "\n"+e.required;e.style.borderColor=backcolour;}
            }
        }
        if(alertMessage!="The following required fields\nhave not been completed:\n"){
            alert(alertMessage);
            return false;
        }else{
            return true;
        }
    }
}
function echeck(str) {
    var at="@";
    var dot=".";
    var lat=str.indexOf(at);
    var lstr=str.length;
    var ldot=str.indexOf(dot);
    if (str.indexOf(at)==-1){alert("Invalid Email Address");return false;}
    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){alert("Invalid Email Address");return false;}
    if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){alert("Invalid Email Address");return false;}
    if (str.indexOf(at,(lat+1))!=-1){alert("Invalid Email Address");return false;}
    if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){alert("Invalid Email Address");return false;}
    if (str.indexOf(dot,(lat+2))==-1){alert("Invalid Email Address");return false;}
    if (str.indexOf(" ")!=-1){alert("Invalid Email Address");return false;}
    return true;
}

function validateEmail(emailID){
    if ((emailID.value==null)||(emailID.value=="")){
        alert("Please Enter your Email Address")
        emailID.focus()
        return false
    }
    if (echeck(emailID.value)==false){
        emailID.value=""
        emailID.focus()
        return false
    }
    return true
}
var win = null;
function popCenter(theURL,winName,w,h,s){
    if (window.screen) {
        var fromLeft= screen.availWidth;
        var fromTop= screen.availHeight;
        var settings='width='+w+',height='+h+',left='+Math.floor(.5*(fromLeft-w-10))+',top='+Math.floor(.5*(fromTop-h-30))+',status=0,resizable=1,scrollbars='+s;
        var win= window.open(theURL, winName, settings);
        if (win.focus)
            win.focus();
        return false;
    }
    return true;
} 
function closePopUpWindow(windowName){if(windowName && !windowName.closed){windowName.close();}}

