var bStatus = false;
var Images_Path="../images";
function undgradd()
{
	if(document.getElementById("ugcourse").value=="-1")
	{
		
		document.getElementById("error_ugcourse").innerHTML="<font color='white'>Please Select Qualification</font>";
		document.getElementById("error_ugcourse").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_ugcourse").innerHTML="";
		document.getElementById("error_ugcourse").style.backgroundColor="";

	return true;
	}
}
function service()
{
	tooltip("Select Service","ddlService","100");
}
function fax1()
{
	tooltip("Enter Fax No","txtfax","100");
}
function post1()
{
	tooltip("Enter Name Of Position","txtPost","130");
}

function jobprofile1()
{
	tooltip("Enter Job Profile","txtJobprofile","170");
}
function jobaddinfo()
{
	tooltip("Enter Additional Info For Job","txtaddinfo","170");
}
function servicetype1()
{
	if(document.getElementById("ddlservicetype").value=="-1")
	{
		document.getElementById("error_servicetype").innerHTML="<font color='white'>Please Select Type Of Manpower Required.</font>";
		document.getElementById("error_servicetype").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_servicetype").innerHTML="<font color='red'></font>";
		document.getElementById("error_servicetype").style.backgroundColor="";
		return true;	
	}

}
function postd()
{
	if(document.getElementById("txtPost").value=="")
	{
		document.getElementById("error_post").innerHTML="<font color='white'>Please Enter Name Of Position</font>";
		document.getElementById("error_post").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_post").innerHTML="<font color='red'></font>";
		document.getElementById("error_post").style.backgroundColor="";
		return true;	
	}
		hidetip();		

}

function dWorkExp()
{	
//	alert(document.getElementById("txtworkexp").value.trim());
	if(document.getElementById("txtworkexp").value.trim()=="")
	{
		document.getElementById("error_workexp").innerHTML="<font color='white'>Please enter Desired Work Experience</font>";
		document.getElementById("error_workexp").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_workexp").innerHTML="";
		document.getElementById("error_workexp").style.backgroundColor="";

	return true;
	}
	hidetip();
}
function frmExpd()
{
	if(document.getElementById("frmExp").value=="0")
	{

		document.getElementById("error_exp").innerHTML="<font color='white'>Please Select From Experience</font>";
		document.getElementById("error_exp").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_exp").innerHTML="<font color='red'></font>";
		document.getElementById("error_exp").style.backgroundColor="";
		return true;	
	}
		hidetip();
}
function toExpd()
{
	if (document.getElementById("toExp").value=="0")
	{
		
		document.getElementById("error_exp").innerHTML="<font color='white'>Please Select To Experience</font>";
		document.getElementById("error_exp").style.backgroundColor="red";
		return false;
	}
	else if(document.getElementById("toExp").value=="0" && frmExpd()==false)
	{
		document.getElementById("error_exp").innerHTML="<font color='white'>Please Select From & To Experience</font>";
		document.getElementById("error_exp").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_exp").innerHTML="<font color='red'></font>";
		document.getElementById("error_exp").style.backgroundColor="";
		return true;	
	}
		hidetip();
}

function frmExp1()
{
	var x=document.getElementById("frmExp");
	var y=document.getElementById("toExp");
	y.options.length=0;
	var r=x.value;
	while (r<=35)
	{
		y.options[y.options.length] = new Option(r, r);
		r++;
	}
	document.getElementById("toExp").disabled=false;
}
function frmAged()
{
	if(document.getElementById("frmAge").value=="0")
	{
		document.getElementById("error_age").innerHTML="<font color='white'>Please Select From Age</font>";
		document.getElementById("error_age").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_age").innerHTML="<font color='red'></font>";
		document.getElementById("error_age").style.backgroundColor="";
		return true;	
	}
		hidetip();
}
function toAged()
{
	if (document.getElementById("toAge").value=="0")
	{
		
		document.getElementById("error_age").innerHTML="<font color='white'>Please Select To Age</font>";
		document.getElementById("error_age").style.backgroundColor="red";
		return false;
	}
	else if(document.getElementById("toAge").value=="0" && frmAged()==false)
	{
		document.getElementById("error_age").innerHTML="<font color='white'>Please Select From & To Age</font>";
		document.getElementById("error_age").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_age").innerHTML="<font color='red'></font>";
		document.getElementById("error_age").style.backgroundColor="";
		return true;	
	}
		hidetip();
}

function frmAge1()
{
	var x=document.getElementById("frmAge");
	var y=document.getElementById("toAge");
	y.options.length=0;
	var r=x.value;
	while (r<=75)
	{
		y.options[y.options.length] = new Option(r, r);
		r++;
	}
	document.getElementById("toAge").disabled=false;
}
function vacanciesd()
{
	if(document.getElementById("ddlVacancies").value=="0")
	{
		document.getElementById("error_vacancies").innerHTML="<font color='white'>Select No. Of Vacancies</font>";
		document.getElementById("error_vacancies").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_vacancies").innerHTML="<font color='red'></font>";
		document.getElementById("error_vacancies").style.backgroundColor="";
		return true;	
	}
		hidetip();		
}


function jobprofiled()
{
	if(document.getElementById("txtJobprofile").value=="")
	{
		document.getElementById("error_jobprofile").innerHTML="<font color='white'>Enter Job Profile</font>";
		document.getElementById("error_jobprofile").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_jobprofile").innerHTML="<font color='red'></font>";
		document.getElementById("error_jobprofile").style.backgroundColor="";
		return true;	
	}
		hidetip();		
}

function serviced()
{
	if(document.getElementById("ddlService").value=="")
	{
		document.getElementById("error_service").innerHTML="<font color='white'>Please select service</font>";
		document.getElementById("error_service").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_service").innerHTML="<font color='red'></font>";
		document.getElementById("error_service").style.backgroundColor="";
		return true;	
	}
		hidetip();		

}

/*function city1check()
{
	if(document.getElementById("city1").value=="-1")
	{
			document.getElementById("error_city1").innerHTML="<font color='white'>Location not selected.</font>";
			document.getElementById("error_city1").style.backgroundColor="red";
			return false;
	}else
	{	
		document.getElementById("error_city1").innerHTML="<font color='white'></font>";
		document.getElementById("error_city1").style.backgroundColor="";
		return true;	
	}

}*/
function jcity1check()
{
	if(document.getElementById("jcity1").value=="-1")
	{
			document.getElementById("error_jcity1").innerHTML="<font color='white'>Location not selected.</font>";
			document.getElementById("error_jcity1").style.backgroundColor="red";
			return false;
	}else
	{	
		document.getElementById("error_jcity1").innerHTML="<font color='white'></font>";
		document.getElementById("error_jcity1").style.backgroundColor="";
		return true;	
	}

}
function dateofjoin()
{
	if(document.getElementById("DateOfJoin_Month").value.trim()!="" && document.getElementById("DateOfJoin_Year").value.trim()=="")
	{
		document.getElementById("error_joinserv").innerHTML="<font color='white'>Please Select Date Of Join.</font>";
		document.getElementById("error_joinserv").style.backgroundColor="red";
		return false;
	}else if(document.getElementById("DateOfJoin_Month").value.trim()=="" && document.getElementById("DateOfJoin_Year").value.trim()!="")
	{
		document.getElementById("error_joinserv").innerHTML="<font color='white'>Please Select Date Of Join.</font>";
		document.getElementById("error_joinserv").style.backgroundColor="red";
		return false;
	}else
	{
		var i;
		
		document.getElementById("DateOfRetire_Year").options.length=0;
		var elSel=document.getElementById("DateOfRetire_Year");
		for(i=document.getElementById("DateOfJoin_Year").value.trim();i<=2009;i++)
		{

				var elOptNew = document.createElement('option');
				elOptNew.text = i;
				elOptNew.value = i;

			try {
					elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
			    }
			catch(ex) 
				{
					elSel.add(elOptNew); // IE only
				}
		}
				var elOptNew1 = document.createElement('option');
		elOptNew1.text = "Not Retired";
		elOptNew1.value = "0";

		try {
					elSel.add(elOptNew1, null); // standards compliant; doesn't work in IE
			}
		catch(ex) 
			{
					elSel.add(elOptNew1); // IE only
			}
		
		document.getElementById("error_joinserv").innerHTML="";
		document.getElementById("error_joinserv").style.backgroundColor="";
		return true;
	}
}

function experience()
{
		if(document.getElementById("expyear").value=="99")
			{
				document.getElementById("retireservice").style.display="none";
				document.getElementById("retirereason").style.display="none";
				document.getElementById("expmonth").disabled=true;
				document.getElementById("expmonth").selectedIndex=1;
			}else
			{

				document.getElementById("retireservice").style.display="";
				document.getElementById("retirereason").style.display="";
								document.getElementById("expmonth").disabled=false;
			}
}
function retiredate()
{
	if(document.getElementById("DateOfRetire_Month").value.trim()=="0")
	{
		var yrretire;
		yrretire=document.getElementById("DateOfRetire_Year");
		for(var i=0;i<=yrretire.length-1;i++)
		{
			if(yrretire.options[i].value.trim()=="0")
			{
				
				yrretire.selectedIndex=i;
				document.getElementById("retirereason").style.display="none";
			}
			
		}
	}
}
function dateofretire()
{
	if(document.getElementById("DateOfRetire_Month").value.trim()!="" && document.getElementById("DateOfRetire_Year").value.trim()=="-1")
	{
		document.getElementById("error_retireserv").innerHTML="<font color='white'>Please Select Date Of Retirement.</font>";
		document.getElementById("error_retireserv").style.backgroundColor="red";
		return false;
	}else if(document.getElementById("DateOfRetire_Month").value.trim()=="-1" && document.getElementById("DateOfRetire_Year").value.trim()!="")
	{
		document.getElementById("error_retireserv").innerHTML="<font color='white'>Please Select Date Of Retirement.</font>";
		document.getElementById("error_retireserv").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_retireserv").innerHTML="";
		document.getElementById("error_retireserv").style.backgroundColor="";
		return true;
	}
}
function city1change()
{
	var doc=document.forms[0];
	var w=doc.city1.selectedIndex;
	if(doc.city.options[w].text.match("Other")!=null)
	{
		document.getElementById("ocity").style.display="";
	}else
	{
		document.getElementById("ocity").style.display="none";
	}
}
/*function trim(stringToTrim) {

	return stringToTrim.replace(/^\s+|\s+$/g,"");
}*/
function name1()
{

		tooltip("Please enter your full name (first name, middle name, last name).","txtfullname","220");
		
}
function companyname1()
{

		tooltip("Please enter your Company name.","txtcompanyname","220");
		
}

function companyaddress1()
{

		tooltip("Please enter your Company Address.","txtcompanyaddress","180");
		
}
function website1()
{

		tooltip("Please enter your Website.","txtwebsite","220");
		
}

function additionalinfo1()
{

		tooltip("Please enter Additional Info (if any).","txtadditionalinfo","180");
		
}
function fax1()
{

		tooltip("Please enter Fax No (if any).","txtfax","180");
		
}
function dept1()
{

		tooltip("Please enter Your Department.","txtdept","220");
		
}
function expyear1d()
{
	if(document.getElementById("expyear").value=="-1" || document.getElementById("expmonth").value=="-1")
	{
		document.getElementById("error_experience").innerHTML="<font color='white'>Please select your total work experience</font>";		
		document.getElementById("error_experience").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_experience").innerHTML="<font color='white'></font>";		
		document.getElementById("error_experience").style.backgroundColor="";
		return true;
	}
}
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };

function named()
{	
	
	if(document.getElementById("txtfullname").value.trim()=="")
	{
		document.getElementById("error_fullname").innerHTML="<font color='white'>Please enter your full name</font>";
		document.getElementById("error_fullname").style.backgroundColor="red";
		if(bStatus == false)
		{
		  hidetip();
		}
	return false;
	}else
	{
		document.getElementById("error_fullname").innerHTML="";
		document.getElementById("error_fullname").style.backgroundColor="";

	return true;
	}
	
}
function companynamed()
{	
	
	if(document.getElementById("txtcompanyname").value.trim()=="")
	{
		document.getElementById("error_companyname").innerHTML="<font color='white'>Please enter your Company name</font>";
		document.getElementById("error_companyname").style.backgroundColor="red";
		if(bStatus == false)
		{
		  hidetip();
		}
	return false;
	}else
	{
		document.getElementById("error_companyname").innerHTML="";
		document.getElementById("error_companyname").style.backgroundColor="";
hidetip();

	return true;
	}
	
		  
}
function companyaddressd()
{	
	
	if(document.getElementById("txtcompanyaddress").value.trim()=="")
	{
		document.getElementById("error_companyaddress").innerHTML="<font color='white'>Please enter your Company Address</font>";
		document.getElementById("error_companyaddress").style.backgroundColor="red";
		if(bStatus == false)
		{
		  hidetip();
		}
	return false;
	}else
	{
		document.getElementById("error_companyaddress").innerHTML="";
		document.getElementById("error_companyaddress").style.backgroundColor="";

	return true;
	}
	
}
function designation1()
{

		tooltip("Enter your current designation.","txtdesignation","220");
}

function email1()
{

		tooltip("Enter your existing email address. Senaseva recruiters will use this email to correspond with you.","txtemail","220");
}
function emaild()
{
	//	var doc=document.contactForm;
	ValidateEmail();
	
}
function webd() {
    var url=document.getElementById("txtwebsite").value.trim();
	if (url!="")
	{
		var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/; 
		if(RegExp.test(url))
		 { 
			document.getElementById("error_web").innerHTML="";
			document.getElementById("error_web").style.backgroundColor="#ffffff";

			 return true;
		 }
		 else
		 {
			 //window.alert("URL invalid. Try again.");
			document.getElementById("error_web").innerHTML="<font color='white'>Please Enter The Website Address properly. e.g senaseva.com</font>";
			document.getElementById("error_web").style.backgroundColor="red";

			 return false; 
		 }
	 }
}

function landline1()
{
	tooltip("Enter your landline number. Please include Country Code  - STD Code - Phone Number.","landline","260");
}
function landline1d()
{
	validatelandline();
}
function dobdd()
{
//	var doc=document.form1;
//	document.getElementById("error_email").innerHTML="Select Service";
tooltip("Select The Day in Date Of Birth.","DateOfBirth_Day","220");
}
function dobddd()
{
	if(document.getElementById("DateOfBirth_Day").value=="" || document.getElementById("DateOfBirth_Month").value=="" || document.getElementById("DateOfBirth_Year").value=="")
	{
		document.getElementById("error_dobdd").innerHTML="<font color='white'>Please select your date of birth</font>";
		document.getElementById("error_dobdd").style.backgroundColor="red";

	return false;
	}else
	{
		document.getElementById("error_dobdd").innerHTML="<font color='red'></font>";
		document.getElementById("error_dobdd").style.backgroundColor="";

	return true;
	}
		hidetip();
	
}
function dobmm()
{
//	var doc=document.form1;
//	document.getElementById("error_email").innerHTML="Select Service";
tooltip("Select The Month in Date Of Birth.","DateOfBirth_Month","220");
}
function dobmmd()
{
	/*if(document.contactForm.DateOfBirth_Month.value=="")
	{
	document.getElementById("error_dobmm").innerHTML="<font color='red'>Select Month in Date OF Birth</font>";
	return false;
	}else
	{
	document.getElementById("error_dobmm").innerHTML="<font color='red'></font>";
	return true;
	}
		hidetip();
		*/
	
}
function dobyy()
{
//	var doc=document.form1;
//	document.getElementById("error_email").innerHTML="Select Service";
tooltip("Select The Year in Date Of Birth.","DateOfBirth_Year","220");
}
function dobyyd()
{
	
		/*if(document.contactForm.DateOfBirth_Year.value=="")
	{
	document.getElementById("error_dobyy").innerHTML="<font color='red'>Select Year in Date OF Birth</font>";
	return false;
	}else
	{
	document.getElementById("error_dobyy").innerHTML="<font color='red'></font>";
	return true;
	}
		hidetip();*/
	
}


function mobile1()
{
	//var doc=document.form1;
//	document.getElementById("error_email").innerHTML="Select Service";
tooltip("Enter your mobile number.","mphone1","180");
}
function mobiled()
{
//v_EMAIL|X|hidetip


	Validatemobile();
}
function show(showLayerID)
{
	if(gbi(showLayerID).style.display=='none')
	{gbi(showLayerID).style.display='';}
	else
	{gbi(showLayerID).style.display='none';}
}
function LL_click()
{
	show('phone');
	if ( gbi('mphone1').value.trim().length == 0 )
	{
		gbi('lbl_mphone').className = gbi('mphone1').className = "";
		gbi('error_mphone').style.display = "none";
	}
	gbi('areacode').value = gbi('landline').value = '';
	gbi('countrycode').className = gbi('areacode').className = gbi('landline').className = gbi('lbl_landline').className = '';
	gbi('error_landline').style.display='none';
	//gbi('areacode').focus();
	return false;
}

function annualctc1()
{
	tooltip("Select your current annual salary in Lacs. Please include perks if any as part of your annual salary.","DDLAnnualCTC","280");
}
	function annualctc1d()
{
	
	if(document.getElementById("DDLAnnualCTC").value=="0")
	{
	document.getElementById("error_ctc").innerHTML="<font color='white'>Select Annual CTC for Candidate.</font>";
	document.getElementById("error_ctc").style.backgroundColor="red";
		if(bStatus == false)
		{
		  hidetip();
		}

	return false;
	}else
	{
	document.getElementById("error_ctc").innerHTML="<font color='white'></font>";
	document.getElementById("error_ctc").style.backgroundColor="";

	return true;
	}
		
}
function v_CITY(ob) {
        var pattern = /[^a-zA-Z\s,.\-/]/;
        var err = false;
        var country = gbi("country");
        var city = gbi("city");
        var ocity = gbi("ocity");
        var error_location = gbi("error_location");
        var status_city = gbi("status_city");
        var status_country = gbi("status_country");
        status_city.style.display = "none";
        error_location.style.display = "none";
        status_country.style.display = "none";
        ocity.value = ocity.value.trim();
        if ( country.value == -1 )  {
                err = true;
                showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Please Select Your Country.", "EleToFocus":country, "StatusObj":status_country, "ob":ob, "HName":"Country", "label":"lbl_location"});
        } else {
		//hideErrorCSS('country','error_location','status_country', 'lbl_location');
	}
        /*else*/ {
                if ( country.value != 11 )  {
                        if (  String(ocity.value).length == 0 || ocity.value.toLowerCase() == "please specify location" || ocity.value.toLowerCase() == "other")  {
                                err = true;
                                showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Please Type Your City Name in the Text Box.", "EleToFocus":ocity, "StatusObj":status_city, "ob":ob, "HName":"City", "label":"lbl_location"});
                        }
                        else if ( pattern.test ( ocity.value ) )  {
                                err = true;
                                showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Special Characters Other Than (Dot Hyphen Comma) Are Not Allowed.", "EleToFocus":ocity, "StatusObj":status_city, "ob":ob, "HName":"City", "label":"lbl_location"});
                        }
                }
        }
        if ( city.value == -1 && city.disabled == false)  {
                if ( country.value == -1 || country.value == 11 )  {
                        err = true;
                        showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Please Select Your Current Location.", "EleToFocus":city, "StatusObj":status_city, "ob":ob, "HName":"City", "label":"lbl_location"});
                }
                else   {
                        err = true;
                        showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Please Type Your City Name in the Text Box.", "EleToFocus":ocity, "StatusObj":status_city, "ob":ob, "HName":"City", "label":"lbl_location"});
                }
        }
        else if ( country.value != -1 && country.value != 11 && city.value != -1  && city.value != 9999 )  {
                err = true;
                showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"The Current Location Chosen Does Not Exist For Country Chosen.", "EleToFocus":country, "StatusObj":status_country, "ob":ob,"label":"lbl_location", "HName":"Country"});
        } else if ( city.value == 9999) {
	}else if ( city.options[city.selectedIndex].text.match("Other") ) {
                if (  String(ocity.value).length == 0 || ocity.value.toLowerCase() == "please specify location" || ocity.value.toLowerCase() == "other")  {
                        err = true;
                        showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Please Type Your City Name in the Text Box.", "EleToFocus":ocity, "StatusObj":status_city, "ob":ob, "HName":"City", "label":"lbl_location"});
                }
                else if ( pattern.test ( ocity.value ) )  {
                        err = true;
                        showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Special Characters Other Than (Dot Hyphen Comma) Are Not Allowed.", "EleToFocus":ocity, "StatusObj":status_city, "ob":ob, "HName":"City", "label":"lbl_location"});
                }
        }
        if (ob && !err) {
                hideErrorCSS('city','error_location','status_city', "lbl_location");
                hideErrorCSS('ocity','error_location','status_city',"lbl_location");
                status_city.src = Images_Path+"/correct.gif";
                status_city.style.display = "";
                opacity("status_city", 100, 0, fd_tout);
		return 0;
        }
	return -1
}
function CityChangedEvent(src)
{
	if ( src == 'trapCity')
		return;
	var divOtherLoc = gbi("div_otherLoc");
        var country = gbi("country");
        var city = gbi("city");
        var ocity = gbi("ocity");
        var error_location = gbi("error_location");

        error_location.style.display = "none";
        error_location.innerHTML = "";

        //country.value = 11;

        var pattern = /(Other)/;
	if ( city.value == 9999 ) {
                ocity.style.display = "";
		country.value = country.value == 11 ? -1 : country.value;
		//country.focus();
	} else if ( pattern.test(city.options[city.selectedIndex].text) )  {
                divOtherLoc.style.display = ocity.style.display = "";
        } else {
                divOtherLoc.style.display = ocity.style.display = "none";
        }
	if ( country.value != -1 )
	hideErrorCSS('country','error_location','status_country', 'lbl_location');
}
function trapCity() {
        var city = gbi("city");
        var pattern = /(Other)/;
        SetCountryAreaCode();
        if (pattern.test(city.options[city.selectedIndex].text)) {
                CityChangedEvent('trapCity');
		if( city.value != -1 && city.value != 9999 )
		{
			v_COUNTRY(1);
			v_CITY(1);
		}
        }
}
function CountryChangedEvent(src)
{
        var country         = gbi("country");
        var error_location  = gbi("error_location");
        var city            = gbi("city");
	var divOtherLoc    = gbi("div_otherLoc");
        var ocity           = gbi("ocity");
        var error_location  = gbi("error_location");
       // var ctctype_i       = gbi("ctctype_i");
        //var ctctype_u       = gbi("ctctype_u");
        //var ctc_span        = gbi("ctc_span");

        //ctctype_i.checked = false;
        //ctctype_u.checked = false;
        //error_location.style.display = "none";
        //error_location.innerHTML = "";
        //error_location.style.display = "none";
        //error_location.innerHTML = "";

        if ( country.value == -1 ||  country.value == 11 ) {
		if (country.value == 11 && city.value == 9999 )
			city.value = -1;
		if ( city.options[city.selectedIndex].text.indexOf('Other') > -1 ){
			divOtherLoc.style.display = ocity.style.display = '';
			//city.disabled = true;
		}else {
			divOtherLoc.style.display = ocity.style.display = 'none';
			//city.disabled = false;
		}
                if ( country.value == 11 ) {
            //            ctctype_i.checked = true;
                        hideErrorCSS('city','error_location','status_city','lbl_location');
                }
        }  else  {
                city.value = 9999;
          //      ctctype_u.checked = true;
                divOtherLoc.style.display = ocity.style.display = "";
		//if ( src != 'trapCountry' && src != 'trapCity')
		//	ocity.focus();
        }
}
function trapCountry() {
        var country = gbi("country");
        CountryChangedEvent("trapCountry");
        SetCountryAreaCode();
        v_COUNTRY(1, "trapCountry");
}
function v_COUNTRY(ob, src) {
        var pattern = /[^a-zA-Z\s,.\-/]/;
        var err = false;
        var country = gbi("country");
        var error_location = gbi("error_location");
        var status_country = gbi("status_country");
        error_location.style.display = "none";
        status_country.style.display = "none";

        src = src ? src : 0;

        if ( country.value == -1 )  {
                err = true;
                showErrMsg({"ErrDivObj":error_location, "ErrorMsg":"Please Select Your Country.", "EleToFocus":country, "StatusObj":status_country, "ob":ob, "HName":"Country","label":"lbl_location"});
        }
        else {
                //if (country.value != 11)
                        var cityErr = v_CITY(ob);
        }
        if (ob && !err && src != "trapCountry" && cityErr != -1) {
                hideErrorCSS('country','error_location','status_country', 'lbl_location');
                status_country.src = Images_Path+"/correct.gif";
                status_country.style.display = "";
                opacity("status_country", 100, 0, fd_tout);
        }
}
function showErrMsg(arr_params) {
//try{
        var i;
        arr_params['ErrDivObj'].style.display = "";
        arr_params['ErrDivObj'].innerHTML = /*"<img src=\""+http://static.naukimg.com/manager/Images_Path+"/error.gif\">"+ */ arr_params['ErrorMsg'];
	arr_params['ErrDivObj'].className = "subCont errortxt";

        if (arr_params['EleToFocus']) {
                if (arr_params['EleToFocus']["isArray"]) {
                        for (i=0; i<arr_params['EleToFocus'].length; ++i) {
                                arr_params['EleToFocus'][i].className = "error";
				gbi(arr_params['label'][i]).className = 'lerror';
				if ( arr_params['EleToFocus'][i].parentNode.name == 'borderele')
					arr_params['EleToFocus'][i].parentNode.className = 'error';
                        }
                } else {
                        arr_params['EleToFocus'].className = "error";
			gbi(arr_params['label']).className = 'lerror';
			if ( arr_params['EleToFocus'].parentNode.name == 'borderele')
			{
				arr_params['EleToFocus'].parentNode.className = 'error';
			}
		}
        }

        if (arr_params['StatusObj']) {
                if (arr_params['StatusObj']["isArray"]) {
                        for (i=0; i<arr_params['StatusObj'].length; ++i) {
                                arr_params['StatusObj'][i].style.display = "";
				arr_params['StatusObj'][i].src = Images_Path+"/spacer.gif";	// Bug-20626
                                opacity(arr_params['StatusObj'][i].id, 99, 100, 1);
                        }
                }
                else {
                        arr_params['StatusObj'].style.display = "";
                        arr_params['StatusObj'].src = Images_Path+"/spacer.gif";		// Bug-20626
                        opacity(arr_params['StatusObj'].id, 99, 100, 1);
                }
        }
        if (!arr_params['ob']) {
                ErrorDetails[arr_params["HName"]] = 1;
                if (arr_params['EleToFocus']) {
                        if (!alreadyFocussed) {
                                alreadyFocussed = true;
                                if (arr_params['EleToFocus']["isArray"]) {
                                        arr_params['EleToFocus'][0].focus();
                                }
                                else {
                                        arr_params['EleToFocus'].focus();
                                }
                        }
                }
        }
//} catch(e) {alert(e.description + "\n" + arr_params['HName'])}
}
function gbi(eleId)
{
	try { return document.getElementById(eleId); } catch(e) { return null; }
}



function echeck(str) {
	//var emailID=document.contactForm.txtemail;
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
//			tooltip("Invalid Email ID","txtemail","220");
		   return false;
		}

		else if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
//			tooltip("Invalid Email ID","txtemail","220");
		   return false;
		}

		else if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
//			tooltip("Invalid Email ID","txtemail","220");
		    return false;
		}

		 else if (str.indexOf(at,(lat+1))!=-1){
//			tooltip("Invalid Email ID","txtemail","220");
		    return false;
		 }

		 else if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
  // 			tooltip("Invalid Email ID","txtemail","220");
		    return false;
		 }

		 else if (str.indexOf(dot,(lat+2))==-1){
	//		tooltip("Invalid Email ID","txtemail","220");
			return false;
		 }
		
		 else if (str.indexOf(" ")!=-1){
	//		tooltip("Invalid Email ID","txtemail","220");
		    return false;
		 }
	else
		{
	//	hidetip();
 		 return true	;				
		}
	}

function ValidateEmail(){
	var emailID=document.getElementById("txtemail");

	if ((emailID.value==null)||(emailID.value.trim()=="")){
		document.getElementById("error_email").innerHTML="<font color='white'>Please enter your email address</font>";
		document.getElementById("error_email").style.backgroundColor="red";
		if(bStatus == false)
		{
		  hidetip();
		}	
		return false;
	}
	else if (echeck(emailID.value)==false){

		document.getElementById("error_email").innerHTML="<font color='white'>Please enter valid email address</font>";
			   		document.getElementById("error_email").style.backgroundColor="red";
		if(bStatus == false)
		{
		  hidetip();
		}
		return false;
	}else
	{document.getElementById("error_email").innerHTML="";
	document.getElementById("error_email").style.backgroundColor="";
	//	hidetip();
	return true
	}
	
 }
 
function SetCountryAreaCode()
{
        var country = gbi("country");
        var city = gbi("city");
        var countrycode = gbi("countrycode");
        var areacode = gbi("areacode");

        cityCode = new Array();
                cityCode['ahmedabad'] = "79";
                cityCode['bangalore'] = "80";
                cityCode['chennai'] = "44";
                cityCode['delhi'] = "11";
                cityCode['hyderabad'] = "40";
                cityCode['kolkata'] = "33";
                cityCode['mumbai'] = "22";
                cityCode['noida'] = "120";
                cityCode['pune'] = "20";
        
        if ( country.value == -1 )
        {
                countrycode.value = "";
                areacode.value = "";
                return;
        }

        var cityval = city.options[city.selectedIndex].text.toLowerCase();
        if ( cityval.indexOf("/") > -1 )  {
                var cityvals = cityval.split(" / ");
                cityval = cityvals[0];
        }
        if ( country.value == 11 ) {
                countrycode.value = "91";
		if(areacode.value == "" || areacode.value == "-1"){
                try {
                        if ( cityCode[cityval] != null )
                                areacode.value = cityCode[cityval];
                        else if ( cityCode[cityvals[1]] != null )
                                areacode.value = cityCode[cityvals[1]];
                        else
                                areacode.value = "";
                }catch(e) { areacode.value = ""; }}
        } else  {
                if ( countrycode.value == "91" || countrycode.value == "-91" || countrycode.value == "+91" )
                        countrycode.value = "";
                for ( cityIndex in cityCode )  {
                        if ( areacode.value == cityCode[cityIndex] )  {
                                areacode.value = "";
                                break;
                        }
                }
        }
}

function validatelandline()
{
            var x = document.getElementById("landline").value.trim();
			if((x=="" || document.getElementById("areacode").value.trim()=="" || document.getElementById("countrycode").value.trim()=="")&& document.getElementById("mphone1").value.trim()=="")
			{
			   document.getElementById("error_landline").innerHTML="<font color='white'>Please enter one of your contact numbers (either Mobile or Landline). Senaseva recruiters will use this to contact you.</font>";
	           document.getElementById("error_landline").style.backgroundColor="red";
			   document.getElementById("error_mphone").innerHTML="";
				if(bStatus == false)
				{
					hidetip();
				}   

			   return false;
		   }
			   else if((x!="" && (document.getElementById("areacode").value.trim()!="" || document.getElementById("countrycode").value.trim()!="")&& (document.getElementById("mphone1").value.trim()==""||document.getElementById("mphone1").value.trim()!="")))
			{
					if(isNaN(x)|| isNaN(document.getElementById("areacode").value.trim()) || isNaN(document.getElementById("countrycode").value.trim()))
				   {
					document.getElementById("error_landline").innerHTML="<font color='white'>Enter valid landline number</font>";
					document.getElementById("error_landline").style.backgroundColor="red";
					if(bStatus == false)
					{
						hidetip();
					}   

					 return false; 
				   }
				   else
	               {
					   
					   document.getElementById("error_landline").innerHTML="<font color='white'></font>";
					   document.getElementById("error_landline").style.backgroundColor="";
					   return true;
					   
					}
			   }
			   else
			 {
			   document.getElementById("error_landline").innerHTML="<font color='red'></font>";
			   document.getElementById("error_landline").style.backgroundColor="";
			   return true;
			 }			   				  
           
}
function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789,-+";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

function servicedet()
{
	if(document.forms[0].ddlService.value!="")
	{
		if(document.forms[0].ddlService.value!="5" )
		{
			document.getElementById("retirereason").style.display="";
			document.getElementById("retireservice").style.display="";
			document.getElementById("joinservice").style.display="";
			document.getElementById("divcivilexp").style.display="";
		}
		else
		{
			document.getElementById("retirereason").style.display="none";
			document.getElementById("retireservice").style.display="none";
			document.getElementById("joinservice").style.display="none";		
			document.getElementById("divcivilexp").style.display="none";
			document.getElementById("ddlcivilexp").selectedindex=0;
		}
	}	else
		{
			document.getElementById("retirereason").style.display="none";
			document.getElementById("retireservice").style.display="none";
			document.getElementById("joinservice").style.display="none";		
			document.getElementById("divcivilexp").style.display="none";
			document.getElementById("ddlcivilexp").selectedindex=0;
		}
	
}
   function Validatemobile()
   {

            var y = document.getElementById("mphone1").value.trim();			

			   if(y=="" && document.getElementById("landline").value.trim()=="")
			{	
			    document.getElementById("error_landline").innerHTML="<font color='white'>Please enter one of your contact numbers (either Mobile or Landline). Senaseva recruiters will use this to contact you.</font>";
			   	document.getElementById("error_landline").style.backgroundColor="red";
				document.getElementById("error_mphone").innerHTML="";
					if(bStatus == false)
					{
					  hidetip();
					}

			   return false;
	        }
			   else if(y!="" && (document.getElementById("landline").value.trim()==""||document.getElementById("landline").value.trim()!=""))
			{

				if(y=="")
			   {
				   		document.getElementById("error_landline").style.backgroundColor="";
						document.getElementById("error_mphone").innerHTML="<font color='white'>Enter Mobile No.</font>";
						document.getElementById("error_mphone").style.backgroundColor="red";
						if(bStatus == false)
						{
						  hidetip();
						}

				return false;
				}
				//else if(y.search(mikExp) == -1) 
			
				else if(IsNumeric(y)==false)
				//else  if(isNaN(y)==true)
			   {	document.getElementById("error_mphone").innerHTML="<font color='white'>Enter valid mobile number</font>";
						document.getElementById("error_mphone").style.backgroundColor="red";
									   		document.getElementById("error_landline").style.backgroundColor="";
					if(bStatus == false)
					{
					  hidetip();
					}

				  return false; 
			   }
		    	else
				{
					document.getElementById("error_mphone").innerHTML="";
				document.getElementById("error_mphone").style.backgroundColor="";
							   		document.getElementById("error_landline").style.backgroundColor="";
					return true;
				}
			}
			else
			{
						document.getElementById("error_mphone").innerHTML="";
		document.getElementById("error_mphone").style.backgroundColor="";
					return true;
			}

			/*if(bStatus == false)
			{
				hidetip();
			}*/					

   }

function gender()
{
//	var doc=document.contactForm;
//alert(document.contactForm.ddlService.value);


	if(document.getElementById("ddgender").value=="")
	{
		document.getElementById("error_gender").innerHTML="<font color='white'>Please select gender</font>";
		document.getElementById("error_gender").style.backgroundColor="red";
			if(bStatus == false)
			{
			  hidetip();
			}

		return false;
	}else
	{
		document.getElementById("error_gender").innerHTML="<font color='red'></font>";
		document.getElementById("error_gender").style.backgroundColor="";
		return true;	
	}
				

}

function maritalstatus()
{
//	var doc=document.contactForm;
//alert(document.contactForm.ddlService.value);
    
	if(document.getElementById("ddMaritalStatus").value=="")
	{
		document.getElementById("error_maritalstatus").innerHTML="<font color='white'>Please select marital status</font>";
		document.getElementById("error_maritalstatus").style.backgroundColor="red";
		if(bStatus == false)
			{
			  hidetip();
			}
		return false;
	}else
	{
		document.getElementById("error_maritalstatus").innerHTML="<font color='white'></font>";
				document.getElementById("error_maritalstatus").style.backgroundColor="";
		return true;	
	}
		
}

function city1change()
{
	var w=document.getElementById("city1").selectedIndex;
	document.getElementById("ocity").value=document.getElementById("city1").options[w].text;
}


function category()
{
	var w=document.getElementById("ddlJobCategory").selectedIndex;
	document.getElementById("txtfc1").value=document.getElementById("ddlJobCategory").options[w].text;
	var w1=document.getElementById("ddlJobsubcategory").selectedIndex;
	document.getElementById("txtrole1").value=document.getElementById("ddlJobsubcategory").options[w1].text;

}
function subcategory()
{
	var w=document.getElementById("ddlJobsubcategory").selectedIndex;
	document.getElementById("txtrole1").value=document.getElementById("ddlJobsubcategory").options[w].text;
}
function vacancy()
{
	var w=document.getElementById("ddlVacancies").selectedIndex;
	document.getElementById("txtvacancy").value=document.getElementById("ddlVacancies").options[w].text;
}
function level()
{
	var w=document.getElementById("ddlLevel").selectedIndex;
	document.getElementById("txtlevel").value=document.getElementById("ddlLevel").options[w].text;
}
function jlocation()
{
	var w=document.getElementById("jcity1").selectedIndex;
	document.getElementById("jcity").value=document.getElementById("jcity1").options[w].text;
}

function ug1()
{
	var w=document.getElementById("ugcourse").selectedIndex;
	document.getElementById("ugcourse1").value=document.getElementById("ugcourse").options[w].text;
	var w1=document.getElementById("ugspec").selectedIndex;
	document.getElementById("ougspec").value=document.getElementById("ugspec").options[w1].text;

}
function ugspec1()
{
	var w=document.getElementById("ugspec").selectedIndex;
	document.getElementById("ougspec").value=document.getElementById("ugspec").options[w].text;
}
function pg1()
{
	var w=document.getElementById("pgcourse").selectedIndex;
	document.getElementById("pgcourse1").value=document.getElementById("pgcourse").options[w].text;
	var w1=document.getElementById("pgspec").selectedIndex;
	document.getElementById("pgspec1").value=document.getElementById("pgspec").options[w1].text;

}

function pgspec2()
{
	var w=document.getElementById("pgspec").selectedIndex;
	document.getElementById("pgspec1").value=document.getElementById("pgspec").options[w].text;
}

function validateContactInformationForm_old()
{	var sCounter = 0;
	bStatus = true;
	if (companynamed() == false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (named() == false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (ValidateEmail()==false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (companyaddressd()==false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	
	/*if(city1check()==false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}*/
	if (Validatemobile()==false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (validatelandline()==false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (JobCategory()==false)
	{
		sCounter = parseInt(sCounter) + 1; 			
	} 
	if (JobsubCategory()==false && document.getElementById("role1").style.display=="")
	{
		sCounter = parseInt(sCounter) + 1; 			
	} 
	if (vacanciesd()==false)
	{
		sCounter = parseInt(sCounter) + 1; 			
	} 
	if (jcity1check()==false)
	{
		sCounter = parseInt(sCounter) + 1; 			
	} 
	if (jobprofile1()==false)
	{
		sCounter = parseInt(sCounter) + 1; 			
	} 
	if (annualctc1d()==false)	
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	
	if (postd()==false)	
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (servicetype1()==false)
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (undgradd()==false)	
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	/*if (undgradspec()==false)	
	{
		sCounter = parseInt(sCounter) + 1; 
	}*/
	if (frmAged()==false)	
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	if (frmExpd()==false)	
	{
		sCounter = parseInt(sCounter) + 1; 
	}
	/*if (dWorkExp()==false)	
	{
		sCounter = parseInt(sCounter) + 1; 
	}*/
	bStatus = false;
	if(parseInt(sCounter) > 0)
	{
		alert("There are some empty fields. Please complete the fields marked in red");
		return false;
	}else
	{
		alert("Form is Complete");
		//document.forms[0].submit();
		return true;
	}
}
