function clearAll()
{
document.myform.res_header.value="";
document.myform.keyslills.value="";
document.myform.totmexp.value="";
document.myform.totyexp.value="";
document.myform.empname1.value="";
document.myform.joinmonth1.value="";
document.myform.joinyear1.value="";
document.myform.resimonth1.value="";
document.myform.resiyear1.value="";
document.myform.empdesig1.value="";
document.myform.jobprofile1.value="";
document.myform.empname2.value="";
document.myform.joinmonth2.value="";
document.myform.joinyear2.value="";
document.myform.resimonth2.value="";
document.myform.resiyear2.value="";
document.myform.empdesig2.value="";
document.myform.jobprofile2.value="";

}
/**setting job subcategories of corresponding job category*/
var jobdb=new Object()
jobdb["Admin Services"] = [{value:"Receptionist", text:"Receptionist"},
						{value:"Data Entry/Clerical/Stenographer/Secretarial", text:"Data Entry/Clerical/Stenographer/Secretarial"},
						{value:"Peon/Office Boy/Chauffer/Driver", text:"Peon/Office Boy/Chauffer/Driver"},
						{value:"Security/Protective Service", text:"Security/Protective Service"},
						{value:"Maintanance/Repair (Facilities & Machinary)", text:"Maintanance/Repair (Facilities & Machinary)"},
						{value:"Other Admin Support", text:"Other Admin Support"}
						];
jobdb["Engineering"] = [{value:"Civil", text:"Civil"},
						{value:"Mechanical", text:"Mechanical"},
						{value:"Electrical", text:"Electrical"},
						{value:"Chemical", text:"Chemical"},
						{value:"Electronics & Telecommunication", text:"Electronics & Telecommunication"},
						{value:"Automobile", text:"Automobile"},
						{value:"Architecture", text:"Architecture"},
						{value:"Fire & Industrial Safty", text:"Fire & Industrial Safty"},
						{value:"Other Engineering", text:"Other Engineering"}
						];
jobdb["Finance/Accounts"] = [{value:"Banking / Non Banking Financial  Services", text:"Banking / Non Banking Financial  Services"},
						{value:"Insurance / Statistics / Actuarial Science", text:"Insurance / Statistics / Actuarial Science"},
						{value:"Corporate Finance / Investment Banking", text:"Corporate Finance / Investment Banking"},
						{value:"General / Cost Accounting", text:"General / Cost Accounting"},
						{value:"Audit / Taxation / Professional Services", text:"Audit / Taxation / Professional Services"},
						{value:"Other Finance/Accounts", text:"Other Finance/Accounts"}
						];
jobdb["HealthCare/Medical/Paramedical"] = [{value:"Hospital Administration", text:"Hospital Administration"},
						{value:"Allied Health / Therapy / Rehabilitation Services", text:"Allied Health / Therapy / Rehabilitation Services"},
						{value:"Medical & Surgical Equiptment Technicians", text:"Medical & Surgical Equiptment Technicians"},
						{value:"Laboratory / Pathology Services", text:"Laboratory / Pathology Services"},
						{value:"Medical Dental Practice / Doctor", text:"Medical Dental Practice / Doctor"},
						{value:"Pharmacy", text:"Pharmacy"},
						{value:"Radiology / Imaging / CT / MRT Scan Technician", text:"Radiology / Imaging / CT / MRT Scan Technician"},
						{value:"Registered Nurses / Nursing Tutors", text:"Registered Nurses / Nursing Tutors"},
						{value:"Home Nursing / Aids / Attenders", text:"Home Nursing / Aids / Attenders"},
						{value:"Medical & Surgical Equiptment Sales", text:"Medical & Surgical Equiptment Sales"},
						{value:"Other HealthCare", text:"Other HealthCare"}
						];

jobdb["Hospitality/Travel & Tourism"] = [{value:"Air Hostess / Stewards / Flight Purser", text:"Air Hostess / Stewards / Flight Purser"},
						{value:"Travel Management & Ticketing / Travel Desk Operations", text:"Travel Management & Ticketing / Travel Desk Operations"},
						{value:"Tourist Guide", text:"Tourist Guide"},
						{value:"Catering Service General / Industrial", text:"Catering Service General / Industrial"},
						{value:"Cook / Commy / Chef / Sous Chef / F&B Production", text:"Cook / Commy / Chef / Sous Chef / F&B Production"},
						{value:"Waiter / Restaurant Captains / F&B Service", text:"Waiter / Restaurant Captains / F&B Service"},
						{value:"Other Hospitality", text:"Other Hospitality"}
						];

jobdb["IT Enabled Services"] = [{value:"Business Process OutSourcing/call center", text:"Business Process OutSourcing/call center"},
						{value:"Medical Transcription/Legal Transcription", text:"Medical Transcription/Legal Transcription"},
						{value:"Web Hosting Services", text:"Web Hosting Services"},
						{value:"Other IT Enabled Services", text:"Other IT Enabled Services"}
						];

jobdb["IT/Computer/Internet"] = [{value:"Hardware Maintenance/Networking/System Administration", text:"Hardware Maintenance/Networking/System Administration"},
						{value:"Software/Programming/System Analyst", text:"Software/Programming/System Analyst"},
						{value:"Graphic Designer/Web Designer/Multimedia", text:"Graphic Designer/Web Designer/Multimedia"},
						{value:"Internet/E-Commerce", text:"Internet/E-Commerce"},
						{value:"Sales & Marketing", text:"Sales & Marketing"},
						{value:"Training / Faculty", text:"Training / Faculty"},
						{value:"Other IT/Computer", text:"Other IT/Computer"}
						];

jobdb["Media/Arts"] = [{value:"Advertising Client Servicing", text:"Advertising Client Servicing"},
						{value:"Mass Communication & Journalism", text:"Mass Communication & Journalism"},
						{value:"Visualizer / Graphic Designing/Desk Top Publishing (DTP)", text:"Visualizer / Graphic Designing/Desk Top Publishing (DTP)"},
						{value:"Creative & Performing Arts/Copy Writing", text:"Creative & Performing Arts/Copy Writing"},
						{value:"Entertainment / Film Industry", text:"Entertainment / Film Industry"},
						{value:"Other Media/Arts", text:"Other Media/Arts"}
						];
jobdb["Personnel/HR"] = [{value:"Welfare Admn./Industrial Relations/Personal Mgmt.", text:"Welfare Admn./Industrial Relations/Personal Mgmt."},
						{value:"Human Resource Development/Training/HR Consulting", text:"Human Resource Development/Training/HR Consulting"},
						{value:"Employment Agencies/Recruitment", text:"Employment Agencies/Recruitment"},
						{value:"Administration/Facility Management", text:"Administration/Facility Management"},
						{value:"Other H.R", text:"Other H.R"}
						];

jobdb["Purchasing/Logistics"] = [{value:"Supply Chain and Logistics Management", text:"Supply Chain and Logistics Management"},
						
						{value:"Other Purchase/Logistics", text:"Other Purchase/Logistics"}
						];
jobdb["Sales & Marketing"] = [{value:"Customer Care/Support Executives", text:"Customer Care/Support Executives"},
						
						{value:"Other Sales", text:"Other Sales"}
						];
jobdb["Science & Technology"] = [{value:"BioTechnology", text:"BioTechnology"},
						
						{value:"Chemical", text:"Chemical"}
						];

jobdb["Shipping"] = [{value:"Marine", text:"Marine"},
						
						{value:"OffShore", text:"OffShore"}
						];
jobdb["Skilled/SemiSkilled"] = [{value:"Driver", text:"Driver"},
						
						{value:"Mechanist", text:"Mechanist"}
						];

function setJobcat(chooser)
{
    var newElem1;
    var where1 = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
    var jobChooser = chooser.form.elements["tarjobspec"];
    while (jobChooser.options.length) {
        jobChooser.remove(0);
    }
    var choice1 = chooser.options[chooser.selectedIndex].value;
    var db1 = jobdb[choice1];
    newElem1 = document.createElement("option");
    newElem1.text = "Choose a Job:";
    newElem1.value = "";
    jobChooser.add(newElem1, where1);
    if (choice1 != "") {
        for (var i = 0; i < db1.length; i++) {
            newElem1 = document.createElement("option");
            newElem1.text = db1[i].text;
            newElem1.value = db1[i].value;
            jobChooser.add(newElem1, where1);
        }
    }

}
/*Client side form validations*/
function checkAll()
{//starts function
if(document.myform.res_header.value=="")
{
alert("Mandatory field Resume Title cannot be empty");
document.myform.res_header.focus();
return false;
}
if(document.myform.tarjob.value=="--select one--")
{
alert("Mandatory field Target job category cannot be empty");
document.myform.tarjob.focus();
return false;
}
if(document.myform.tarjobspec.value=="")
{
alert("Mandatory field Job Specialization cannot be empty");
document.myform.tarjobspec.focus();
return false;
}
if(document.myform.joblocation.value=="")
{
alert("Mandatory field Job Location cannot be empty");
document.myform.joblocation.focus();
return false;
}
if(document.myform.keyskills.value=="")
{
alert("Mandatory field Key Skills cannot be empty");
document.myform.keyskills.focus();
return false;
}
if(document.myform.salterm.value=="")
{
alert("Mandatory field Expecting Salary cannot be empty");
document.myform.salterm.focus();
return false;
}
if(document.myform.salrange.value=="")
{
alert("Mandatory field Expecting Salary cannot be empty");
document.myform.salrange.focus();
return false;
}
if(document.myform.jobstatus.value=="")
{
alert("Mandatory field Current Job Status cannot be empty");
document.myform.jobstatus.focus();
return false;
}
if(document.myform.jobstatus.value=="Employed")
{
if(document.myform.empname1.value=="")
{
alert("Mandatory field Employer Name cannot be empty");
document.myform.empname1.focus();
return false;
}
if(document.myform.empdesig1.value=="")
{
alert("Mandatory field Designation cannot be empty");
document.myform.empdesig1.focus();
return false;
}
if(document.myform.joinmonth1.value=="")
{
alert("Mandatory field Date Joined cannot be empty");
document.myform.joinmonth1.focus();
return false;
}
if(document.myform.joinyear1.value=="")
{
alert("Mandatory field Date Joined cannot be empty");
document.myform.joinyear1.focus();
return false;
}
/*if(document.myform.resimonth1.value=="")
{
alert("Mandatory field cannot be empty");
document.myform.resimonth1.focus();
return false;
}
if(document.myform.resiyear1.value=="")
{
alert("Mandatory field cannot be empty");
document.myform.resiyear1.focus();
return false;
}*/

/*if(document.myform.jobprofile1.value=="")
{
alert("Mandatory field cannot be empty");
document.myform.jobprofile1.focus();
return false;
}*/
////////////////
if(document.myform.resiyear2.value!="" && document.myform.resimonth2.value!="" && document.myform.joinyear1.value!="" && document.myform.joinmonth1.value!="")
{	
	if(document.myform.joinyear1.value < document.myform.resiyear2.value)
    {
	alert("joining date invalid");
	document.myform.joinyear1.focus();
    return false;
	}
    if(document.myform.joinyear1.value == document.myform.resiyear2.value && document.myform.joinmonth1.value < document.myform.resimonth2.value )
    {
	alert("joining date invalid");
	document.myform.joinyear1.focus();
    return false;
	}
}
///////////////////
if(document.myform.empname2.value!="")
{
	if(document.myform.empdesig2.value=="")
	{
	alert("This field Employer Name cannot be empty");
	document.myform.empdesig2.focus();
	return false;
	}
	if(document.myform.joinmonth2.value=="")
	{
	alert("Mandatory field Date Joined cannot be empty");
	document.myform.joinmonth2.focus();
	return false;
	}
	if(document.myform.joinyear2.value=="")
	{
	alert("Mandatory field Date Joined cannot be empty");
	document.myform.joinyear2.focus();
	return false;
	}
	if(document.myform.resimonth2.value=="")
	{
	alert("Mandatory field Date Resigned cannot be empty");
	document.myform.resimonth2.focus();
	return false;
	}
	if(document.myform.resiyear2.value=="")
	{
	alert("Mandatory field Date Resigned cannot be empty");
	document.myform.resiyear2.focus();
	return false;
	}
	/*if(document.myform.jobprofile2.value=="")
	{
	alert("Mandatory field cannot be empty");
	document.myform.jobprofile2.focus();
	return false;
	}*/
}
}
//end function


}
function popup(url2)
{
window.open(url2,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=150");
}

