 
 // Careers Form Validation
 function validations()
{
var title=document.careers.firstname.value;
if(title=="0" || title=="")
{   
alert("Please enter first name");document.careers.firstname.focus();return false;  
}

var name=document.careers.middlename.value;
if(name=="0" || name=="")
{   
alert("Please enter middle name");document.careers.middlename.focus();return false;  
}
var phone=document.careers.lastname.value;
if(phone=="0" || phone=="")
{   
alert("Please enter last name");document.careers.lastname.focus();return false;  
}

var birthday=document.careers.birthday.value;
if(birthday=='')
{
alert("Please enter your birthday");
document.careers.birthday.focus();
return false;
}


var address=document.careers.address.value;
if(address=="0" || address=="")
{   
alert("Please enter address");document.careers.address.focus();return false;  
}


var city=document.careers.city.value;
if(city=="0" || city=="")
{   
alert("Please enter city");document.careers.city.focus();return false;  
}

var country=document.careers.country.value;
if(country=="0" || country=="")
{   
alert("Please enter country");document.careers.country.focus();return false;  
}

var mobile=document.careers.mobile.value;
if(mobile=="0" || mobile=="")
{   
alert("Please enter mobile");document.careers.mobile.focus();return false;  
}

if(!document.careers.interestedfields1.checked  && !document.careers.interestedfields2.checked  && !document.careers.interestedfields3.checked   && !document.careers.interestedfields4.checked  && !document.careers.interestedfields5.checked  && !document.careers.interestedfields6.checked  && !document.careers.interestedfields7.checked)
{   
alert("Please select fields of interest");
return false;  
}

if(document.careers.resume.value=='')
{
alert("Please upload your CV");
return false;
}
return true;
}
function valemail(field,alerttxt)
{
  with (field)
  {
   var atpos = field.indexOf("@")
   var dotpos = field.lastIndexOf(".")
   var lastpos = field.length - 1
    if (atpos < 2 || dotpos - atpos < 2 || lastpos-dotpos > 4 || lastpos-dotpos < 2 )
	{
	   alert(alerttxt)		
	   return false
	} 
  }
 }
 
 // End  Careers Form Validation
 
 // Caleder Function 
 
 function calendar()
{
var cal19 = new CalendarPopup(); 
cal19.showYearNavigation(); 
cal19.showYearNavigationInput();
}


function calendar()
{
var cal19 = new CalendarPopup(); 
cal19.showYearNavigation(); 
cal19.showYearNavigationInput();
}

// End Calender Function

// File uploading Script


function file_upload_process(field_name, allowed_ext){
    obj1=document.careers;
    var temp_field= 'obj1.'+field_name+'.value';
    field_value=eval(temp_field);
    if(field_value!=""){
        var file_ext= (field_value.substring((field_value.lastIndexOf('.')+1)).toLowerCase());
        ext=allowed_ext.split(',');
        var allow=0;
        for ( var i=0; i < ext.length; i++) {
                if(ext[i]==file_ext){
                    allow=1;
                }
        }
        if(!allow){
            alert('Invalid File format. Please upload file in '+allowed_ext+' format');        
            return false;
        }
		else
		{
			return true;
		}
    }
    return false;
}

//End file uploading Script