var bStatus = false;
var arsubcategory = new Array();
/*arsubcategory = [

['ACCOUNTS & FINANCE','Accounts & Finance','Accounts & Finance'],
['ADMINISTRATION','Administration','Administration'],
['ADVT/ PR/ EVENT MANAGEMENT','Advertising','Advertising'],
['ADVT/ PR/ EVENT MANAGEMENT','Event management','Event management'],
['ADVT/ PR/ EVENT MANAGEMENT','PR','PR'],
['AVIATION','Aeronautics','Aeronautics'],
['AVIATION','Air Traffic Controllers','Air Traffic Controllers'],
['AVIATION','Meteorological services','Meteorological services'],
['AVIATION','Navigators','Navigators'],
['AVIATION','Pilots','Pilots'],
['CATERING & HOSPITALITY','Catering','Catering'],
['CATERING & HOSPITALITY','Hospitality','Hospitality'],
['CUSTOMER CARE','Customer Care','Customer Care'],
['ENGINEERING','Automobile','Automobile'],
['ENGINEERING','Aviation','Aviation'],
['ENGINEERING','Civil','Civil'],
['ENGINEERING','Computers','Computers'],
['ENGINEERING','Electrical','Electrical'],
['ENGINEERING','Electronics','Electronics'],
['ENGINEERING','Instrumentation','Instrumentation'],
['ENGINEERING','Marine','Marine'],
['ENGINEERING','Mechanical','Mechanical'],
['ENGINEERING','Telecommunication','Telecommunication'],
['FIRE, SECURITY','Fire','Fire'],
['FIRE, SECURITY','Security','Security'],
['FRESHER/ TRAINEE JOBS','Fresher / Trainee Jobs','Fresher / Trainee Jobs'],
['HUMAN RESOURCE','Human Resource','Human Resource'],
['IT& SOFTWARE','Application Programmer','Application Programmer'],
['IT& SOFTWARE','Chip Design','Chip Design'],
['IT& SOFTWARE','Client Server','Client Server'],
['IT& SOFTWARE','Data Base application','Data Base application'],
['IT& SOFTWARE','E Commerce','E Commerce'],
['IT& SOFTWARE','Embedded/EDA/VLSI/ASIC','Embedded/EDA/VLSI/ASIC'],
['IT& SOFTWARE','ERP, CRM','ERP, CRM'],
['IT& SOFTWARE','Hardware','Hardware'],
['IT& SOFTWARE','Internet Technologies','Internet Technologies'],
['IT& SOFTWARE ','IT & Software','IT & Software'],
['IT& SOFTWARE','Main frame','Main frame'],
['IT& SOFTWARE','Maintenance Programmer','Maintenance Programmer'],
['IT& SOFTWARE','Middle Ware','Middle Ware'],
['IT& SOFTWARE','Mobile','Mobile'],
['IT& SOFTWARE','Network Administration','Network Administration'],
['IT& SOFTWARE','System Programming','System Programming'],
['IT& SOFTWARE','System, EDP, MIS','System, EDP, MIS'],
['LEGAL/ LAW','Legal / Law','Legal / Law'],
['MARKETING','Product……………','Product……………'],
['MARKETING','Sales','Sales'],
['MEDICAL','Allied Health services','Allied Health services'],
['MEDICAL','Clinical Medical','Clinical Medical'],
['MEDICAL','Clinical Surgical','Clinical Surgical'],
['MEDICAL','Dental','Dental'],
['MEDICAL','Hospital Administration','Hospital Administration'],
['MEDICAL','Non- Clinical','Non- Clinical'],
['MEDICAL','Nursing Staff','Nursing Staff'],
['MEDICAL','Paramedical Staff','Paramedical Staff'],
['MERCHANT NAVY','Crew- AB Able Bodied Seamen','Crew- AB Able Bodied Seamen'],
['MERCHANT NAVY','Crew- OS Ordinary Seamen','Crew- OS Ordinary Seamen'],
['MERCHANT NAVY','Crew- Trainee Ordinary Seamen','Crew- Trainee Ordinary Seamen'],
['MERCHANT NAVY','Crew- Trainee Wiper','Crew- Trainee Wiper'],
['MERCHANT NAVY','Crew- Wiper','Crew- Wiper'],
['MERCHANT NAVY','Deck- Cadet','Deck- Cadet'],
['MERCHANT NAVY','Deck- Chief Officer','Deck- Chief Officer'],
['MERCHANT NAVY','Deck- Second Officer','Deck- Second Officer'],
['MERCHANT NAVY','Deck- Third Officer','Deck- Third Officer'],
['MERCHANT NAVY','Electrical Officer','Electrical Officer'],
['MERCHANT NAVY','Engine- Chief Engg.','Engine- Chief Engg.'],
['MERCHANT NAVY','Engine- Engine Cadet','Engine- Engine Cadet'],
['MERCHANT NAVY','Engine- Fifth Engg.','Engine- Fifth Engg.'],
['MERCHANT NAVY','Engine- Fitter','Engine- Fitter'],
['MERCHANT NAVY','Engine- Fourth Engg.','Engine- Fourth Engg.'],
['MERCHANT NAVY','Engine- Motor Man','Engine- Motor Man'],
['MERCHANT NAVY','Engine- Second Engg.','Engine- Second Engg.'],
['MERCHANT NAVY','Engine- Third Engg.','Engine- Third Engg.'],
['MERCHANT NAVY','Master / Captain','Master / Captain'],
['SCM & LOGISTICS','All Sub Categories','All Sub Categories'],
['SCM & LOGISTICS','Export/ Import','Export/ Import'],
['SCM & LOGISTICS','Inventory','Inventory'],
['SCM & LOGISTICS','Purchase','Purchase'],
['SCM & LOGISTICS','Retail chain','Retail chain'],
['SCM & LOGISTICS','Transportation','Transportation'],
['SCM & LOGISTICS','Warehouse','Warehouse'],
['TEACHING/ EDUCATION/ SCHOOL MANAGEMENT','School Management','School Management'],
['TEACHING/ EDUCATION/ SCHOOL MANAGEMENT','Teaching / Education','Teaching / Education'],
['TRANSPORT FLEET MANAGERS, DRIVERS, TECHNICIANS','Drivers','Drivers'],
['TRANSPORT FLEET MANAGERS, DRIVERS, TECHNICIANS','Electricians','Electricians'],
['TRANSPORT FLEET MANAGERS, DRIVERS, TECHNICIANS','Technicians and Fitter','Technicians and Fitter'],
['TRANSPORT FLEET MANAGERS, DRIVERS, TECHNICIANS','Transport Fleet Manager','Transport Fleet Manager']]
*/
arsubcategory = [['1','1','Pilots'],
['1','2','Navigators'],
['1','3','Air Traffic Controllers'],
['1','4','Meteorological services'],
//['1','5','Others (Specify)'],
['2','6','Administration'],
['3','7','Advertising'],
['3','8','PR'],
['3','9','Event management'],
['4','10','Accounts & Finance'],
['5','11','Catering '],
['5','12','Hospitality'],
['6','13','Hospital Administration'],
['6','14','Allied Health services'],
['6','15','Dental'],
['6','16','Non- Clinical'],
['6','17','Clinical Surgical'],
['6','18','Clinical Medical'],
['6','19','Nursing Staff'],
['6','20','Paramedical Staff'],
//['6','21','Others ( Specify)'],
['7','22','Electronics'],
['7','23','Mechanical'],
['7','24','Automobile'],
['7','25','Computers'],
['7','26','Electrical'],
['7','27','Telecommunication'],
['7','28','Civil'],
['7','29','Instrumentation'],
['7','30','Aviation'],
//['7','31','Others (Specify)'],
['8','32','Fire '],
['8','33','Security'],
['9','34','Human Resource'],
['10','35','IT & Software'],
['10','36','Hardware'],
['10','37','Application Programmer'],
['10','38','Maintenance Programmer'],
['10','39','Client Server'],
['10','40','Data Base application'],
['10','41','E Commerce'],
['10','42','Internet Technologies'],
['10','43','Embedded/EDA/VLSI/ASIC'],
['10','44','Chip Design'],
['10','45','ERP, CRM'],
['10','46','Main frame'],
['10','47','Middle Ware'],
['10','48','Mobile'],
['10','49','Network Administration'],
['10','50','System Programming'],
['10','51','System, EDP, MIS'],
//['10','52','Others (Specify)'],
['11','53','Master / Captain'],
['11','54','Deck- Chief Officer'],
['11','55','Deck- Second Officer'],
['11','56','Deck- Third Officer'],
['11','57','Deck- Cadet'],
['11','58','Engine- Chief Engg.'],
['11','59','Engine- Second Engg.'],
['11','60','Engine- Third Engg.'],
['11','61','Engine- Fourth Engg.'],
['11','62','Engine- Fifth Engg. '],
['11','63','Engine- Engine Cadet'],
['11','64','Engine- Motor Man'],
['11','65','Electrical Officer'],
['11','66','Engine- Fitter'],
['11','67','Crew- AB Able Bodied Seamen'],
['11','68','Crew- OS Ordinary Seamen'],
['11','69','Crew- Trainee Ordinary Seamen'],
['11','70','Crew- Wiper'],
['11','71','Crew- Trainee Wiper'],
//['11','72','Others (Specify)'],
['12','73','Purchase'],
['12','74','Transportation'],
['12','75','Retail chain'],
['12','76','Inventory'],
['12','77','Export/ Import'],
['12','78','Warehouse'],
['12','79','All'],
//['12','79','Others (Specify)'],
['13','80','Transport Fleet Manager'],
['13','81','Drivers'],
['13','82','Technicians and Fitter'],
['13','83','Electricians'],
['14','84','Teaching / Education'],
['14','85','School Management'],
['15','86','Legal / Law'],
['16','87','Product……………'],
['17','88','Customer Care'],
['18','89','Fresher / Trainee Jobs'],
//['19','90','Others (Specify)'],
['16','91','Sales']
]

function availability()
{
	if(document.getElementById("ddavailability").value=="Specify")
	{
		document.getElementById("DateOfAvail_Day").style.display="";
		document.getElementById("DateOfAvail_Month").style.display="";
		document.getElementById("DateOfAvail_Year").style.display="";
	}else
	{
		document.getElementById("DateOfAvail_Day").style.display="none";
		document.getElementById("DateOfAvail_Month").style.display="none";
		document.getElementById("DateOfAvail_Year").style.display="none";
	}
}
function availablecheck()
{
	if(document.getElementById("ddavailability").value=="0")
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'>Available Date OF Join not selected.</font>";
			document.getElementById("error_joindt").style.backgroundColor="red";
	return false;
	}else
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'></font>";
				document.getElementById("error_joindt").style.backgroundColor="";
	return true;
	}
}

function fillsubcategory(id) 
{
    if (id == 1)
	{
		var fTypes = document.getElementById("ddlJobCategory");
		var fItems = document.getElementById("ddlJobsubcategory");
		var subtype=document.getElementById("txtrole1").value;
	}
	
	if (subtype==null)
	{
		subtype="0";
	}
    var a = arsubcategory;
    var b, c, d, intItem, intType;
 
 
        for ( b = 0; b < a.length; b++ )
		{
		    if ( a[0][b] == fTypes.value)
                {
					intType = a[0][b];
				}
        
		}
 
    if ( intType == null )
	{
        intType = fTypes.options[fTypes.selectedIndex].value;
	
	}
    fItems.options.length = 0;
            fItems.options[fItems.options.length] = new Option("Select Role","");
			//for addign role as per array
    for ( d = 0; d < a.length; d++ ) {

        if (intType.trim()==a[d][0].trim())
		{
				fItems.options[fItems.options.length] = new Option(a[d][2],a[d][1]);
		}
    }
	//For selecting role defined in db
	for (var i=0;i<fItems.options.length-1 ;i++ )
		{

			if (subtype.trim()==fItems.options(i).value)
			{//alert("");
					fItems.options(i).selected=true;
			}
		}
	if(fItems.options.length>2)
	{
		document.getElementById("role"+id).style.display="";		
	}else
	{
		document.getElementById("role"+id).style.display="none";		
	}
}




 String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
function funclocachoice2(disp)
{

	if(disp=="show")
	{
		document.getElementById("loca2").style.display="";
		document.getElementById("locachoice2show").style.display="none";
		document.getElementById("locachoice2hide").style.display="";
		document.getElementById("loctip1").style.display="";
	}
	else
	{
		document.form1.city2.selectedindex=0;
		document.getElementById("loca2").style.display="none";
		document.getElementById("locachoice2show").style.display="";
		document.getElementById("locachoice2hide").style.display="none";
		document.getElementById("loctip1").style.display="none";
		document.getElementById("city2").selectedIndex=0;
		document.getElementById("ocity2").value="";
	}
}
function funclocachoice3(disp)
{
	if(disp=='show')
	{
		document.getElementById("loca3").style.display="";
		document.getElementById("locachoice3show").style.display="none";
		document.getElementById("locachoice3hide").style.display="";
		document.getElementById("locachoice2show").style.display="none";
		document.getElementById("locachoice2hide").style.display="none";
		
	}
	else
	{
		document.form1.city3.selectedindex=0;
		document.getElementById("loca3").style.display="none";
		document.getElementById("locachoice3show").style.display="";
		document.getElementById("locachoice3hide").style.display="none";
		document.getElementById("locachoice2show").style.display="none";
		document.getElementById("locachoice2hide").style.display="";
		document.getElementById("city3").selectedIndex=0;
		document.getElementById("ocity3").value="";
		document.getElementById("removechoice2").style.display="none";

		
	}
}

function annualctc1()
{
	tooltip("Select Your Expected Annual Salary","ddlCTC","120");
}
function annualctc1d()
{
	if(document.getElementById("ddlCTC").value=="0")
	{
		document.getElementById("error_ctc").innerHTML="<font color='white'>Select Your Expected Annual Salary</font>";
		document.getElementById("error_ctc").style.backgroundColor="red";
		return false;
	}else
	{
		document.getElementById("error_ctc").innerHTML="<font color='red'></font>";
		document.getElementById("error_ctc").style.backgroundColor="";
		return true;
	}
		hidetip();
}

function dobddd()
{
		if(document.form1.DateOfAvail_Year.value=="" || document.form1.DateOfAvail_Month.value=="" || document.form1.DateOfAvail_Day.value=="")
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'>Available Date OF Join not selected.</font>";
			document.getElementById("error_joindt").style.backgroundColor="red";
	return false;
	}else
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'></font>";
				document.getElementById("error_joindt").style.backgroundColor="";
	return true;
	}
		hidetip();
	
}
function dobmmd()
{
		if(document.form1.DateOfAvail_Year.value=="" || document.form1.DateOfAvail_Month.value=="" || document.form1.DateOfAvail_Day.value=="")
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'>Available Date OF Join not selected.</font>";
				document.getElementById("error_joindt").style.backgroundColor="red";
	return false;
	}else
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'></font>";
					document.getElementById("error_joindt").style.backgroundColor="";
	return true;
	}
		hidetip();
	
}
function gotopreview()
{
	location.href="preview.asp";
}
function dobyyd()
{
	
		if(document.form1.DateOfAvail_Year.value=="" || document.form1.DateOfAvail_Month.value=="" || document.form1.DateOfAvail_Day.value=="")
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'>Available Date OF Join not selected.</font>";
				document.getElementById("error_joindt").style.backgroundColor="red";
	return false;
	}else
	{
	document.getElementById("error_joindt").innerHTML="<font color='white'></font>";
					document.getElementById("error_joindt").style.backgroundColor="";
	return true;
	}
		hidetip();
	
}
function JobCategory()
{
	if(document.getElementById("ddlJobCategory").value=="")
	{
			document.getElementById("error_jobcat1").innerHTML="<font color='white'>Functional Area not selected.</font>";
			document.getElementById("error_jobcat1").style.backgroundColor="red";
			return false;
	}else
	{
			document.getElementById("error_jobcat1").innerHTML="<font color='white'></font>";
			document.getElementById("error_jobcat1").style.backgroundColor="";
			return true;
	}
		hidetip();
	
}
function JobsubCategory()
{
	if(document.getElementById("ddlJobsubcategory").value=="" && document.getElementById("ddlJobsubcategory").length>2)
	{
			document.getElementById("error_jobsubcat1").innerHTML="<font color='white'>Role not selected.</font>";
			document.getElementById("error_jobsubcat1").style.backgroundColor="red";
			return false;
	}else
	{
			document.getElementById("error_jobsubcat1").innerHTML="<font color='white'></font>";
			document.getElementById("error_jobsubcat1").style.backgroundColor="";
			return true;
	}
		hidetip();
	
}

function vacancy1check()
{
	if(document.getElementById("ddlVacancies").value=="0")
	{
			document.getElementById("jerror_vacan1").innerHTML="<font color='white'>Vacancy for location 1 not selected.</font>";
			document.getElementById("jerror_vacan1").style.backgroundColor="red";
			return false;
	}else
	{

			document.getElementById("jerror_vacan1").innerHTML="<font color='white'></font>";
			document.getElementById("jerror_vacan1").style.backgroundColor="";
			return true;
	}
}

function jcity1check()
{

	if(document.getElementById("jcity1").value.trim()=="-1")
	{
			document.getElementById("jerror_city1").innerHTML="<font color='white'>Location 1 not selected.</font>";
			document.getElementById("jerror_city1").style.backgroundColor="red";
			return false;
	}else
	{

			document.getElementById("jerror_city1").innerHTML="<font color='white'></font>";
			document.getElementById("jerror_city1").style.backgroundColor="";
			return true;
	}
}
function city1check()
{
	if(document.getElementById("city1").value=="-1")
	{
			document.getElementById("error_city1").innerHTML="<font color='white'>Location in Corporate Address 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 city2check()
{
	if(document.form1.city2.value=="-1")
	{
			document.getElementById("error_city2").innerHTML="<font color='white'>City in Choice 2 not selected.</font>";
			document.getElementById("error_city2").style.backgroundColor="red";
			return false;
	}else
	{

			document.getElementById("error_city2").innerHTML="<font color='white'></font>";
			document.getElementById("error_city2").style.backgroundColor="";
			return true;
	}
}

function city3check()
{
	if(document.form1.city3.value=="-1")
	{
			document.getElementById("error_city3").innerHTML="<font color='white'>City in Choice 3 not selected.</font>";
			document.getElementById("error_city3").style.backgroundColor="red";
			return false;
	}else
	{

			document.getElementById("error_city3").innerHTML="<font color='white'></font>";
			document.getElementById("error_city3").style.backgroundColor="";
			return true;
	}
}
function citychange1()
{
	var doc=document.forms[0];
	var w=doc.city1.selectedIndex;
	if(doc.city1.options[w].text.match("Other")!=null)
	{
		document.getElementById("ocity1").style.display="";
	}else
	{
		document.getElementById("ocity1").style.display="none";
	}
}

function citychange2()
{
	var doc=document.forms[0];
	var w=doc.city2.selectedIndex;
	if(doc.city2.options[w].text.match("Other")!=null)
	{
		document.getElementById("ocity2").style.display="";
	}else
	{
		document.getElementById("ocity2").style.display="none";
	}
}

function citychange3()
{
	var doc=document.forms[0];
	var w=doc.city3.selectedIndex;
	if(doc.city3.options[w].text.match("Other")!=null)
	{
		document.getElementById("ocity3").style.display="";
	}else
	{
		document.getElementById("ocity3").style.display="none";
	}
}
function citychek1()
{
	var doc=document.form1;
	var w=doc.city1.selectedIndex;
	if(doc.city1.options[w].text.match("Other")!=null)
	{
		if(doc.ocity1.value.trim()=="" || doc.ocity1.value.trim()=="Please Specify Location")
		{
			document.getElementById("error_city1").innerHTML="<font color='white'>Enter Preferred Location In Case of Others</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;	
		}

	}else
	{
		return true;
	}
}

function citychek2()
{
	var doc=document.form1;
	var w=doc.city2.selectedIndex;
	if(doc.city2.options[w].text.match("Other")!=null)
	{
		if(doc.ocity2.value.trim()=="" || doc.ocity2.value.trim()=="Please Specify Location")
		{
			document.getElementById("error_city2").innerHTML="<font color='white'>Enter Preferred Location In Case of Others</font>";
			document.getElementById("error_city2").style.backgroundColor="red";
			return false;	
		}else
		{
			document.getElementById("error_city2").innerHTML="<font color='white'></font>";
			document.getElementById("error_city2").style.backgroundColor="";
			return true;	
		}

	}else
	{
		return true;
	}
}
function citychek3()
{
	var doc=document.form1;
	var w=doc.city3.selectedIndex;
	if(doc.city3.options[w].text.match("Other")!=null)
	{
		if(doc.ocity3.value.trim()=="" || doc.ocity3.value.trim()=="Please Specify Location")
		{
			document.getElementById("error_city3").innerHTML="<font color='white'>Enter Preferred Location In Case of Others</font>";
			document.getElementById("error_city3").style.backgroundColor="red";
			return false;	
		}else
		{
			document.getElementById("error_city3").innerHTML="<font color='white'></font>";
			document.getElementById("error_city3").style.backgroundColor="";
			return true;	
		}

	}else
	{
		return true;
	}
}
