// JavaScript Document
/*flyMenu for Home MouseOver Starts here*/
function homeOver(){
	document.getElementById("fly0_div").style.display='none';
}
/*flyMenu for Home MouseOut Starts here*/
function homeOut(){
	document.getElementById("fly0_div").style.display='none';
}
/*flyMenu for Home MouseOver Starts here*/
function fly0Over(){
	document.getElementById("fly0_div").style.display='none';
	document.getElementById("homeId").className="topMnuSel";
}
/*flyMenu for Home MouseOut Starts here*/
function fly0Out(){
	document.getElementById("fly0_div").style.display='hide';
	document.getElementById("homeId").className="topMnu td";
}
/*flyMenu for Workers' Compensation MouseOut Starts here*/
function workerscompensationOver(){
	document.getElementById("fly1_div").style.display='block';
}
/*flyMenu for Workers' Compensation MouseOut Starts here*/
function workerscompensationOut(){
	document.getElementById("fly1_div").style.display='none';
}
/*flyMenu for Workers' Compensation MouseOver Starts here*/
function fly1Over(){
	document.getElementById("fly1_div").style.display='block';
	document.getElementById("workerscompensationId").className="topMnuSel";
}
/*flyMenu for Workers' Compensation MouseOut Starts here*/
function fly1Out(){
	document.getElementById("fly1_div").style.display='none';
	document.getElementById("workerscompensationId").className="topMnu td";
}
/*flyMenu for AgriBusiness MouseOver Starts here*/
function agribusinessOver(){
	document.getElementById("fly2_div").style.display='block';
}
/*flyMenu for AgriBusiness MouseOut Starts here*/
function agribusinessOut(){
	document.getElementById("fly2_div").style.display='none';
}
/*flyMenu for AgriBusiness MouseOver Starts here*/
function fly2Over(){
	document.getElementById("fly2_div").style.display='block';
	document.getElementById("agribusinessId").className="topMnuSel";
}
/*flyMenu for AgriBusiness MouseOut Starts here*/
function fly2Out(){
	document.getElementById("fly2_div").style.display='none';
	document.getElementById("agribusinessId").className="topMnu td";
}
/*flyMenu for Claim Center MouseOver Starts here*/
function claimcenterOver(){
	document.getElementById("fly3_div").style.display='block';
}
/*flyMenu for Claim Center MouseOut Starts here*/
function claimcenterOut(){
	document.getElementById("fly3_div").style.display='none';
}
/*flyMenu for Claim Center MouseOver Starts here*/
function fly3Over(){
	document.getElementById("fly3_div").style.display='block';
	document.getElementById("claimcenterId").className="topMnuSel";
}
/*flyMenu for Claim Center MouseOut Starts here*/
function fly3Out(){
	document.getElementById("fly3_div").style.display='none';
	document.getElementById("claimcenterId").className="topMnu td";
}
/*flyMenu for Careers MouseOver Starts here*/
function careersOver(){
	document.getElementById("fly4_div").style.display='block';
}
/*flyMenu for Careers MouseOut Starts here*/
function careersOut(){
	document.getElementById("fly4_div").style.display='none';
}
/*flyMenu for Careers MouseOver Starts here*/
function fly4Over(){
	document.getElementById("fly4_div").style.display='block';
	document.getElementById("careersId").className="topMnuSel";
}
/*flyMenu for Careers MouseOut Starts here*/
function fly4Out(){
	document.getElementById("fly4_div").style.display='none';
	document.getElementById("careersId").className="topMnu td";
}
/*flyMenu for About Zenith MouseOver Starts here*/
function aboutzenithOver(){
	document.getElementById("fly5_div").style.display='block';
}
/*flyMenu for About Zenith MouseOut Starts here*/
function aboutzenithOut(){
	document.getElementById("fly5_div").style.display='none';
}
/*flyMenu for About Zenith MouseOver Starts here*/
function fly5Over(){
	document.getElementById("fly5_div").style.display='block';
	document.getElementById("aboutzenithId").className="topMnuSel";
}
/*flyMenu for About Zenith MouseOut Starts here*/
function fly5Out(){
	document.getElementById("fly5_div").style.display='none';
	document.getElementById("aboutzenithId").className="topMnu td";
}
/*Home PageUser ID starts here*/
function changeIdField(){
	if (document.frm1.j_username.value=='' || document.frm1.j_username.value==null){
		document.frm1.j_username.value='User ID';
	}
}
/*Home Page Password Starts here*/
function changePwdField(){
	if (document.frm1.j_password.value=='' || document.frm1.j_password.value==null){
		document.frm1.j_password.value='Password';
	}
}
/*Home Page email Field starts here*/
function changeEmailField(){
	if (document.frm1.txt_mail.value=='' || document.frm1.txt_mail.value==null){
		document.frm1.txt_mail.value='Email Address';
	}
}
/*Search Our Site Text field starts here*/
function changeSrchField(){
	if (document.search.q.value=='' || document.search.q.value==null){
		document.search.q.value='Search our site';
	}
}
/*Alert Message for Email Address*/
function emailCheck(){
	var email=document.frm1.txt_mail.value;
	if (email == ""){
		document.getElementById("alert_div").style.display='block';
	}
	else{
		echeck(email);
	}
				 
}
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){
		document.getElementById("alert_div").style.display='block';
		return false;
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		document.getElementById("alert_div").style.display='block';
		return false;
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		document.getElementById("alert_div").style.display='block';
		return false;
	}
	if (str.indexOf(at, (lat+1))!==-1){
		document.getElementById("alert_div").style.display='block';
		return false;
	}
	if (str.substring(lat-1, lat)==dot || str.substring(lat+1, lat+2)==dot){
		document.getElementById("alert_div").style.display='block';
		return false;
	}
	if (str.indexOf(dot, (lat+2))==-1){
		document.getElementById("alert_div").style.display='block';
		return false;
	}
	if (str.indexOf(" ")!==-1){
		document.getElementById("alert_div").style.display='block';
		return false;
	}
	return true;
}
function validateForm(){
	var emailId=document.frm1.txt_mail;
	if ((emailId.value==null) || (emailId.value="")){
		document.getElementById("alert_div").style.display='block';
		emailId.focus();
		return false;
	}
	if (echeck(emailId)==false){
		emailId.value="";
		emailId.focus();
		return false;
	}
	return true;
}
/*Email Id Clear in the newsletters*/
function emailIdClear(){
	document.frm1.txt_mail.value="";
}
/*Login onclick*/
function alertClick(){
	document.getElementById("alert_div").style.display='block';
}
/*Login Password text clear*/
function txtClear(){
	document.frm1.txt_pwd.value="";
	
}
/*login pages text fields usr name and pwd onblur*/
function loginIdField(){
	if (document.frm1.txt_usrid.value=='' || document.frm1.txt_usrid.value==null){
		document.frm1.txt_usrid.value='User ID';
	}
}
function loginPwdField(){
	if (document.frm1.txt_pwd.value=='' || document.frm1.txt_pwd.value==null){
		document.frm1.txt_pwd.value='Password';
	}
}
function copyright() {
	if (navigator.appName == "Netscape" || navigator.appName == "Opera") {
		document.getElementById("copyright").innerHTML = "Copyright &copy; "+ (new Date().getYear() + 1900);
	} else{
		document.getElementById("copyright").innerHTML = "Copyright &copy; "+ (new Date().getYear());
	}
}
