﻿
<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		nav_01_over = newImage("dynamicdata/images/nav_01-over.gif");
		nav_02_over = newImage("dynamicdata/images/nav_02-over.gif");
		nav_03_over = newImage("dynamicdata/images/nav_03-over.gif");
		nav_04_over = newImage("dynamicdata/images/nav_04-over.gif");
		nav_05_over = newImage("dynamicdata/images/nav_05-over.gif");
		nav_06_over = newImage("dynamicdata/images/nav_06-over.gif");
		preloadFlag = true;
	}
}preloadImages();

// -->








// validation for employer login


function valemplogin()
{
  if(document.form1.txt_username.value=="")
  {
     alert("Username Required.")
     document.form1.txt_username.focus();
     return false;
  }
  
  if(document.form1.txt_password.value=="")
  {
     alert("Password Required.")
     document.form1.txt_password.focus();
     return false;
  }
  
  return true;
  
}

//validation for applicant login

function valapplogin()
{
  if(document.form1.txt_username.value=="")
  {
     alert("Username Required.")
     document.form1.txt_username.focus();
     return false;
  }
  
  if(document.form1.txt_password.value=="")
  {
     alert("Password Required.")
     document.form1.txt_password.focus();
     return false;
  }
  
  return true;
  
}


//validation for employer details


function employervalidation()
{
  
    if(document.form1.txt_companyName.value=="")
    {
        alert("Please Enter Company Name.");
        document.form1.txt_companyName.focus();
        return false;
        
    }
    
    if(document.form1.txt_address.value=="")
    {
        alert("Please Enter Address.");
        document.form1.txt_address.focus();
        return false;
        
    }
    
    if(document.form1.txt_city.value=="")
    {
        alert("Please Enter City.");
        document.form1.txt_city.focus();
        return false;
        
    }
    
    if(document.form1.txt_state.value=="")
    {
        alert("Please Enter State.");
        document.form1.txt_state.focus();
        return false;
        
    }
    
    if(document.form1.drop_country.value=="")
    {
        alert("Please Select Country.");
        document.form1.drop_country.focus();
        return false;
        
    }
    
    if(document.form1.txt_zipcode.value=="")
    {
        alert("Please Enter ZIP Code.");
        document.form1.txt_zipcode.focus();
        return false;
        
    }
    
    if(document.form1.txt_companyPhoneNumber.value=="")
    {
        alert("Please Enter Company Phone Number.");
        document.form1.txt_companyPhoneNumber.focus();
        return false;
        
    }
    if(document.form1.txt_firstName.value=="")
    {
        alert("Please Enter Contact Person's First Name.");
        document.form1.txt_firstName.focus();
        return false;
        
    }
        
    if(document.form1.txt_lastName.value=="")
    {
        alert("Please Enter Contact Person's Last Name.");
        document.form1.txt_lastName.focus();
        return false;
        
    }
       
    if(document.form1.txt_contactPersonPhoneNumber.value=="")
    {
        alert("Please Enter Contact Person's Phone Number.");
        document.form1.txt_contactPersonPhoneNumber.focus();
        return false;
        
    }
     
    if(document.form1.txt_telephoneExtension.value=="")
    {
        alert("Please Enter Telephone Extension.");
        document.form1.txt_telephoneExtension.focus();
        return false;
        
    }
        
    if(document.form1.txt_email.value=="")
    {
        alert("Please Enter Contact Person's Email Address.");
        document.form1.txt_email.focus();
        return false;
        
    }
    else
	{	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
		var matchArray = document.form1.txt_email.value.match(emailPat);
		if (matchArray == null)
		{
			alert ("Please Enter Valid Email Address.");
			document.form1.txt_email.focus();
			return false;
		}					
	}
    
    if(document.form1.txt_userName.value=="")
    {
        alert("Please Enter User Name.");
        document.form1.txt_userName.focus();
        return false;        
    }
         
    if(document.form1.txt_password.value=="")
    {
        alert("Please Enter Password.");
        document.form1.txt_password.focus();
        return false;        
    }
    
    if(document.form1.txt_confirmPassword.value=="")
    {
        alert("Please Enter Confirm Password.");
        document.form1.txt_confirmPassword.focus();
        return false;        
    }
    
	if (document.form1.txt_password.value!=document.form1.txt_confirmPassword.value)
	{  
	    alert("Password mismatch.");
	    document.form1.txt_confirmPassword.focus();
	    return false;
	}
	
    if(document.form1.txt_yourSecretQuestion.value=="")
    {
        alert("Please Enter Your Secret Question.");
        document.form1.txt_yourSecretQuestion.focus();
        return false;        
    }
        
    if(document.form1.txt_answer.value=="")
    {
        alert("Please Enter Answer.");
        document.form1.txt_answer.focus();
        return false;        
    }
    
    if(document.form1.txt_companyProfileSummary.value=="")
    {
        alert("Please Enter Company Profile Summary.");
        document.form1.txt_companyProfileSummary.focus();
        return false;        
    }
    return true;
	
}


//validation for job posting details



function postingVal()
{

  if(document.form1.drp_jobcategory.value=="")
    {
        alert("Please Select Job Category.");
        document.form1.drp_jobcategory.focus();
        return false;
        
    }
    
    
    
    if(document.form1.txt_companyname.value=="")
    {
        alert("Please Enter Company Name.");
        document.form1.txt_companyname.focus();
        return false;
        
    }
    
     if(document.form1.txt_websiteaddr.value=="")
    {
        alert("Please Enter Website Address.");
        document.form1.txt_websiteaddr.focus();
        return false;
        
    }
    
     if(document.form1.txt_jobtitle.value=="")
    {
        alert("Please Enter Job Title.");
        document.form1.txt_jobtitle.focus();
        return false;
        
    }
    
     if(document.form1.txt_joblocation.value=="")
    {
        alert("Please Enter Job Location.");
        document.form1.txt_joblocation.focus();
        return false;
        
    }
    
    
    var anum=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum.test(document.form1.txt_noOfjobopening.value))
	{
		
		alert("Please Enter Valid Number Of Job Openings.");
		document.form1.txt_noOfjobopening.value="";
		document.form1.txt_noOfjobopening.focus();
		return false;
	}
	
	if(document.form1.drp_qualification.value=="")
    {
        alert("Please Select Qualification.");
        document.form1.drp_qualification.focus();
        return false;
        
    }
    
    if(document.form1.drp_languages.value=="")
    {
        alert("Please Select Language.");
        document.form1.drp_languages.focus();
        return false;
        
    }
    
    if(document.form1.drp_jobtype.value=="")
    {
        alert("Please Select Job Type.");
        document.form1.drp_jobtype.focus();
        return false;
        
    }
    
    if(document.form1.drp_jobstatus.value=="")
    {
        alert("Please Select Job Status.");
        document.form1.drp_jobstatus.focus();
        return false;
        
    }
    
    
	var anum1=/(^\d+$)|(^\d+\.\d+$)/
	if (!anum1.test(document.form1.txt_salary.value))
	{
		
		alert("Please Enter Valid Salary.");
		document.form1.txt_salary.value="";
		document.form1.txt_salary.focus();
		return false;
	}
	
	if (document.form1.fl_jobuploadfile.value)
	{
		filename=window.document.form1.fl_jobuploadfile.value
		i = filename.lastIndexOf(".");
		ext = filename.substr(i+1);
		ext=ext.toLowerCase();
		if (ext != "doc" && ext !="pdf")  
		{		
			alert("Only .doc or .pdf files are allowed to upload");
			window.document.form1.fl_jobuploadfile.focus();
			window.document.form1.fl_jobuploadfile.select();
			return false;
		}
	}
	
	if(document.form1.txt_jobdescription.value=="")
    {
        alert("Please Enter Job Description.");
        document.form1.txt_jobdescription.focus();
        return false;
        
    }
    
    if(document.form1.txt_applicationinstruction.value=="")
    {
        alert("Please Enter Application Instruction.");
        document.form1.txt_applicationinstruction.focus();
        return false;
        
    }
    
    
    
    return true;
	
}


//Validation for applicant



function applicantVal()
{
	if (document.form1.drp_education.value == "")
	{
		alert("You need to select degree from the list.");
		document.form1.drp_education.focus();
		return false;
	}
	if (document.form1.txt_jobgoal.value == "")
	{
		alert("You need to enter job Goal.");
		document.form1.txt_jobgoal.focus();
		return false;
	}
	if (document.form1.txt_firstname.value == "")
	{
		alert("You need to enter your first name.");
		document.form1.txt_firstname.focus();
		return false;
	}
	if (document.form1.txt_middlename.value == "")
	{
		alert("You need to enter your middle Name.");
		document.form1.txt_middlename.focus();
		return false;
	}
	if (document.form1.txt_lastname.value == "")
	{
		alert("You need to enter your last name.");
		document.form1.txt_lastname.focus();
		return false;
	}
	if (document.form1.txt_username.value == "")
	{
		alert("You need to enter user name.");
		document.form1.txt_username.focus();
		return false;
	}
	if (document.form1.txt_password.value == "")
	{
		alert("You need to enter password.");
		document.form1.txt_password.focus();
		return false;
	}
	if (document.form1.txt_password.value != form1.txt_confirmpassword.value)
	{
		alert("You need to enter a same Password in both field.");
		document.form1.txt_confirmpassword.select();
		return false;
	}	
	if (document.form1.txt_secretquestion.value == "")
	{
		alert("You need to enter your secret question.");
		document.form1.txt_secretquestion.focus();
		return false;
	}
	if (document.form1.txt_answer.value == "")
	{
		alert("You need to enter your answer.");
		document.form1.txt_answer.focus();
		return false;
	}
	
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = form1.txt_emailid.value.match(emailPat);
	
	if (matchArray == null)
	{
		alert ("Please enter your valid email address.");
		document.form1.txt_emailid.focus();
		return false;
	}

	if (document.form1.txt_address.value == "")
	{
		alert("You need to enter a Address.");
		document.form1.txt_address.focus();
		return false;
	}
	if (document.form1.txt_city.value == "")
	{
		alert("You need to enter your city.");
		document.form1.txt_city.focus();
		return false;
	}
	if (document.form1.txt_state.value == "")
	{
		alert("You need to enter your state.");
		document.form1.txt_state.focus();
		return false;
	}
	if (document.form1.drop_country.value == "")
	{
		alert("You select Country.");
		document.form1.drop_country.focus();
		return false;
	}
	if (document.form1.txt_zipcode.value == "")
	{
		alert("You need to enter your zip code.");
		document.form1.txt_zipcode.focus();
		return false;
	}
	if (document.form1.txt_phone.value == "")
	{
		alert("You need to enter phone number.");
		document.form1.txt_phone.focus();
		return false;
	}
	if (document.form1.txt_mobile.value == "")
	{
		alert("You need to enter mobile number.");
		document.form1.txt_mobile.focus();
		return false;
	}	
}




// for resume validation
function resumevalidation()
{
	
	if (document.form1.txt_jobtitle.value == "")
	{
		alert ("Please enter your Job Title.");
		document.form1.txt_jobtitle.focus();
		return false;
	}
	if (document.form1.drop_prefercontact.value == "")
	{
		alert ("Please selct Prefer Contact.");
		document.form1.drop_prefercontact.focus();
		return false;
	}
	if (document.form1.drop_preferjobtype.value == "")
	{
		alert ("Please select your Job Type.");
		document.form1.drop_preferjobtype.focus();
		return false;
	}
	if (document.form1.txt_joblocation.value == "")
	{
		alert ("Please enter your Job Location.");
		document.form1.txt_joblocation.focus();
		return false;
	}
	if (document.form1.txt_salaryreq.value == "")
	{
		alert ("Please enter salary.");
		document.form1.txt_salaryreq.focus();
		return false;
	}
	else
	{
	    var anum=/(^\d+$)|(^\d+\.\d+$)/
	    if (!anum.test(document.form1.txt_salaryreq.value))
	    {
		    alert("Please enter valid Salary.");
		    document.form1.txt_salaryreq.value="";
		    document.form1.txt_salaryreq.focus();
		    return false;
	    }
	}
	if (document.form1.lst_occcategory.value == "")
	{
		alert ("Please select Occupational Category.");
		document.form1.lst_occcategory.focus();
		return false;
	}
	if (document.form1.drop_highestdegree.value == "")
	{
		alert ("Please select Occupied Heighest Degree.");
		document.form1.drop_highestdegree.focus();
		return false;
	}
	
	if(document.form1.drop_qualification.value == "")
	{
	    alert ("Please select qualification.");
		document.form1.drop_qualification.focus();
		return false;
	}
	
	if (document.form1.drop_experience.value == "")
	{
		alert ("Please enter Year Of Experience.");
		document.form1.drop_experience.focus();
		return false;
	}
	if (document.form1.lst_langs.value == "")
	{
		alert ("Please enter Languages Known.");
		document.form1.lst_langs.focus();
		return false;
	}
	if (document.form1.txt_resumeheading.value == "")
	{
		alert ("Please enter Resume Title.");
		document.form1.txt_resumeheading.focus();
		return false;
	}
	
	
	if (document.form1.fupload_resume.value)
	{
		filename=window.document.form1.fupload_resume.value
		i = filename.lastIndexOf(".");
		ext = filename.substr(i+1);
		ext=ext.toLowerCase();
		if (ext != "doc" && ext !="pdf")  
		{		
			alert("Only .doc or .pdf files are allowed to upload");
			window.document.form1.fupload_resume.focus();
			window.document.form1.fupload_resume.select();
			return false;
		}
	}

	
	//alert();
	return true;
}
function chkSelected(nn)
{
	var counter = 0 ;
	var ctr = nn.selectedIndex
	
	for (var i=0; i < nn.options.length; i++ )	
	{
		if(nn.options[i].selected)
		{
			counter++ ;
		}
	}
	if (counter > 3)
	{
		alert("Please select any 3 item from the list.");
		nn.options[ctr].selected="";
	}
	nn.focus();
}


// Validation For application for job

function valapplicationforjob()

{


var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = document.form1.txt_Email.value.match(emailPat);
	
	if (matchArray == null)
	{
		alert ("Please enter your valid email address.");
		document.form1.txt_Email.value="";
		document.form1.txt_Email.focus();
		return false;
	}
	
	return true;

}

//validation for contact us


function valcontactus()
{
    var ErrMsg="";
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = document.form1.txtEmail.value.match(emailPat);

	if(document.form1.txtFname.value=="" )
	{
		strd=document.form1.MRF1.value;
		alert(strd);
		document.form1.txtFname.focus();
		return false;
	}
	
	if(document.form1.txtFname.value.charAt(0)==' ')
	{  
	     strd=document.form1.MRF2.value;
	     alert(strd);
		 document.form1.txtFname.focus();
		 return false;
	}
	
	if(document.form1.txtEmail.value==""||document.form1.txtEmail.value=="Enter your email.")
	{
	   strd=document.form1.MRF3.value;
	   alert(strd);
	   document.form1.txtEmail.focus();
	   return false;
	}
	else if (matchArray == null)
	{
		strd=document.form1.MRF4.value;
	    alert(strd);
		document.form1.txtEmail.focus();
		return false;
	}
	
	 if(document.form1.txtComments.value==""||document.form1.txtComments.value=="Enter your comments here")
	{
	    strd=document.form1.MRF5.value;
	    alert(strd);
		document.form1.txtComments.focus();
		return false;
	}
	
	if(document.form1.txtComments.value.charAt(0)==' ')
	{  
	    strd=document.form1.MRF2.value;
	    alert(strd);
	    document.form1.txtComments.focus();
		return false;
    }
	if(document.form1.txtComments.value.length > 250)
	 {
		strd=document.form1.MRF6.value;
	    alert(strd);
		document.form1.txtComments.focus();
		return false; 
	 }
	if(document.form1.CodeNumberTextBox.value=="")
	{
		strd=document.form1.MRF7.value;
	    alert(strd);
		document.form1.CodeNumberTextBox.focus();
		return false;
	}	
	return true;
	
}

//*********** Validation for UnSubScribe ***********//

function ValidateUnSubScribe()
{
    var strd;
	if (document.form1.txtEmail.value == "")
	{
		
		strd=document.form1.MRF1.value;
		alert(strd);
		window.document.form1.txtEmail.focus();
		return false;
	}
	else
	{	
	
	    var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/;
		var matchArray = document.form1.txtEmail.value.match(emailPat);
		if (matchArray == null)
		{
			strd=document.form1.MRF2.value;
			alert (strd);
			window.document.form1.txtEmail.focus();
			return false;
		}
	}
	return true;
}

//************* Pop up Window **************//

function popitup(url)
{
	newwindow=window.open(url,'name','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=270,height=145,left = 350,top = 400');
	if (window.focus) {newwindow.focus()}
}

//************* To Close window **************//

function wclose()
{
	opener.location.reload(true);
	self.close();
}

function mailtofriend(url)
{
	width = 510;
	height = 370;
	xx = window.screen.width;
	yy = window.screen.height;
	xx = (xx/2) - (width/2);
	yy = (yy/2) - (height);
	tt = 50;
	style = 'left = ' +  xx + ',top = ' + tt + ',width='+ width +',height=' + height + ',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes';
	newwindow=window.open(url,'name',style);
	if (window.focus) {newwindow.focus()}
}

function Mailfriendvalidation()
    {
        var strd;
		var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
		var matchArray = form1.txtfriendemail.value.match(emailPat);
		var matchArray1 = form1.txtselfEmail.value.match(emailPat);
	    if(matchArray == null)
	    {
		    strd=document.form1.MRF1.value;
		    alert(strd);
		    document.form1.txtfriendemail.focus();
		    return false;
	    }
    	
	    if(matchArray1 == null)
	    {
		    strd=document.form1.MRF2.value;
		    alert(strd);
		    document.form1.txtselfEmail.focus();
		    return false;
	    }
	    return true;
    }
    
function HeaderSearchValidation()
{
	if(document.frmSearch.m_txtSearch.value=="Search Text...")
	{
		alert("Enter search text.");
		document.frmSearch.m_txtSearch.focus();
		return false;
	}
}
function clearTip(field)
{
	if(field.defaultValue == field.value)
	field.value = "";
}

function writeTip(field)
{
	if(field.value == "")
		field.value = field.defaultValue;
}



function ValidateAppForm()
{
   
   if(document.Form1.txt_Lname.value=="" )
	{
		strd="Enter your Last name."
		alert(strd);
		document.Form1.txt_Lname.focus();
		return false;
	}
	if(document.Form1.txt_Fname.value=="" )
	{
		strd="Enter your first name."
		alert(strd);
		document.Form1.txt_Fname.focus();
		return false;
	}
	if(document.Form1.txt_Mname.value=="" )
	{
		strd="Enter your MI."
		alert(strd);
		document.Form1.txt_Mname.focus();
		return false;
	}
	if(document.Form1.txt_username.value=="" )
	{
		strd="Enter your username."
		alert(strd);
		document.Form1.txt_username.focus();
		return false;
	}
	if(document.Form1.txt_password.value=="" )
	{
		strd="Enter your password."
		alert(strd);
		document.Form1.txt_password.focus();
		return false;
	}
	if(document.Form1.txt_Confirmpass.value=="" )
	{
		strd="Enter confirm password."
		alert(strd);
		document.Form1.txt_Confirmpass.focus();
		return false;
	}
	if (document.Form1.txt_password.value != Form1.txt_Confirmpass.value)
	{
		alert("Password and confirm password must be same.");
		document.Form1.txt_Confirmpass.select();
		return false;
	}
	if(document.Form1.txt_Address.value=="" )
	{
		strd="Enter your address."
		alert(strd);
		document.Form1.txt_Address.focus();
		return false;
	}
	if(document.Form1.txt_Apartment.value=="" )
	{
		strd="Enter your Apartment/Unit."
		alert(strd);
		document.Form1.txt_Apartment.focus();
		return false;
	}
	if(document.Form1.txt_City.value=="" )
	{
		strd="Enter your City."
		alert(strd);
		document.Form1.txt_City.focus();
		return false;
	}
	if(document.Form1.txt_State.value=="" )
	{
		strd="Enter your State."
		alert(strd);
		document.Form1.txt_State.focus();
		return false;
	}	
	if(document.Form1.txt_Zipcode.value=="" )
	{
		strd="Enter your ZIP Code."
		alert(strd);
		document.Form1.txt_Zipcode.focus();
		return false;
	}	
	if(document.Form1.txt_Stdcode.value=="" )
	{
		strd="Enter your STD Code."
		alert(strd);
		document.Form1.txt_Stdcode.focus();
		return false;
	}	
		
	if(document.Form1.txt_Phone.value=="" )
	{
		strd="Enter your phone number."
		alert(strd);
		document.Form1.txt_Phone.focus();
		return false;
	}	
	
	var emailPat = /^[A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)*[@][A-Za-z0-9_\-]+([.][A-Za-z0-9_\-]+)+$/
	var matchArray = document.Form1.txt_Email.value.match(emailPat);
	
	if (matchArray == null)
	{
		alert ("Please enter your valid email address.");
		document.Form1.txt_Email.value="";
		document.Form1.txt_Email.focus();
		return false;
	}
		
		
	if(document.Form1.txt_Highschool.value=="" )
	{
		strd="Enter your High School name."
		alert(strd);
		document.Form1.txt_Highschool.focus();
		return false;
	}	
	
	if(document.Form1.txt_HighschoolAddrs.value=="" )
	{
		strd="Enter your High School Address."
		alert(strd);
		document.Form1.txt_HighschoolAddrs.focus();
		return false;
	}
	
	if(document.Form1.txt_From.value=="" )
	{
		strd="Enter your High School duration (From Field)."
		alert(strd);
		document.Form1.txt_From.focus();
		return false;
	}
	if(document.Form1.txt_To.value=="" )
	{
		strd="Enter your High School duration (To Field)."
		alert(strd);
		document.Form1.txt_To.focus();
		return false;
	}
	
	
				
		
	return true;
	
}
