
function sDiv(which){if(document.getElementById(which).style.display="none"){document.getElementById(which).style.display="block";}}
function trim(str)
{return str.replace(/^\s*|\s*$/g,"");}
function fieldBlank(fieldName,msg)
{if(trim(fieldName.value)=="")
{alert(msg);fieldName.focus();return false;}
else
{return true;}}
function validNumeric(fieldName,msg)
{if(trim(fieldName.value)!="")
{var objRegExp=/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/;if(objRegExp.test(fieldName.value)==true)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
return true;}
function validEmail(fieldName,msg)
{if(trim(fieldName.value)!="")
{var email=fieldName.value;var matcharray=email.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z]+)*\.[A-Za-z]+$/)
if(matcharray==null)
{alert(msg);fieldName.select();return false;}
else
{return true;}}
return true;}
function validAlpha(fieldName,msg)
{if(trim(fieldName.value)!="")
{var reAlpha=/^[a-zA-Z ]+$/;if(reAlpha.test(fieldName.value)==true)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
return true;}
function validAlphaNumeric(fieldName,msg)
{if(trim(fieldName.value)!="")
{var reAlphanumeric=/^[a-zA-Z0-9_ ]+$/;if(reAlphanumeric.test(fieldName.value)==true)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
return true;}
function validURL(fieldName,msg)
{if(trim(fieldName.value)!="")
{str="http://"+trim(fieldName.value);var re;re=new RegExp("(http|ftp|https)://[-A-Za-z0-9_/]+[.][-A-Za-z0-9._/]+");if(re.test(str)==false)
{alert(msg);fieldName.select();return false;}
posOfAtSign=str.indexOf(".")
if(posOfAtSign==-1)
{alert(msg);fieldName.select();return false;}}
return true;}
function validDomain(fieldName,msg)
{var strURL=trim(fieldName.value);if(strURL!="")
{var is_protocol_ok=strURL.indexOf('www');var is_dot_ok=strURL.indexOf('.');if(((is_protocol_ok==-1)&&(is_dot_ok!=-2))||((is_protocol_ok!=-1)&&(is_dot_ok==-1)))
{alert(msg+"\n www.test.com");fieldName.focus();return false;}}
return true;}
function validPhoneFax(fieldName,msg)
{if(trim(fieldName.value)!="")
{var regexp=/^(\d{3}-\d{3}-\d{4}|\d{10}|\(\d{3}\)\d{3}-\d{4}|\d{6}|\d{7}|\d{8})$/;x=trim(fieldName.value);if(!(regexp.test(x)))
{var str="";str=str+msg;str=str+"\n The correct forms are : ";str=str+"\n xxx-xxx-xxxx";str=str+"\n (xxx)xxx-xxxx";str=str+"\n xxxxxxxxxx (10 digits no)";str=str+"\n xxxxxx (6 digits no)";str=str+"\n xxxxxxx (7 digits no)";str=str+"\n xxxxxxxx (8 digits no)";alert(str);fieldName.select();return false;}}
return true;}
function validAlphaLength(fieldName,msg,start,end)
{if(trim(fieldName.value)!="")
{if(validAlpha(fieldName,'Please enter the only alphabetic characters')==true)
{if(end!=null&&start!=null)
{if(fieldName.value.length>=start&&fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else if(end!=null&&start==null)
{if(fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else
{if(fieldName.value.length>=start)
{return true;}
else
{alert(msg);fieldName.select();return false;}}}
else
{return false;}}
return true;}
function validAlphaNumericLength(fieldName,msg,start,end)
{if(trim(fieldName.value)!="")
{if(validAlphaNumeric(fieldName,'Please enter only alphanumeric characters')==true)
{if(end!=null&&start!=null)
{if(fieldName.value.length>=start&&fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else if(end!=null&&start==null)
{if(fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else
{if(fieldName.value.length>=start)
{return true;}
else
{alert(msg);fieldName.select();return false;}}}
else
{return false;}}
return true;}
function validNumericLength(fieldName,msg,start,end)
{if(trim(fieldName.value)!="")
{if(validNumeric(fieldName,'Please enter only numeric characters')==true)
{if(end!=null&&start!=null)
{if(fieldName.value.length>=start&&fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else if(end!=null&&start==null)
{if(fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else
{if(fieldName.value.length>=start)
{return true;}
else
{alert(msg);fieldName.select();return false;}}}
else
{return false;}}
return true;}
function validFieldLength(fieldName,msg,start,end)
{if(trim(fieldName.value)!="")
{if(end!=null&&start!=null)
{if(fieldName.value.length>=start&&fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else if(end!=null&&start==null)
{if(fieldName.value.length<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else
{if(fieldName.value.length>=start)
{return true;}
else
{alert(msg);fieldName.select();return false;}}}
return true;}
function validRange(fieldName,msg,start,end)
{if(trim(fieldName.value)!="")
{if(validInteger(fieldName,null)==true||validFloat(fieldName,null)==true)
{if(end!=null&&start!=null)
{if(fieldName.value>=start&&fieldName.value<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else if(end!=null&&start==null)
{if(fieldName.value<=end)
{return true;}
else
{alert(msg);fieldName.select();return false;}}
else
{if(fieldName.value>=start)
{return true;}
else
{alert(msg);fieldName.select();return false;}}}
else
{alert('Please enter valid integer or float number');fieldName.select();return false;}}
return true;}
function compareFields(fieldName1,fieldName2,cmp,msg)
{if(trim(fieldName1.value)!=""&&trim(fieldName1.value)!="")
{if(cmp=="=")
{if(fieldName1.value==fieldName2.value)
{return true;}
else
{alert(msg);fieldName1.select();return false;}}
else if(cmp==">")
{if(fieldName1.value>fieldName2.value)
{return true;}
else
{alert(msg);fieldName1.select();return false;}}
else if(cmp=="<")
{if(fieldName1.value<fieldName2.value)
{return true;}
else
{alert(msg);fieldName1.select();return false;}}
else if(cmp=="<=")
{if(fieldName1.value<=fieldName2.value)
{return true;}
else
{alert(msg);fieldName1.select();return false;}}
else if(cmp==">=")
{if(fieldName1.value>=fieldName2.value)
{return true;}
else
{alert(msg);fieldName1.select();return false;}}}
return true;}
function validFileFormat(fieldName,format)
{var valid=0;var msg="";var farray=format.split('|');if(fieldName.value.length>0)
{fname=fieldName.value.split('.')
var length=fname.length;for(var i=0;i<farray.length;i++)
{if(farray.length>0)
{if(fname[length-1]==farray[i])
{valid=valid+1;}
else
{if(i!=(farray.length-1))
{msg=msg+farray[i]+", ";}
else
{msg=msg+farray[i];}}}
else
{msg=msg+farray[i];}}
if(valid==0)
{msg="Please attach "+msg+" format file only";alert(msg);fieldName.select();return false;}
else
{return true;}}
return true;}
function validFloat(fieldName,msg)
{re=/^((\d+(\.\d*)?)|((\d*\.)?\d+))$/;if(trim(fieldName.value)!="")
{if(re.test(fieldName.value)==false)
{if(msg!=null)
{alert(msg);}
fieldName.select();return false;}}
return true;}
function validInteger(fieldName,msg)
{re=/^\d+$/;if(trim(fieldName.value)!="")
{if(re.test(fieldName.value)==false)
{if(msg!=null)
{alert(msg);}
fieldName.select();return false;}}
return true;}
function printit(arg){if(arg){document.getElementById(arg).style.display="none";}
if(window.print){window.print();}else{var WebBrowser='<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';document.body.insertAdjacentHTML('beforeEnd',WebBrowser);WebBrowser1.ExecWB(6,2);}}
function closePage()
{window.self.close()}
function getDateObject(dateString,dateSeperator)
{var curValue=dateString;var sepChar=dateSeperator;var curPos=0;var cDate,cMonth,cYear;curPos=dateString.indexOf(sepChar);cDate=dateString.substring(0,curPos);endPos=dateString.indexOf(sepChar,curPos+1);cMonth=dateString.substring(curPos+1,endPos);curPos=endPos;endPos=curPos+5;cYear=curValue.substring(curPos+1,endPos);dtObject=new Date(cYear,cMonth,cDate);return dtObject;}
function changeMasterPass()
{if(document.changepass.oldpass.value=='')
{alert('Please enter the current password');document.changepass.oldpass.focus();return false;}
if(document.changepass.newpass.value=='')
{alert('Please enter the new password');document.changepass.newpass.focus();return false;}
else if(document.changepass.repass.value=='')
{alert('Please re-type the new password');document.changepass.repass.focus();return false;}
else if(document.changepass.newpass.value!=document.changepass.repass.value)
{alert('The new password & confirm password are not the same, so please re-enter the confirm password');document.changepass.repass.focus();document.changepass.repass.value='';return false;}
return true;}
var xmlHttp
function get_frm(str,str1,str2)
{xmlHttp=GetXmlHttpObject()
if(xmlHttp==null)
{alert("Browser does not support HTTP Request")
return}
var url=str
url=url+"?id="+str1
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){
var mytool_array=str1.split("&");

	
if(mytool_array[0]=="other"){
document.getElementById("stateDiv1").innerHTML="<input name='stateId1' id='stateId1' class='inputT'>";
}
	document.getElementById(str2).innerHTML=xmlHttp.responseText;
	
	
	}
	
	};xmlHttp.open("GET",url,true)
xmlHttp.send(null)}
function GetXmlHttpObject()
{var objXMLHttp=null
if(window.XMLHttpRequest)
{objXMLHttp=new XMLHttpRequest()}
else if(window.ActiveXObject)
{objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")}
return objXMLHttp}
function showHideDiv(id,divId)
{if(id==1){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display='none';}}
function clickclear(thisfield,defaulttext){if(thisfield.value==defaulttext){thisfield.value="";}}
function clickrecall(thisfield,defaulttext){if(thisfield.value==""){thisfield.value=defaulttext;}}<!--FOR SINGLE TIME FORM SUBMIT
var form_submitted=false;function submit_form()
{if(form_submitted)
{alert("Form has already been submitted. Please wait...");return false;}
else
{form_submitted=true;return true;}}$(document).ready(function(){$("#CngPass").click(function(){$("#div_change_password").slideToggle(400);$(this).toggleClass("active");return false;});});$(document).ready(function(){$("#joinnow").click(function(){$("#index_reg").slideToggle(600);$(this).toggleClass("active");$("#joinlink").slideToggle(100);$(this).toggleClass("active");$("#index_center").slideToggle(600);$(this).toggleClass("active");return false;});});/*$(document).ready(function(){$("#onlineF").fadeTo("fast",0.9);$("#onlineF").hover(function(){$("#onlineF").stop(true).fadeTo("fast",1.0);},function(){$("#onlineF").fadeTo("fast",0.9);});});*/function loginuser()
{var obj=document.lgnfrm;res=fieldBlank(obj.userEmail,'Please enter email id.');if(!res)
{return res;}
res=fieldBlank(obj.userPassword,'Please enter the password.');if(!res)
{return res;}}
function changePassValid()
{var obj=document.frm_change_pass;res=fieldBlank(obj.olduserPassword,'Please enter the old password.');if(!res)
{return res;}
res=fieldBlank(obj.newuserPassword,'Please enter the password.');if(!res)
{return res;}}
function showcht(){if(document.getElementById("onlineF").style.display=="none"){document.getElementById("onlineF").style.display="block";document.getElementById("onlineFrend").style.backgroundColor='#FFF';SetCookie("cht","on",1)}
else{document.getElementById("onlineF").style.display="none"
document.getElementById("onlineFrend").style.backgroundColor='';SetCookie("cht","off",1)}}
function showNote(){if(document.getElementById("saveNote").style.display=="none"){document.getElementById("saveNote").style.display="block";document.getElementById("NoteLink").style.backgroundColor='#FFF';SetCookie("note","on",1)}
else{document.getElementById("saveNote").style.display="none"
document.getElementById("NoteLink").style.backgroundColor='';SetCookie("note","off",1)}}
function SetCookie(cookieName,cookieValue,nDays){var today=new Date();var expire=new Date();if(nDays==null||nDays==0)nDays=1;expire.setTime(today.getTime()+3600000*24*nDays);document.cookie=cookieName+"="+escape(cookieValue)
+";expires="+expire.toGMTString();}
function ReadCookie(cookieName){var theCookie=""+document.cookie;var ind=theCookie.indexOf(cookieName);if(ind==-1||cookieName=="")return"";var ind1=theCookie.indexOf(';',ind);if(ind1==-1)ind1=theCookie.length;return unescape(theCookie.substring(ind+cookieName.length+1,ind1));}
  $(document).ready(function() {
$("#AjaxSearchTopBox").load("/include/searchTopBox.php"); 
get_frm("/include/footerContent.php","1","AjaxFooter")
});


