function validate_photo()
{
	if (document.advertise.f1.value=="")
	{
	alert("Please Select the File to be Mailed... !!");
	document.advertise.f1.focus();
	
	return false;
	}
	else 
	{
		if (document.advertise.f1.value != "") 
		{
			var path = new String(document.advertise.f1.value)
			fileName =path.substr(path.lastIndexOf(".")+1);
			fileName =fileName.toLowerCase();
			if ( !(fileName=="jpg" || fileName=="jpeg" || fileName=="gif" || fileName=="bmp"))
			{
					alert("You have tried to upload an invalid image format. \nThis site only accepts 'JPG', 'GIF' and 'BMP' image files for display.");
					document.advertise.f1.focus();
					document.advertise.f1.select();
					return false;
			}
			else
			{
				return true;
			}
		}
	}
}
function chgpass_candi()
{		
		if(document.cp.oldpass.value == "")
		{
		
			alert("Please enter your Existing Password...");
			document.cp.oldpass.focus();
			return false;
		}
		else if(!charsOccurIn(document.cp.oldpass.value, "abcdefghijklmnopqrstuvwxyz0123456789_"))
		{
			alert("Please enter your Valid Password...!");
			document.cp.oldpass.focus();
			return false;
		}
		else if(document.cp.txtpass.value == "")
		{
		
			alert("Please enter your New Password...");
			document.cp.txtpass.focus();
			return false;
		}
		else if(!charsOccurIn(document.cp.txtpass.value, "abcdefghijklmnopqrstuvwxyz0123456789_"))
		{
			alert("Only AlphaNumeric Characters with ( _ ) allowed for Password...!");
			document.cp.txtpass.focus();
			return false;
		}
		else if(document.cp.txtpass.value.length < 6 )
		{
			alert("Please enter Password between 6 - 12 Characters...");
			document.cp.txtpass.focus();
			return false;
		}
		else if(document.cp.txtpass.value != document.cp.txtcpass.value)
		{
			alert("Password Mismatch....");
			document.cp.txtcpass.focus();
			return false;
		}
}
function move(fbox, tbox,a) 
{
	if(a=="n" || a=="nl") 
		nav=""
	var arrFbox = new Array();
	var arrTbox = new Array();
	var arrLookup = new Array();
	var i;
	for (i = 0; i < tbox.options.length; i++) 
		{
			if(a=="n" || a=="nl")
				nav=""

			arrLookup[tbox.options[i].text] = tbox.options[i].value;
			arrTbox[i] = tbox.options[i].text;
		}	
	var fLength = 0;
	var tLength = arrTbox.length;
	
	for(i = 0; i < fbox.options.length; i++) 
		{
			if(a=="n" || a=="nl")
				nav=""
		
			arrLookup[fbox.options[i].text] = fbox.options[i].value;

			if (fbox.options[i].selected && fbox.options[i].value != "") 
				{
					arrTbox[tLength] = fbox.options[i].text;
					tLength++;
				}
			else 
				{
					arrFbox[fLength] = fbox.options[i].text;
					fLength++;
				}
		}

		arrFbox.sort();
		arrTbox.sort();
		fbox.length = 0;
		tbox.length = 0;
		var c;
	for(c = 0; c < arrFbox.length; c++) 
		{
			var no = new Option();
			no.value = arrLookup[arrFbox[c]];
			no.text = arrFbox[c];
			if(a=="nl" )
				nav=nav+no.value+", "

				fbox[c] = no;
		}
	for(c = 0; c < arrTbox.length; c++) 
		{
			var no = new Option();
			no.value = arrLookup[arrTbox[c]];
			no.text = arrTbox[c];
			tbox[c] = no;
			if(a=="n" )
				nav=nav+no.value+", "
		}
}
function chk_email()
{
pos=document.can_email.txtemail.value.indexOf("+");
if(!pos==0)
{
	apos=document.can_email.txtemail.value.indexOf("@"); 
	dotpos=document.can_email.txtemail.value.lastIndexOf(".");
	lastpos=document.can_email.txtemail.value.length-1;
		if (apos<1 || dotpos-apos<2 || lastpos-dotpos>4 || lastpos-dotpos<2) 
		{	
			alert("Please enter your valid Email Address...!")
			document.can_email.txtemail.focus()
			return false;
		}
		else 
		{
		return validEmail()
		}
	
		return true;	
	
	} 
}

function validEmail()
{

var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@._";
for (var i=0; i < document.can_email.txtemail.value.length; i++)
	 {
    var letter = document.can_email.txtemail.value.charAt(i).toLowerCase();
	if (validchars.indexOf(letter) != -1)
	continue;
	else
    alert("Invalid character: " + letter + " used in Email Address");
    return false;   
  }
}


function textCounter(maxlimit,frmfield) 
{
if (frmfield.value.length > maxlimit)
{
//alert(frmfield.substr(0, maxlimit))
frmfield.value = frmfield.value.substring(0,maxlimit) ;
}
}
function compareDates(value1, value2) 
{
   var date1, date2;
   var month1, month2;
   var year1, year2;

   d1 = value1.substring (0, value1.indexOf ("/"));
   m1 = value1.substring (value1.indexOf ("/")+1, value1.lastIndexOf ("/"));
   y1 = value1.substring (value1.lastIndexOf ("/")+1, value1.length);

   d2 = value2.substring (0, value2.indexOf ("/"));
   m2 = value2.substring (value2.indexOf ("/")+1, value2.lastIndexOf ("/"));
   y2 = value2.substring (value2.lastIndexOf ("/")+1, value2.length);
   
   month1 = parseInt(m1);
   date1  = parseInt(d1);
   year1  = parseInt(y1);

   month2 = parseInt(m2) ;
   date2  = parseInt(d2) ;
   year2  = parseInt(y2) ;

   if(year1 > year2) 
	{
		return -1;
	}	
	else if(year1 < year2) 
	{
		return 1;
	}		
   else 
	{ 	
		if(month1 > month2)
			{				
				return -1;
			}
		else if(month1 < month2)
			{
				return 1;
			}			
		else 
			{			
				if(date1 > date2)
					{
						 return -1;
					}					 
				else if (date1 < date2)
					{
						 return 1;
					}
				else
					{
						return 0;
					}	    		 
		    }	
	}   
} 
function charsOccurIn(frmfield, validChars)
{ 
		var i;
		for (i = 0; i < frmfield.length; i++)
		{ 
				var letter = frmfield.charAt(i).toLowerCase();
		if (validChars.indexOf(letter) == -1) 
			return false;
		}
		return true;
}



//==========Function For Personal Details=================//	

function checkcanform()
{
		if(document.canstep1.txtpass.value == "")
		{
		
			alert("Please enter your Password...");
			document.canstep1.txtpass.focus();
			return false;
		}
		else if(!charsOccurIn(document.canstep1.txtpass.value, "abcdefghijklmnopqrstuvwxyz0123456789_"))
		{
			alert("Only AlphaNumeric Characters with ( _ ) allowed for Password...!");
			document.canstep1.txtpass.focus();
			return false;
		}
		else if(document.canstep1.txtpass.value.length < 6 )
		{
			alert("Please enter Password between 6 - 12 Characters...");
			document.canstep1.txtpass.focus();
			return false;
		}
		else if(document.canstep1.txtpass.value != document.canstep1.txtcpass.value)
		{
			alert("Password Mismatch....");
			document.canstep1.txtcpass.focus();
			return false;
		}
		else if(document.canstep1.txtfname.value == "") 
		{
		alert("Please enter your First Name...!");
		document.canstep1.txtfname.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtfname.value, "abcdefghijklmnopqrstuvwxyz "))
		{
			alert("Please Enter your valid Name...! Do not put any spance or special chracter in first name field");
			document.canstep1.txtfname.focus();
			return false;
		}
		else if(document.canstep1.txtlname.value == "") 
		{
		alert("Please enter your Last Name...!");
		document.canstep1.txtlname.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtlname.value, "abcdefghijklmnopqrstuvwxyz "))
		{
			alert("Please Enter your valid Name...!");
			document.canstep1.txtlname.focus();
			return false;
		}
		else if(document.canstep1.txtlname.value == "") 
		{
		alert("Please enter your Last Name...!");
		document.canstep1.txtlname.focus();
		return false;
		}
		else if (document.canstep1.selo1.value == "-")
		{
				alert("Please select your Birth Date...!");
				document.canstep1.selo1.focus();
				return false;
		}
		else if (document.canstep1.selo2.value == "-")
		{
				alert("Please select your Birth Month...!");
				document.canstep1.selo2.focus();
				return false;
		}
		else if (document.canstep1.selo3.value == "-")
		{
				alert("Please select your Birth Year...!");
				document.canstep1.selo3.focus();
				return false;
		}
		else if(document.canstep1.txtcity.value == "") 
		{
		alert("Please enter your City...!");
		document.canstep1.txtcity.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtcity.value, "abcdefghijklmnopqrstuvwxyz -."))
		{
			alert("Please Enter your valid City Name...!");
			document.canstep1.txtcity.focus();
			return false;
		}
		else if(document.canstep1.txtstate.value == "") 
		{
		alert("Please enter your State...!");
		document.canstep1.txtstate.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtstate.value, "abcdefghijklmnopqrstuvwxyz -."))
		{
			alert("Please Enter your valid State Name...!");
			document.canstep1.txtstate.focus();
			return false;
		}
		else if(document.canstep1.txtzip.value == "") 
		{
		alert("Please enter your Zip Code...!");
		document.canstep1.txtzip.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtzip.value, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789 "))
		{
			alert("Please Enter your valid Zip Code...!");
			document.canstep1.txtzip.focus();
			return false;
		}
		else if((document.canstep1.txtadd.value == "") ||(document.canstep1.txtadd.value.length < 15))
		{
		alert("Please enter your Complete Permanent Address ...!");
		document.canstep1.txtadd.focus();
		return false;
		}
		else if(document.canstep1.txtisd1.value == "") 
		{
		alert("Please enter  your ISD Code [Phone No. I]...!");
		document.canstep1.txtisd1.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtisd1.value, "1234567890"))
		{
		alert("Only Numerics allowed for Country Code [Phone No.I]...!");
		document.canstep1.txtisd1.focus();
		return false;
		}
		else if(document.canstep1.txtstd1.value == "") 
		{
		alert("Please enter your STD Code [Phone No. I]...!");
		document.canstep1.txtstd1.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtstd1.value, "1234567890"))
		{
		alert("Only Numerics allowed for State Code [Phone No.I]...!");
		document.canstep1.txtstd1.focus();
		return false;
		}
		else if(document.canstep1.txtphone1.value == "") 
		{
		alert("Please enter your Phone No...!");
		document.canstep1.txtphone1.focus();
		return false;
		}
		else if(!charsOccurIn(document.canstep1.txtphone1.value, "1234567890"))
		{
		alert("Only Numerics allowed for Phone No. [Phone No.I]...!");
		document.canstep1.txtphone1.focus();
		return false;
		}
		
		else if(document.canstep1.txtphone2.value != "" && document.canstep1.txtisd2.value == "" && document.canstep1.txtstd2.value == "")
		{
			alert("Please complete Phone No. II...!");
			document.canstep1.txtphone2.focus()
			return false;
		}
		else if(document.canstep1.txtisd2.value != "" && document.canstep1.txtphone2.value == "" && document.canstep1.txtstd2.value == "")
		{
			alert("Please complete Phone No. II...!");
			document.canstep1.txtisd2.focus()
			return false;
		}
		else if(document.canstep1.txtstd2.value != "" && document.canstep1.txtphone2.value == "" && document.canstep1.txtisd2.value == "")
		{
			alert("Please complete Phone No. II...!");
			document.canstep1.txtstd2.focus()
			return false;
		}
		else if(!charsOccurIn(document.canstep1.txtmobileno.value, "1234567890 "))
	{
	alert("Only Numerics allowed for Mobile No...!");
	document.canstep1.txtmobileno.focus();
	return false;
	}
	else if(document.canstep1.txtnationality.value == "") 
	{
		alert("please enter your Nationality");
		document.canstep1.txtnationality.focus();
		return false;
	}
	
	else if(!charsOccurIn(document.canstep1.txtnationality.value, "abcdefghijklmnopqrstuvwxyz"))
	{
	alert("Please enter your valid Nationality...!");
	document.canstep1.txtnationality.focus();
	return false;
	}
	
	else
	{
			return true;
	}
}
//===================End of Function For Personal Details=============//
//=================function for educational details & employment history=========//

function checkshoreform()
{

	if(document.shorestep2.higestquali.value == "") 
	{
		alert("Please enter your Higest Qualification");
		document.shorestep2.higestquali.focus();
		return false;
	}
	else if(document.shorestep2.yearofpass.value != "")
		if(!charsOccurIn(document.shorestep2.yearofpass.value,"0123456789"))
		{
			alert("Only numbers are allowed in Year of passing");
			document.shorestep2.yearofpass.value="";
			document.shorestep2.yearofpass.select();
			document.shorestep2.yearofpass.focus();	
			return false;
		}
	else if(document.shorestep2.specilization.value != "")
		if(document.shorestep2.specilization.value.length>500)
		{
			alert("You can ehter only 500 characters in Other Specilization field");
			document.shorestep2.specilization.focus();
			return false;		
		}
	else
	if(document.shorestep2.years.value == "") 
		{
			alert("Please enter years of experience");
			document.shorestep2.years.focus();
			return false;
		}
	else
	if(document.shorestep2.months.value == "") 
	{
		alert("Please enter months of experience");
		document.shorestep2.months.focus();
		return false;
	}
	else
	{
		if(document.shorestep2.responsibility.value == "") 
		{
			alert("Please mention the responsibility ");
			document.shorestep2.responsibility.focus();
			return false;
		}
		else if(document.shorestep2.responsibility.length>200 )
		{
			alert("You can enter only 200 characters in Responsibility field");
			document.shorestep2.responsibility.focus();
			return false;
		}
	}	
	if(document.shorestep2.currentemp.value == "") 
	{
		alert("Please enter the field for current employer");
		document.shorestep2.currentemp.focus();
		return false;
	}
	else
	if(document.shorestep2.currdesign.value == "") 
	{
		alert("Please enter the field for current designation");
		document.shorestep2.currdesign.focus();
		return false;
	}
	else if(document.shorestep2.costtocomp.value == "") 
		{
		alert("Please Enter the field cost to company");
		document.shorestep2.costtocomp.focus();
		return false;
		}
		else if(!charsOccurIn(document.shorestep2.costtocomp.value, "0123456789 ."))
		{
			alert("Please Enter cost to company in numbers");
			document.shorestep2.costtocomp.focus();
			return false;
		}			
	else
	{
			return true;
	}
}	


//=================end of function for educational details & employment history=========//
function checkshoreedu()
{

	if(document.shorestep2.higestquali.value == "") 
	{
		alert("Please enter your Higest Qualification");
		document.shorestep2.higestquali.focus();
		return false;
	}
	else if(document.shorestep2.yearofpass.value != "")
		if(!charsOccurIn(document.shorestep2.yearofpass.value,"0123456789"))
		{
			alert("Only numbers are allowed in Year of passing");
			document.shorestep2.yearofpass.value="";
			document.shorestep2.yearofpass.select();
			document.shorestep2.yearofpass.focus();	
			return false;
		}
	else if(document.shorestep2.specilization.value != "")
		if(document.shorestep2.specilization.value.length>500)
		{
			alert("You can ehter only 500 characters in Other Specilization field");
			document.shorestep2.specilization.focus();
			return false;		
		}
	else
		return true;
}
function checkshoreemp()
{

	if(document.shorestep2.years.value == "") 
		{
		alert("Please enter years of experience");
		document.shorestep2.years.focus();
		return false;
	}
	else
	if(document.shorestep2.months.value == "") 
	{
		alert("Please enter months of experience");
		document.shorestep2.months.focus();
		return false;
	}
	else
	if(document.shorestep2.responsibility.value == "") 
	{
		alert("Please mention the responsibility ");
		document.shorestep2.responsibility.focus();
		return false;
	}
	else
	if(document.shorestep2.currentemp.value == "") 
	{
		alert("Please enter the field for current employer");
		document.shorestep2.currentemp.focus();
		return false;
	}
	else
	if(document.shorestep2.currdesign.value == "") 
	{
		alert("Please enter the field for current designation");
		document.shorestep2.currdesign.focus();
		return false;
	}
	else if(document.shorestep2.costtocomp.value == "") 
		{
		alert("Please Enter the field cost to company");
		document.shorestep2.costtocomp.focus();
		return false;
		}
		else if(!charsOccurIn(document.shorestep2.costtocomp.value, "0123456789 ."))
		{
			alert("Please Enter cost to company in numbers");
			document.shorestep2.costtocomp.focus();
			return false;
		}
		
			
	else
	{
			return true;
	}
}	
//=================function for career_interest=========//

function checkshoreform1()
{
		 if(document.shorestep3.seekposition.value.length == 0) 
		{
		alert("Please Enter the field seeking position");
		document.shorestep3.seekposition.focus();
		return false;
		}		
		else if(document.shorestep3.expectsal.value == "") 
		{
		alert("Please Enter the field expected salary");
		document.shorestep3.expectsal.focus();
		return false;
		}
		else if(!charsOccurIn(document.shorestep3.expectsal.value, "0123456789. "))
		{
			alert("Please Enter the expected salary in numbers");
			document.shorestep3.expectsal.value="";
			document.shorestep3.expectsal.focus();
			return false;
		}
		else
		if(document.shorestep3.availability.value == "") 
		{
		alert("Please Enter the field availability");
		document.shorestep3.availability.focus();
		return false;
		}
		else if(!charsOccurIn(document.shorestep3.availability.value, "0123456789 "))
		{
			alert("Please Enter the availability in numbers");
			document.shorestep3.availability.focus();
			return false;
		}
		else if(document.shorestep3.skills.value == "") 
		{
		alert("Please Enter the field Skills");
		document.shorestep3.skills.focus();
		return false;
		}
		else if(!charsOccurIn(document.shorestep3.skills.value, "abcdefghijklmnopqrstuvwxyz0123456789., "))
		{
			alert("Please Enter valid Skills");
			document.shorestep3.skills.focus();
			return false;
		}
	else
	{
			return true;
	}
}

//=================end of function for career_interest=========//
//=================function for candidates total experience=========//

function checkTotalExp()
{
		if(document.addmore.company.value == "") 
		{
		alert("Please Enter the field Company");
		document.addmore.company.focus();
		return false;
		}
		else if(document.addmore.designation.value == "") 
		{
		alert("Please Enter the field Designation");
		document.addmore.designation.focus();
		return false;
		}
		else if(document.addmore.res.value == "") 
		{
		alert("Please Enter the field Responsibility");
		document.addmore.res.focus();
		return false;
		}
		else if(document.addmore.lstStartDate.value == "-")
		{
			alert("Please Enter Start Date...!");
			document.addmore.lstStartDate.focus();
			return false;
		}
		else if(document.addmore.lstStartMonth.value == "-")
		{
			alert("Please Enter Start Month...!");
			document.addmore.lstStartMonth.focus();
			return false;
		}
		else if(document.addmore.lstStartYear.value == "-")
		{
			alert("Please Enter Start Year...!");
			document.addmore.lstStartYear.focus();
			return false;
		}
		else if(document.addmore.lstEndDate.value == "-")
		{
			alert("Please Enter End Date...!");
			document.addmore.lstEndDate.focus();
			return false;
		}
		else if(document.addmore.lstEndMonth.value == "-")
		{
			alert("Please Enter End Month...!");
			document.addmore.lstEndMonth.focus();
			return false;
		}
		else if(document.addmore.lstEndYear.value == "-")
		{
			alert("Please Enter End Year...!");
			document.addmore.lstEndYear.focus();
			return false;
		}		
		else
		{
			return true;
		}
}

//=================end of function for candidates total experience=========//
//==================function for Verification Details=================//

function checkcanform2()
{
var certtype=document.can_reg.txtcerttype.value.length;

if(document.can_reg.issauth.value == "0")
{
		alert("Please select your Competancy Certificate Issuing Authority...!");
		document.can_reg.issauth.focus();
		return false;
}
else if(certtype==0)
{
	
		var agree=confirm("Please Select Your Certificate Type.\n If you have a valid Certificate,  Registration Will be Free For you.\n Other wise You have to pay the registration fees to get your registration validated.\n\n\n DO YOU WANT TO CONTINUE WITH OUT ENTERING CERTIFICATE DETAILS ?")
		if (agree=="1")
		{
			if((document.can_reg.seaexp.value == "-")||(document.can_reg.seaexp.value < "5"))
			{
				var agreeN=confirm("Please Select Your Sea Experience.\n If you have Minimum 5 Sail Experience the Registration Will be Free For you.\n Other wise You have to pay the registration fees to get your registration validated.\n\n\n DO YOU WANT TO CONTINUE WITH OUT ENTERING SAIL EXPERIENCE DETAILS ?")
				if (agreeN=="1")
				{
				
				}
				else
				{
					return false;
				}
			}
		}
		else
		{
			return false;
		}
}

else if (document.can_reg.expdate1.value == "-")
{
		alert("Please select your Certificate Expiry Date...!");
		document.can_reg.expdate1.focus();
		return false;
}
else if (document.can_reg.expdate2.value == "-")
{
		alert("Please select your Certificate Expiry Month...!");
		document.can_reg.expdate2.focus();
		return false;
}
else if (document.can_reg.expdate3.value == "-")
{
		alert("Please select your Certificate Expiry Year...!");
		document.can_reg.expdate3.focus();
		return false;
}
else if (document.can_reg.txtcerttype.value == "")
{
		alert("Please enter your Certificate Type");
		document.can_reg.txtcerttype.focus();
		return false;
}
else if (document.can_reg.seaexp.value == "-")
{
		alert("Please select your Years of Experience...!");
		document.can_reg.seaexp.focus();
		return false;
}
else if (document.can_reg.seaexp.value != "-")
{
	if(document.can_reg.seaexp.value < 5 )
	{
		alert("You should have atleast 5 Vessel sea experience ...!");
		document.can_reg.seaexp.focus();
		return false;
	}
}
else if (!document.can_reg.txtcert_no2.value == "")
{

	var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
	var sText=document.can_reg.txtcert_no2.value;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
        alert("Please Enter Numeric Values in Certificate Column");
		document.can_reg.txtcert_no2.focus();
		return false;
         }
      }
      
	
}
else
{
	return true;
}
}

//=====================end of Function For Verification Details============//
//===================function For Passport and Visa Details================//
function checkcanform3()
{
if(document.canstep3.txtpassno.value == "") 
	{
		alert("Please enter  your Passport Number...!");
		document.canstep3.txtpassno.focus();
		return false;
	}
	else if(!charsOccurIn(document.canstep3.txtpassno.value, "abcdefghijklmnopqrstuvwxyz0123456789 -"))
		{
			alert("Please Enter your valid Passport No...!");
			document.canstep3.txtpassno.focus();
			return false;
		}
	else if(document.canstep3.txtpassi.value == "") 
	{
		alert("Please enter Passport Place of Issue...!");
		document.canstep3.txtpassi.focus();
		return false;
	}
	else if(!charsOccurIn(document.canstep3.txtpassi.value, "abcdefghijklmnopqrstuvwxyz -"))
		{
			alert("Please Note The Issue Place Accept only Character with out Space");
			document.canstep3.txtpassi.focus();
			return false;
		}
	else if (document.canstep3.selo1.value == "-")
		{
				alert("Please select Your Passport Expiry Date...!");
				document.canstep3.selo1.focus();
				return false;
		}
		else if (document.canstep3.selo2.value == "-")
		{
				alert("Please select Your Passport Expiry Month...!");
				document.canstep3.selo2.focus();
				return false;
		}
		else if (document.canstep3.selo3.value == "-")
		{
				alert("Please select Your Passport Expiry Year...!");
				document.canstep3.selo3.focus();
				return false;
		}
	else
	{
	return true;
	}
}
function canstep3Init()
{
document.canstep3.txtpassno.focus()
}
function disText()
{
if (document.canstep3_1.cmbvisatype.value =="Others")
{
	document.canstep3_1.txtothers.disabled = false;
	document.canstep3_1.txtothers.focus();
}
else
{
	document.canstep3_1.txtothers.value ="";
	document.canstep3_1.txtothers.disabled = true;
}
} 
  
//==============End of Function Passport and Visa Details========//

function othstep4()
{
	var c = document.other_course.other2.length;
	if (c != "0" )
	{
		var i;
		var x = "";
		var course = new Array();
		for(i= 0; i< c;i++)
		{
			course[i] = document.other_course.other2.options[i].value;
			x = x+document.other_course.other2.options[i].value+" , ";
		}
		document.other_course.hidecourse.value  = x;
	}
	else
	{
		alert("Please Select a Course...!!")
		return false;
	}
}
//End Funtion
function checkcanst3_1()
{
 if(document.canstep3_1.cmbvisatype.value == "") 
	{
		alert("Please select your Visa Type...!");
		document.canstep3_1.cmbvisatype.focus();
		return false;
	}
	else if(document.canstep3_1.cmbvisatype.value == "Others" && document.canstep3_1.txtothers.value =="") 
	{
		alert("Please enter your Visa Type...!");
		document.canstep3_1.txtothers.focus();
		return false;
	}
	else if(!charsOccurIn(document.canstep3_1.txtothers.value, "abcdefghijklmnopqrstuvwxyz0123456789 -"))
	{
		alert("Please Enter a valid Visa Type...!");
		document.canstep3_1.txtothers.focus();
		return false;
	}
	else if (document.canstep3_1.selo1.value == "-")
	{
		alert("Please select Your VISA Expiry Date...!");
		document.canstep3_1.selo1.focus();
		return false;
	}
	else if (document.canstep3_1.selo2.value == "-")
	{
		alert("Please select Your VISA Expiry Month...!");
		document.canstep3_1.selo2.focus();
		return false;
	}
	else if (document.canstep3_1.selo3.value == "-")
	{
		alert("Please select Your VISA Expiry Year...!");
		document.canstep3_1.selo3.focus();
		return false;
	}
	else
	{
		return true;
	}
}
//End Function
function checkcanst3_1a()
{
	if(document.canstep3_1.cmbvisatype.value == "Select") 
	{
		alert("Please select your Visa Type...!");
		document.canstep3_1.cmbvisatype.focus();
		return false;
	}
	else if(document.canstep3_1.cmbvisatype.value == "Others" && document.canstep3_1.txtothers.value == "")
	{
		alert("Please Enter your Visa Type...!");
		document.canstep3_1.txtothers.focus();
		return false;
	}
	else if(!charsOccurIn(document.canstep3_1.txtothers.value, "abcdefghijklmnopqrstuvwxyz0123456789 -"))
		{
			alert("Please Enter a valid Visa Type...!");
			document.canstep3_1.txtothers.focus();
			return false;
		}
	else if(document.canstep3_1.selo1.value == "-") 
	{
		alert("Please select your Visa Expiry Date...!");
		document.canstep3_1.selo1.focus();
		return false;
	}
	else if(document.canstep3_1.selo2.value == "-") 
	{
		alert("Please select your Visa Expiry Month...!");
		document.canstep3_1.selo2.focus();
		return false;
	}
	else if(document.canstep3_1.selo3.value == "-") 
	{
		alert("Please select your Visa Expiry Year...!");
		document.canstep3_1.selo3.focus();
		return false;
	}
	else
	{
		return true;
	}
}	
function checkcanst3_1b()
{
	if(document.canstep3_1.txtothers.value == "") 
	{
		alert("Please Enter Visa Type...!");
		document.canstep3_1.txtothers.focus();
		return false;
	}
	else if(!charsOccurIn(document.canstep3_1.txtothers.value, "abcdefghijklmnopqrstuvwxyz0123456789 -"))
	{
		alert("Please Enter a valid Visa Type...!");
		document.canstep3_1.txtothers.focus();
		return false;
	}
	else if(document.canstep3_1.selo1.value == "-") 
	{
		alert("Please select your Visa Expiry Date...!");
		document.canstep3_1.selo1.focus();
		return false;
	}
	else if(document.canstep3_1.selo2.value == "-") 
	{
		alert("Please select your Visa Expiry Month...!");
		document.canstep3_1.selo2.focus();
		return false;
	}
	else if(document.canstep3_1.selo3.value == "-") 
	{
		alert("Please select your Visa Expiry Year...!");
		document.canstep3_1.selo3.focus();
		return false;
	}
	else
	{
		return true;
	}
}		
//==end==//

function charsOccurIn(frmfield, validChars)
{ 
	var i;
	for (i = 0; i < frmfield.length; i++)
	{ 
		var letter = frmfield.charAt(i).toLowerCase();
		if (validChars.indexOf(letter) == -1) 
			return false;
	}
	return true;
}
function checkcanstep7()
{
	if(document.canstep7.selrank.value == "select")
	{
		alert("Please Select your  Rank...!");
		document.canstep7.selrank.focus()
		return false;
	}
	else if(document.canstep7.selrank.value == "Others" && document.canstep7.txtrankoth.value == "")
	{
		alert("Please Enter your  Rank...!");
		document.canstep7.txtrankoth.focus()
		return false;
	}
	else if(document.canstep7.txtcompany.value == "")
	{
		alert("Please Enter Company Name...!");
		document.canstep7.txtcompany.focus()
		return false;
	}
	else if(!charsOccurIn(document.canstep7.txtcompany.value, "abcdefghijklmnopqrstuvwxyz0123456789 (\-)/&.,"))
	{
		alert("Please Enter a valid Company Name..! \n You can Enter Alphanumeric and (\-)/&., including space");
		document.canstep7.txtcompany.focus();
		return false;
	}
	else if(document.canstep7.seltypeship.value == "select")
	{
		alert("Please Select your Ship Type...!");
		document.canstep7.seltypeship.focus()
		return false;
	}
	else if(document.canstep7.seltypeship.value == "Others" && document.canstep7.txttypeshipoth.value == "")
	{
		alert("Please Enter your  Ship Type...!");
		document.canstep7.txttypeshipoth.focus()
		return false;
	}
	else if(document.canstep7.txttonnage.value=="") 
	{
		alert("Please Enter Ship Tonnage...!");
		document.canstep7.txttonnage.focus();
		return false;
	}
 	else if(!charsOccurIn(document.canstep7.txttonnage.value, "0123456789."))
	{
		alert("Please Enter only Numeric value for Tonnage..!");
		document.canstep7.txttonnage.focus();
		return false;
	}
	else if(document.canstep7.selme.value == "select" ) 
	{
		alert("Please Select your Engine Type..!");
		document.canstep7.selme.focus();
		return false;
	}
	else if(document.canstep7.selme.value == "Others" && document.canstep7.txtmeoth.value == "") 
	{
		alert("Please Enter your Engine Type..!");
		document.canstep7.txtmeoth.focus();
		return false;
	}
	else if(document.canstep7.txthp.value=="") 
	{
		alert("Please Enter Ship HorsePower...!");
		document.canstep7.txthp.focus();
		return false;
	}
	else if(!charsOccurIn(document.canstep7.txthp.value, "0123456789."))
	{
		alert("Please Enter only Numeric value for HorsePower...!");
		document.canstep7.txthp.focus();
		return false;
	}
	else if(document.canstep7.selod.value == "-")
	{
		alert("Please Enter Joining Date...!");
		document.canstep7.selod.focus();
		return false;
	}
	else if(document.canstep7.selom.value == "-")
	{
		alert("Please Enter Joining Month...!");
		document.canstep7.selom.focus();
		return false;
	}
	else if(document.canstep7.seloy.value == "-")
	{
		alert("Please Enter Joining Year...!");
		document.canstep7.seloy.focus();
		return false;
	}
	else if(document.canstep7.sel1.value == "-")
	{
		alert("Please Enter Leaving Date...!");
		document.canstep7.sel1.focus();
		return false;
	}
	else if(document.canstep7.sel2.value == "-")
	{
		alert("Please Enter Leaving Month...!");
		document.canstep7.sel2.focus();
		return false;
	}
	else if(document.canstep7.sel3.value == "-")
	{
		alert("Please Enter Leaving Year...!");
		document.canstep7.sel3.focus();
		return false;
	}
	else
	{
		return true;
	}
}
function distext3()
{				
	if(document.canstep7.selrank.value=="Others")
	{
		document.canstep7.txtrankoth.disabled = false;
		document.canstep7.txtrankoth.value = "";
		document.canstep7.txtrankoth.focus();
	}
	else
	{	
		document.canstep7.txtrankoth.disabled = "";
		document.canstep7.txtrankoth.disabled = true;
	}
}
function distext4a()
{				
	if(document.canstep7.seltypeship.value=="Others")
	{
		document.canstep7.txttypeshipoth.disabled = false;
		document.canstep7.txttypeshipoth.value = "";
		document.canstep7.txttypeshipoth.focus();
	}
	else
	{	
		document.canstep7.txttypeshipoth.disabled = "";
		document.canstep7.txttypeshipoth.disabled = true;
	}
}
function distext5()
{				
	if(document.canstep7.selme.value=="Others")
	{
		document.canstep7.txtmeoth.disabled = false;
		document.canstep7.txtmeoth.value = "";
		document.canstep7.txtmeoth.focus();
	}
	else
	{	
		document.canstep7.txtmeoth.value = "";
		document.canstep7.txtmeoth.disabled = true;
	}
}
//added by seema on 19th dec 2006
//=============function for endorsement details===========//
function checkcanstep9()
{
	if(document.canstep9.cmbiss_auth.value == "")
	{
		alert("Please Select The Issuing Authority...!");					
		document.canstep9.cmbiss_auth.focus();
		return false;	
	}
	else if(document.canstep9.cmbiss_auth.value=="Others" && document.canstep9.txtiss_oth.value=="")
	{
		alert("Please Enter then Issuing Authority...!");					
		document.canstep9.txtiss_oth.focus();
		return false;		
	}
	else if(document.canstep9.txtcert_no.value == "") 
	{
		alert("Please Enter certificate Number...!");
		document.canstep9.txtcert_no.focus()
		return false;
	}
	else if(!charsOccurIn(document.canstep9.txtcert_no.value, "abcdefghijklmnopqrstuvwxyz0123456789 -\/;:"))
	{
		alert("Please Enter a Valid certificate No...!");
		document.canstep9.txtcert_no.focus();
		return false;
	}
	else if(!(document.canstep9.optLifetime.checked))
	{
		 if(document.canstep9.edDate.value == "-") 
		{
			alert("Please select Expiry Date...!");
			document.canstep9.edDate.focus()
			return false;
		}
		else if(document.canstep9.edMon.value == "-") 
		{
			alert("Please select Expiry Month...!");
			document.canstep9.edMon.focus()
			return false;
		}
		else if(document.canstep9.edYear.value == "-") 
		{
			alert("Please select Expiry Year...!");
			document.canstep9.edYear.focus()
			return false;
		}
	}
	else
	{
		return true;
	} 
}
function dsblothers()
{				
	if(document.canstep9.cmbiss_auth.value=="Others")
	{
		document.canstep9.txtiss_oth.disabled = false;
		document.canstep9.txtiss_oth.value = "";
		document.canstep9.txtiss_oth.focus();
	}
	else
	{	
		document.canstep9.txtiss_oth.value = "";
		document.canstep9.txtiss_oth.disabled = true;
	}
}
function dsblothers1()
{				
	if(document.canstep9.cmbcert_type.value=="Others")
	{
		document.canstep9.txtcert_others.disabled = false;
		document.canstep9.txtcert_others.value = "";
		document.canstep9.txtcert_others.focus();
		//return false;
	}
	else
	{	
		document.canstep9.txtcert_others.value = "";
		document.canstep9.txtcert_others.disabled = true;
	}
}
//=============end endorsememt details=====================//
// end add

//added on 20th Dec 2006 by Seema

function update_canstep9()
{
	if(document.upstep9.txtcert_type.value == "")
	{
		alert("Please Enter The Certificate Type...!");					
		document.upstep9.txtcert_type.focus();
		return false;	
	}
	else if(document.upstep9.txtcert_no1.value == "") 
	{
		alert("Please Enter Certificate Number...!");
		document.upstep9.txtcert_no1.focus()
		return false;
	}
	else if(!charsOccurIn(document.upstep9.txtcert_no1.value, "abcdefghijklmnopqrstuvwxyz0123456789 -\/;:"))
	{
		alert("Please Enter a Valid Certificate No...!");
		document.upstep9.txtcert_no1.focus();
		return false;
	}
	else if(document.upstep9.txtiss_auth.value=="")
	{
		alert("Please Enter Issuing Authority...!");
		document.upstep9.txtiss_auth.focus();
		return false;
	}
	
	else if(document.upstep9.txtlevel1.value == "") 
	{
		alert("Please select Level...!");
		document.upstep9.txtlevel1.focus();
		return false;
	}
	else if(document.upstep9.edDate.value == "-") 
	{
		alert("Please select Expiry date...!");
		document.upstep9.edDate.focus();
		return false;
	}
	else if(document.upstep9.edMon.value == "-") 
	{
		alert("Please select Expiry Month...!");
		document.upstep9.edMon.focus();
		return false;
	}
	else if(document.upstep9.edYear.value == "-") 
	{
		alert("Please select Expiry Year...!");
		document.upstep9.edYear.focus();
		return false;
	}
	else if(document.upstep9.cmbcert_type.value == "") 
	{
		alert("Please select Certificate type...!");
		document.upstep9.cmbcert_type.focus();
		return false;
	}
	else if(document.upstep9.cmbiss_auth.value == "") 
	{
		alert("Please select Issuing Authority...!");
		document.upstep9.cmbiss_auth.focus();
		return false;
	}
	else if(document.upstep9.txtcert_no.value == "") 
	{
		alert("Please select Certificate No...!");
		document.upstep9.txtcert_no.focus();
		return false;
	}
	else if(document.upstep9.txtlevel.value == "") 
	{
		alert("Please select Level...!");
		document.upstep9.txtlevel.focus();
		return false;
	}
	else if(document.upstep9.edDate1.value == "-") 
	{
		alert("Please select Expiry Date...!");
		document.upstep9.edDate1.focus();
		return false;
	}
	else if(document.upstep9.edMon1.value=="-")
	{
		alert("Please select Expiry Month");
		document.upstep9.edMon1.focus();
		return false;
	}
	else if(document.upstep9.edYear1.value=="-")
	{
		alert("Please select Expiry Year");
		document.upstep9.edYear1.focus();
		return false;
	}
	else
	{
		return true;
	} 
}
function dsblothers2()
{				
	if(document.upstep9.cmbcert_type.value=="Others")
	{
		document.upstep9.txtcert_others.disabled = false;
		document.upstep9.txtcert_others.value = "";
		document.upstep9.txtcert_others.focus();
		//return false;
	}
	else
	{	
		document.upstep9.txtcert_others.value = "";
		document.upstep9.txtcert_others.disabled = true;
	}
}


function dsblothers3()
{				
	if(document.upstep9.cmbiss_auth.value=="Others")
	{
		document.upstep9.txtiss_others.disabled = false;
		document.upstep9.txtiss_others.value = "";
		document.upstep9.txtiss_others.focus();
		//return false;
	}
	else
	{	
		document.upstep9.txtiss_others.value = "";
		document.upstep9.txtiss_others.disabled = true;
	}
}

//end add

//==============Function For Seamen Book Details=========//
function checkcanstep6()
{
	if(document.canstep6.cmbiss_auth.value == "")
	{
		alert("Please Select The Issuing Authority...!");					
		document.canstep6.cmbiss_auth.focus();
		return false	
	}
	else if(document.canstep6.cmbiss_auth.value=="Others" && document.canstep6.txtiss_oth.value=="")
	{
		alert("Please Enter then Issuing Authority...!");					
		document.canstep6.txtiss_oth.focus();
		return false		
	}
		
	else if(document.canstep6.cdcnum.value == "") 
	{
		alert("Please Enter Seamen Book Number...!");
		document.canstep6.cdcnum.focus()
		return false;
	}
	else if(!charsOccurIn(document.canstep6.cdcnum.value, "abcdefghijklmnopqrstuvwxyz0123456789 -\/;:"))
	{
		alert("Please Enter a Valid Seaman Book No...!");
		document.canstep6.cdcnum.focus();
		return false;
	}
	else if(!(document.canstep6.optLifetime.checked))
	{
		 if(document.canstep6.cdcDate.value == "-") 
		{
			alert("Please select Expiry Date...!");
			document.canstep6.cdcDate.focus()
			return false;
		}
		else if(document.canstep6.cdcMon.value == "-") 
		{
			alert("Please select Expiry Month...!");
			document.canstep6.cdcMon.focus()
			return false;
		}
		else if(document.canstep6.cdcYear.value == "-") 
		{
			alert("Please select Expiry Year...!");
			document.canstep6.cdcYear.focus()
			return false;
		}
	}
	else
	{
		return true;
	} 

}
function checkcanstep6_a()
{
	//alert(document.canstep6.optLifetime.value);
	if(document.canstep6.issuing_aut.value == "")
	{
		alert("Please Enter The Issuing Authority...!");					
		document.canstep6.issuing_aut.focus();
		return false	
	}
	else if(document.canstep6.cdcnum.value == "") 
	{
		alert("Please Enter Seamen Book Number...!");
		document.canstep6.cdcnum.focus()
		return false;
	}
	else if(!charsOccurIn(document.canstep6.cdcnum.value, "abcdefghijklmnopqrstuvwxyz0123456789 -\/;:"))
	{
		alert("Please Enter a Valid Seaman Book No...!");
		document.canstep6.cdcnum.focus();
		return false;
	}
	else if(!(document.canstep6.optLifetime.checked))
	{
		if(document.canstep6.cdcDate.value == "-") 
		{
			alert("Please select Expiry Date...!");
			document.canstep6.cdcDate.focus()
			return false;
		}
		else if(document.canstep6.cdcMon.value == "-") 
		{
			alert("Please select Expiry Month...!");
			document.canstep6.cdcMon.focus()
			return false;
		}
		else if(document.canstep6.cdcYear.value == "-") 
		{
			alert("Please select Expiry Year...!");
			document.canstep6.cdcYear.focus()
			return false;
		}
	}
	else
	{
	return true;
	} 
}
function distext2()
{				
	if(document.canstep6.cmbiss_auth.value=="Others")
	{
		document.canstep6.txtiss_oth.disabled = false;
		document.canstep6.txtiss_oth.value = "";
		document.canstep6.txtiss_oth.focus();
	}
	else
	{	
		document.canstep6.txtiss_oth.value = "";
		document.canstep6.txtiss_oth.disabled = true;
	}
}

//================End of funtion For Seamen Book Details=============//
//=========Function For Course Details=================//
function checkcanstep4()
{
	if(document.canstep4.txtcert.value !="")
	{	
		val_one=document.canstep4.coursedet1.value;
		if(document.canstep4.txtinst1.value =="" ||document.canstep4.txtinst1.value ==" ")	
		{
			alert("Please Fill The Institute Name For "+ val_one.toUpperCase() +" Course...!");
			document.canstep4.txtinst1.focus();
			return false;			
		}
	}
	 if(document.canstep4.txtcert2.value != "")
	{
		val_one = document.canstep4.coursedet2.value;
		if(document.canstep4.txtinst2.value == "" || document.canstep4.txtinst2.value == " ")
		{
			alert("Please Fill the Institute Name For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtinst2.focus();
			return false;
		}
	}
	if(document.canstep4.txtcert3.value != "")
	{
		val_one = document.canstep4.coursedet3.value;
		if(document.canstep4.txtinst3.value == "" || document.canstep4.txtinst3.value == " ")
		{
			alert("Please Fill the Institute Name For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtinst3.focus();
			return false;
		}
	}
	if(document.canstep4.coursedet4.value != "" )
	{
		val_one = document.canstep4.coursedet4.value;
		if(document.canstep4.txtcert4.value == "" )
		{
			alert("Please Fill the Certificate No. For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtcert4.focus();
			return false;
		}
		if(document.canstep4.txtinst4.value == "" )
		{
			alert("Please Fill the Institute Name For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtinst4.focus();
			return false;
		}
	}
	if(document.canstep4.coursedet5.value != "")
	{
		val_one = document.canstep4.coursedet5.value;
		if(document.canstep4.txtcert5.value == "" )
		{
			alert("Please Fill the Certificate No. For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtcert5.focus();
			return false;
		}
		if(document.canstep4.txtinst5.value == "" || document.canstep4.txtinst5.value == " ")
		{
			alert("Please Fill the Institute Name For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtinst5.focus();
			return false;
		}
	}
	if(document.canstep4.coursedet6.value != "")
	{
		val_one = document.canstep4.coursedet6.value;
		if(document.canstep4.txtcert6.value == "" )
		{
			alert("Please Fill the Certificate No. For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtcert6.focus();
			return false;
		}
		if(document.canstep4.txtinst6.value == "" || document.canstep4.txtinst6.value == " ")
		{
			alert("Please Fill the Institute Name For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtinst6.focus();
			return false;
		}
	}
	if(document.canstep4.coursedet7.value != "")
	{
		val_one = document.canstep4.coursedet7.value;
		if(document.canstep4.txtcert7.value == "" )
		{
			alert("Please Fill the Certificate No. For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtcert7.focus();
			return false;
		}
		if(document.canstep4.txtinst7.value == "" || document.canstep4.txtinst7.value == " ")
		{
			alert("Please Fill the Institute Name For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtinst7.focus();
			return false;
		}
	}
	if(document.canstep4.coursedet8.value != "")
	{
		val_one = document.canstep4.coursedet8.value;
		if(document.canstep4.txtcert8.value == "" )
		{
			alert("Please Fill the Certificate No. For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtcert8.focus();
			return false;
		}
		if(document.canstep4.txtinst8.value == "" || document.canstep4.txtinst8.value == " ")
		{
			alert("Please Fill the Institute Name For "+val_one.toUpperCase()+" Course...!");
			document.canstep4.txtinst8.focus();
			return false;
		}
		else
		{
		return true;
		}
	}	
}
//============End of Course Function===============//
//============Function For Certificate Details============//
function checkcanstep5()
{

	if((document.canstep5.txtcert_no.value!=""))
	{
		/*		{
					alert("Please Enter The Certificate Number ...!");
					document.canstep5.txtcert_no.focus();
					return false;
				}*/
				
/*	else if (!document.canstep5.txtcert_no.value == "")
	{
	
		   var ValidChars = "0123456789/ABCDEFGHUJKLMNOPQRSTUVWXYZabcdefghujklmnopqrstuvwxyz-";
		   var IsNumber=true;
		   var Char;
		   var sText=document.canstep5.txtcert_no.value;
	 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
			alert("Please Enter Numeric Values in Certificate Column");
			document.canstep5.txtcert_no.focus();
			return false;
			 }
		  }
		  
		
	}*/				
			if(!charsOccurIn(document.canstep5.txtcert_no.value, "abcdefghijklmnopqrstuvwxyz0123456789\-/"))
			{
				alert("Please Enter a valid Certificate No...!");
				document.canstep5.txtcert_no.focus();
				return false;
			}	
			else if(document.canstep5.txtcert_type1.value == "")
			{
				alert("Please select your Certificate Type ...!");
				document.canstep5.txtcert_type1.focus();
				return false;
			}
			else if(document.canstep5.txtcert_type1.value == "Others" && document.canstep5.txtcert_oth.value =="")
			{
				alert("Please Enter your Certificate Type...!");
				document.canstep5.txtcert_oth.focus();
				return false;
			}
			else if(document.canstep5.txtissauth1.value == "")
			{
				alert("Please select your Certificate Issuing Authority ...!");
				document.canstep5.txtissauth1.focus();
				return false;
			}
		else if(document.canstep5.exp_check.checked != true)
		{
			if(document.canstep5.selday1.value == "")
			{
				alert("Please Enter Date ...!");
				document.canstep5.selday1.focus();
				return false;
			}
			else if(document.canstep5.selmon1.value == "")
			{
				alert("Please Enter Month ...!");
				document.canstep5.selmon1.focus();
				return false;
			}
			else if(document.canstep5.selyer1.value == "")
			{
				alert("Please Enter Year ...!");
				document.canstep5.selyer1.focus();
				return false;
			}
		}
		else
		{
			return true;
		}
}
	
	// for dangerous cargo
		if(document.canstep5.txtcert_type2.value!="")
		{
			if(document.canstep5.cmb_level.value==""||document.canstep5.cmb_level.value==" ")
			{
				alert("Please Enter The Certificate Level ...!");
				document.canstep5.cmb_level.focus();
				return false;
			}
			else 
			{
				if(document.canstep5.txtcert_type2.value == "")
				{
					alert("Please select your Certificate Type ...!");
					document.canstep5.txtcert_type2.focus();
					return false;
				}
				else if(document.canstep5.txtissauth2.value == "")
				{
					alert("Please select your Certificate Issuing Authority ...!");
					document.canstep5.txtissauth2.focus();
					return false;
				}
				else if(document.canstep5.selday2.value == "")
				{
					alert("Please Enter Date ...!");
					document.canstep5.selday2.focus();
					return false;
				}
				else if(document.canstep5.selmon2.value == "")
				{
					alert("Please Enter Month ...!");
					document.canstep5.selmon2.focus();
					return false;
				}
				else if(document.canstep5.selyer2.value == "")
				{
					alert("Please Enter Year ...!");
					document.canstep5.selyer2.focus();
					return false;
				}
				else
				{
					return true;
				}
			}
		}
				
}


function checkcanstep5_a()
{

		if(document.canstep5.txtcert_no.value!="")
	{
		if(!charsOccurIn(document.canstep5.txtcert_no.value, "abcdefghijklmnopqrstuvwxyz0123456789 \-/"))
		{
			alert("Please Enter a valid Certificate No...!");
			document.canstep5.txtcert_no.focus();
			return false;
		}	
		else if(document.canstep5.txtcert_type1.value == "")
			{
				alert("Please select your Certificate Type ...!");
				document.canstep5.txtcert_type1.focus();
				return false;
			}
			else if(document.canstep5.txtissauth1.value == "")
			{
				alert("Please select your Certificate Issuing Authority ...!");
				document.canstep5.txtissauth1.focus();
				return false;
			}
			else if(document.canstep5.exp_check.checked != true)
			{
				if(document.canstep5.selday1.value == "")
				{
					alert("Please Enter Date ...!");
					document.canstep5.selday1.focus();
					return false;
				}
				else if(document.canstep5.selmon1.value == "")
				{
					alert("Please Enter Month ...!");
					document.canstep5.selmon1.focus();
					return false;
				}
				else if(document.canstep5.selyer1.value == "")
				{
					alert("Please Enter Year ...!");
					document.canstep5.selyer1.focus();
					return false;
				}
			}
			else
			{
			return true;
			}		
	}	
}
function checkDangerousCargo()
{
	if(document.canstep5.txtcert_type2.value!="")
	{
		if(document.canstep5.cmb_level.value==""||document.canstep5.cmb_level.value==" ")
		{
			alert("Please Enter The Certificate Level ...!");
			document.canstep5.cmb_level.focus();
			return false;
		}
		else 
		{
			if(document.canstep5.txtcert_type2.value == "")
			{
				alert("Please select your Certificate Type ...!");
				document.canstep5.txtcert_type2.focus();
				return false;
			}
			else if(document.canstep5.txtcert_no2.value == "")
			{
				alert("Please enter your Certificate Number ...!");
				document.canstep5.txtcert_no2.focus();
				return false;
			}
			else if(document.canstep5.txtissauth2.value == "")
			{
				alert("Please select your Certificate Issuing Authority ...!");
				document.canstep5.txtissauth2.focus();
				return false;
			}
			else if(document.canstep5.selday2.value == "")
			{
				alert("Please Enter Date ...!");
				document.canstep5.selday2.focus();
				return false;
			}
			else if(document.canstep5.selmon2.value == "")
			{
				alert("Please Enter Month ...!");
				document.canstep5.selmon2.focus();
				return false;
			}
			else if(document.canstep5.selyer2.value == "")
			{
				alert("Please Enter Year ...!");
				document.canstep5.selyer2.focus();
				return false;
			}
			else
			{
				return true;
			}
		}
	}
}



function distext1()
{	
//alert("hi"+document.canstep5.txtcert_type1.value);
if(document.canstep5.txtcert_type1.value=="All others and  uncertified")
{
	//alert("hi"+document.canstep5.txtcert_type1.value);
	document.canstep5.txtcert_oth.disabled = false;
	document.canstep5.txtcert_oth.value = "";
	document.canstep5.txtcert_oth.focus();

}
else
{	
	document.canstep5.txtcert_oth.value = "";
	document.canstep5.txtcert_oth.disabled = true;
}
}

//////function for disable text box of certificate after checking checkbox and enable examination qualification no text 
function discheckbox()
{
   if(document.canstep5.eqsn_check.checked==true)	
      {
		  document.canstep5.txtcert_no2.disabled = false;
		  document.canstep5.txtcert_no1.disabled = true;
		  document.canstep5.txtcert_no.disabled = true;
		  document.canstep5.txtcert_no2.value="";
		  document.canstep5.txtcert_no2.focus();
	  }
else
    {
	document.canstep5.txtcert_no2.value = "";
	document.canstep5.txtcert_no2.disabled = true;	
	}
}

function enacheckbox()
{
	if(document.canstep5.eqsn_check.checked==false)
	{
		document.canstep5.txtcert_no1.disabled = false;
		document.canstep5.txtcert_no.disabled = false;
		document.canstep5.txtcert_no2.disabled = true;
	  
	}
	else 
	{
		  document.canstep5.txtcert_no1.disabled = true;
		  document.canstep5.txtcert_no.disabled = true;
	}
}
		


///////+++++Code for communication address in Personal Details====
function checkaddchange(ival)
{
	if(document.canstep1.sameadd.checked==true)
	{
				document.canstep1.commadd.value=document.canstep1.txtadd.value;
				document.canstep1.hidadd.value=document.canstep1.txtadd.value;
				document.canstep1.commadd.disabled= true;
	}
	else
	{
		document.canstep1.commadd.disabled=false;
		document.canstep1.commadd.value="";
		document.canstep1.hidadd.value="";
	}

}


//========End =======================//
//============End Of Function for Certificate Detail======//

function checkcanstep8()
{
if(document.canreg8.selrank1.value != "" && (document.canreg8.mon1.value == "0" && document.canreg8.yer1.value == "0"))
	{
	rank = document.canreg8.selrank1.value;
	alert("Please Complete the Experience Details for "+rank+" ...!");
	return false;
	}
else if(document.canreg8.selrank2.value != "" && (document.canreg8.mon2.value == "0" && document.canreg8.yer2.value =="0"))
	{
	rank = document.canreg8.selrank2.value;
	alert("Please Complete the Experience Details for "+rank+" ...!");
	return false;
	}
else if(document.canreg8.selrank3.value != "" && (document.canreg8.mon3.value == "0" && document.canreg8.yer3.value == "0"))
	{
	rank = document.canreg8.selrank3.value;
	alert("Please Complete the Experience Details for "+rank+" ...!");
	return false;
	}		
	else
	{
	return true;
	}
}




function chkcanupd_per()
{

if(document.can_update_per.txtname.value == "") 
		{
		alert("Please Enter your First Name...!");
		document.can_update_per.txtname.focus();
		return false;
		}
		else if(!charsOccurIn(document.can_update_per.txtname.value, "abcdefghijklmnopqrstuvwxyz "))
		{
			alert("Please Enter your valid First Name...!");
			document.can_update_per.txtname.focus();
			return false;
		}
		else if(document.can_update_per.txtname2.value == "") 
		{
		alert("Please Enter your Last Name...!");
		document.can_update_per.txtname2.focus();
		return false;
		}
		else if(!charsOccurIn(document.can_update_per.txtname2.value, "abcdefghijklmnopqrstuvwxyz "))
		{
			alert("Please Enter your valid Last Name...!");
			document.can_update_per.txtname2.focus();
			return false;
		}
		else
		{
		return true;
		}
}



function chkcanupd_cont()
{
	if(document.canupd_cont.txtcity.value == "") 
		{
		alert("Please enter your City...!");
		document.canupd_cont.txtcity.focus();
		return false;
		}
		else if(!charsOccurIn(document.canupd_cont.txtcity.value, "abcdefghijklmnopqrstuvwxyz -."))
		{
			alert("Please Enter your valid City Name...!");
			document.canupd_cont.txtcity.focus();
			return false;
		}
		else if(document.canupd_cont.txtstate.value == "") 
		{
		alert("Please enter your State...!");
		document.canupd_cont.txtstate.focus();
		return false;
		}
		else if(!charsOccurIn(document.canupd_cont.txtstate.value, "abcdefghijklmnopqrstuvwxyz -."))
		{
			alert("Please Enter your valid State Name...!");
			document.canupd_cont.txtstate.focus();
			return false;
		}
		else if(document.canupd_cont.txtzip.value == "") 
		{
		alert("Please enter your Zip Code...!");
		document.canupd_cont.txtzip.focus();
		return false;
		}
		else if(!charsOccurIn(document.canupd_cont.txtzip.value, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789 "))
		{
			alert("Please Enter your valid Zip Code...!");
			document.canupd_cont.txtzip.focus();
			return false;
		}
		else if((document.canupd_cont.txtadd.value == "") ||(document.canupd_cont.txtadd.value.length < 15))
		
		{
		alert("Please Emter your Complete Permanent Address...!");
		document.canupd_cont.txtadd.focus();
		return false;
		}
		else if((document.canupd_cont.commadd.value == "") ||(document.canupd_cont.commadd.value.length < 15))
		{
		alert("Please Enter your Complete Communication Address...!");
		document.canupd_cont.commadd.focus();
		return false;
		}
		else if(document.canupd_cont.txtisd1.value == "") 
		{
		alert("Please Enter  your ISD Code [Phone No. I]...!");
		document.canupd_cont.txtisd1.focus();
		return false;
		}
		else if(!charsOccurIn(document.canupd_cont.txtisd1.value, "1234567890"))
		{
		alert("Only Numerics allowed for Country Code [Phone No.I]...!");
		document.canupd_cont.txtisd1.focus();
		return false;
		}
		else if(document.canupd_cont.txtstd1.value == "") 
		{
		alert("Please enter your STD Code [Phone No. I]...!");
		document.canupd_cont.txtstd1.focus();
		return false;
		}
		else if(!charsOccurIn(document.canupd_cont.txtstd1.value, "1234567890"))
		{
		alert("Only Numerics allowed for State Code [Phone No.I]...!");
		document.canupd_cont.txtstd1.focus();
		return false;
		}
		else if(document.canupd_cont.txtphone1.value == "") 
		{
		alert("Please enter your Phone No...!");
		document.canupd_cont.txtphone1.focus();
		return false;
		}
		
		
		else if(document.canupd_cont.txtphone2.value != "" && document.canupd_cont.txtisd2.value == "" && document.canupd_cont.txtstd2.value == "")
		{
			alert("Please complete Phone No. II...!");
			document.canupd_cont.txtphone2.focus()
			return false;
		}
	else if(!charsOccurIn(document.canupd_cont.txtmobileno.value, "1234567890"))
	{
	alert("Only Numerics allowed for Mobile No...!");
	document.canupd_cont.txtmobileno.focus();
	return false;
	}
	else if(document.canupd_cont.txtnationality.value == "") 
	{
		alert("please Select your Nationality...!");
		document.canupd_cont.txtnationality.focus();
		return false;
	}
		
	else
	{
			return true;
	}


}



function distext4()
{				
if(document.canstep6.cmbiss_auth.value=="Others")
{
	document.canstep6.txtiss_oth.disabled = false;
	document.canstep6.txtiss_oth.value = "";
	document.canstep6.txtiss_oth.focus();

}
else
{	
	document.canstep6.txtiss_oth.value = "";
	document.canstep6.txtiss_oth.disabled = true;
}
}

function checkcanform4()
{
if(document.canstep4.c1.value == "") 
{
alert("Please Enter a Course Name...!");
document.canstep4.c1.focus()
return false;
}
else if(!charsOccurIn(document.canstep4.c1.value, "abcdefghijklmnopqrstuvwxyz0123456789 -\/&()"))
		{
			alert("Please Enter a Valid Course Name...!");
			document.canstep4.c1.focus();
			return false;
		}
else if(document.canstep4.c2.value == "") 
{
alert("Please Enter your Certificate Number...!");
document.canstep4.c2.focus()
return false;
}
else if(!charsOccurIn(document.canstep4.c2.value, "abcdefghijklmnopqrstuvwxyz0123456789 -\/"))
		{
			alert("Please Enter a Valid Certificate No...!");
			document.canstep4.c2.focus();
			return false;
		}	
else if(document.canstep4.c3.value == "") 
{
alert("Please Enter your Institute Name...!");
document.canstep4.c3.focus()
return false;
}
else if(!charsOccurIn(document.canstep4.c3.value, "abcdefghijklmnopqrstuvwxyz, -\/.'"))
		{
			alert("Please Enter a Valid Institute Name...!");
			document.canstep4.c3.focus();
			return false;
		}
						
else
{
return true;
} 
}



function distext6()
{				
if(document.canstep7.selrank.value=="Others")
{
	document.canstep7.txtrankoth.disabled = false;
	document.canstep7.txtrankoth.value = "";
	document.canstep7.txtrankoth.focus();

}
else
{	
	document.canstep7.txtrankoth.value = "";
	document.canstep7.txtrankoth.disabled = true;
}
}


function distext7()
{				
if(document.canstep7.seltypeship.value=="Others")
{
	document.canstep7.txttypeshipoth.disabled = false;
	document.canstep7.txttypeshipoth.value = "";
	document.canstep7.txttypeshipoth.focus();

}
else
{	
	document.canstep7.txttypeshipoth.value = "";
	document.canstep7.txttypeshipoth.disabled = true;
}
}

function distext8()
{				
if(document.canstep7.selme.value=="Others")
{
	document.canstep7.txtmeoth.disabled = false;
	document.canstep7.txtmeoth.value = "";
	document.canstep7.txtmeoth.focus();

}
else
{	
	document.canstep7.txtmeoth.value = "";
	document.canstep7.txtmeoth.disabled = true;
}
}



function chk_feedback()
{

	myOption = -1;
		for (i=0; i<document.feedback.comment_type.length; i++) 
		{
			if (document.feedback.comment_type[i].checked)
			 {
				myOption = i;
			 }
		}
			if (myOption == -1) 
			{
					alert("Please select the kind of Comment ");
					return false;
			}
			else if (document.feedback.comment_on.options[document.feedback.comment_on.selectedIndex].value=="")
			{
			alert("Please enter what you would like to Comment on...!");
			document.feedback.comment_on.focus();
			return false;
			}
		else if (document.feedback.comment_on.options[document.feedback.comment_on.selectedIndex].value == "Others"
 && document.feedback.comment_others.value =="")
		{
			alert("Please enter what you would like to Comment on...!");
			document.feedback.comment_others.focus();
			return false;
		}
		else if(document.feedback.comment.value == "" )
		{
		
			alert("Please enter your Comments...");
			document.feedback.comment.focus();
			return false;
		}
		
		else if (document.feedback.hear.options[document.feedback.hear.selectedIndex].value=="")
			{
			alert("Please select how did you come to know about us...!");
			document.feedback.hear.focus();
			return false;
			}
	
		else
		{
		return true;
		}
}


function sel_this()
{

if (document.feedback.comment_on.options[document.feedback.comment_on.selectedIndex].value == "Others")
{
document.feedback.comment_others.disabled =false;
document.feedback.comment_others.focus();
}
else
{
document.feedback.comment_others.value ="";
document.feedback.comment_others.disabled =true;
}
}
function view_mess(idval)
{
	window.open("view_reply.asp?id="+idval+"","view_message","menubar=0,resizable=0,scrollbars=1,width=700,height=300");
}
function act_taken(idval)
{
	cnfm=confirm("Please Be sure that you had covered all the points specified by administratior\n Flase information will cause deletion of resume");
	if(cnfm==true)
	{
		window.open("act_taken.asp?id="+idval+"","view_message","menubar=0,resizable=0,width=500,height=450");	
	}
	else
	{
		alert("Thanks for reviewing again.....");
	}

}
function srate()
{
	var leftVal=(screen.width / 2)-(650/2);
	var topVal = (screen.height / 2)-(350/2);
	window.open("srate.asp","viewrates","menubar=0,resizable=0,scrollbars=1,width=650,height=350,left="+leftVal+",top="+topVal+"");
}
function ddelete()
{
	var cOnfirm;
	cOnfirm=confirm("Are You sure You want To Delete Your Special Resume ? \n\n If You Delete, You Have to Pay again to get this service in future.....\n");
	if(cOnfirm==true)
	{
		window.open("delete_splresume_inline.asp","viewrates","menubar=0,resizable=0,scrollbars=1,width=20,height=20");
	}
}
function vPrJavfun(chk)
{
	var leftVal=(screen.width / 2)-(350/2);
	var topVal = (screen.height / 2)-(150/2);
	var ctLcHk=0;
	for(ctL=0;ctL < document.vPrform.elements.length;ctL++)
	{
		var e = document.vPrform.elements[ctL];
		if(e.type == "radio")
		{
			if(e.checked == true)
			{
				ctLcHk=ctLcHk + 1;
				newWindow = window.open("candi_resume_priority_update.asp?sval="+e.value+"", "newWin", "toolbar=no,location=no,scrollbars=no,width=350,height=150,left="+leftVal+",top="+topVal+"");
			}
		}
	}
	return false;
}

function chkreg_step3()
{

	var certtype=document.reg_step3.txtcerttype.value.length;
	var temail=document.reg_step3.hemail.value;
	var yexp=document.reg_step3.thidden.value;
	var auth=document.reg_step3.issauth.value;
	var expr1=document.reg_step3.chkexpr1.value;

	expdate1=document.reg_step3.expdate1.value;
	expdate2=document.reg_step3.expdate2.value;
	expdate3=document.reg_step3.expdate3.value;
	chkexpr1=document.reg_step3.chkexpr1.checked;

	if(document.reg_step3.issauth.value == "0")
	{
			alert("Please select your Competancy Certificate Issuing Authority...!");
			document.reg_step3.issauth.focus();
			return false;
	}
	if(document.reg_step3.issauth.value == "Other")
	{
			if(document.reg_step3.cmb_country.value == "-")
			{
			alert("Please select your Competancy Certificate Issuing Authority...!");
			document.reg_step3.cmb_country.focus();
			return false;
			}
	
	}

	//if(!charsOccurIn(document.reg_step3.txt_othr.value,"abcdefghijklmnopqrstuvwxyz '"))
	//{
			//alert("Please enter valid Certificate Issuing Authority...!");
			//document.reg_step3.txt_othr.focus();
			//return false;
	//}
	

	if(certtype==0)
	{
		
		var agree=confirm("Please Select Your Certificate Type.\n If you have a valid Certificate,  Registration Will be Free For you.\n Other wise You have to pay the registration fees to get your registration validated.\n\n\n DO YOU WANT TO CONTINUE WITHOUT ENTERING CERTIFICATE DETAILS ?")
		if (agree)
		{
		window.location="can_reg_paid.asp?idc="+temail+"&yexp="+yexp+"&auth="+auth+""
		return false;
		}
		
	else
	{
		return false;
	}
}
if (document.reg_step3.txtcert_no1.value=="")
{
	alert("Please select Certificate No.")
	document.reg_step3.txtcert_no1.focus();
	return false;
}
	

if (document.reg_step3.txtcert_no2.value=="")
{
	alert("Please select Certificate No.")
	document.reg_step3.txtcert_no2.focus();
	return false;
}
	
if (!document.reg_step3.txtcert_no2.value == "")
{

	var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;
	var sText=document.reg_step3.txtcert_no2.value;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
        alert("Please Enter Numeric Values in Certificate Column");
		document.reg_step3.txtcert_no2.focus();
		return false;
         }
      }
    	
}

if(certtype==0)
{
	alert("Please select Certificate Type")
	document.reg_step3.txtcerttype.focus();
	return (false);
}

if(((expdate1=="-")&(expdate2=="-")&(expdate3=="-"))&(chkexpr1==false))
	{
		alert("Please Click on Life Time if Your Certificate Has No Expiry date");
		return false;
	}
	else
	{
		if((chkexpr1==false)&((expdate1=="-")||(expdate2=="-")||(expdate3=="-")))
		{
			alert("Please Select Your Certificate Expiry Date");
			return false;
		}
	}
}


function chkexp()
{
	if (document.reg_step2.seaexp.value == "-")
	{
		alert("Please select years of experience");
		document.reg_step2.seaexp.focus();
		return false;
	}
	else
	{
		return true;
	}
}

function chkreg_step4()
{
		if(document.reg_step4.txtpass.value == "")
		{
		
			alert("Please enter your Password...");
			document.reg_step4.txtpass.focus();
			return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtpass.value, "abcdefghijklmnopqrstuvwxyz0123456789_"))
		{
			alert("Only AlphaNumeric Characters with ( _ ) allowed for Password...!");
			document.reg_step4.txtpass.focus();
			return false;
		}
		else if(document.reg_step4.txtpass.value.length < 6 )
		{
			alert("Please enter Password between 6 - 12 Characters...");
			document.reg_step4.txtpass.focus();
			return false;
		}
		else if(document.reg_step4.txtpass.value != document.reg_step4.txtcpass.value)
		{
			alert("Password Mismatch....");
			document.reg_step4.txtcpass.focus();
			return false;
		}
		else if(document.reg_step4.txtfname.value == "") 
		{
		alert("Please enter your First Name...!");
		document.reg_step4.txtfname.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtfname.value, "abcdefghijklmnopqrstuvwxyz "))
		{
			alert("Please Enter your valid Name...! Do not put any spance or special chracter in first name field");
			document.reg_step4.txtfname.focus();
			return false;
		}
		else if(document.reg_step4.txtlname.value == "") 
		{
		alert("Please enter your Last Name...!");
		document.reg_step4.txtlname.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtlname.value, "abcdefghijklmnopqrstuvwxyz "))
		{
			alert("Please Enter your valid Name...!");
			document.reg_step4.txtlname.focus();
			return false;
		}
		else if(document.reg_step4.txtlname.value == "") 
		{
		alert("Please enter your Last Name...!");
		document.reg_step4.txtlname.focus();
		return false;
		}
		else if (document.reg_step4.selo1.value == "-")
		{
				alert("Please select your Birth Date...!");
				document.reg_step4.selo1.focus();
				return false;
		}
		else if (document.reg_step4.selo2.value == "-")
		{
				alert("Please select your Birth Month...!");
				document.reg_step4.selo2.focus();
				return false;
		}
		else if (document.reg_step4.selo3.value == "-")
		{
				alert("Please select your Birth Year...!");
				document.reg_step4.selo3.focus();
				return false;
		}
		/*else if (document.reg_step4.selo3.value != "-")
		{	
			byear=document.reg_step4.selo3.value;
			
			currentyr = new Date();
			currentyr=(currentyr.getYear());
			valid_yr = parseInt(currentyr) - parseInt(byear);
				if (parseInt(valid_yr) < 18 )
				{
					alert("Your Date of Birth is not Valid (You should Minimum 18 year old to register with Jobships.com ...!");
					document.reg_step4.selo3.focus();
					return false;
				}
				
		}*/
		
		else if(document.reg_step4.txtcity.value == "") 
		{
		alert("Please enter your City...!");
		document.reg_step4.txtcity.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtcity.value, "abcdefghijklmnopqrstuvwxyz -."))
		{
			alert("Please Enter your valid City Name...!");
			document.reg_step4.txtcity.focus();
			return false;
		}
		else if(document.reg_step4.txtstate.value == "") 
		{
		alert("Please enter your State...!");
		document.reg_step4.txtstate.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtstate.value, "abcdefghijklmnopqrstuvwxyz -."))
		{
			alert("Please Enter your valid State Name...!");
			document.reg_step4.txtstate.focus();
			return false;
		}
		else if(document.reg_step4.txtzip.value == "") 
		{
		alert("Please enter your Zip Code...!");
		document.reg_step4.txtzip.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtzip.value, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-0123456789 "))
		{
			alert("Please Enter your valid Zip Code...!");
			document.reg_step4.txtzip.focus();
			return false;
		}
		else if((document.reg_step4.txtadd.value == "") ||(document.reg_step4.txtadd.value.length < 15))
		{
		alert("Please enter your Complete Permanent Address ...!");
		document.reg_step4.txtadd.focus();
		return false;
		}
		else if(document.reg_step4.txtisd1.value == "") 
		{
		alert("Please enter  your ISD Code [Phone No. I]...!");
		document.reg_step4.txtisd1.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtisd1.value, "1234567890"))
		{
		alert("Only Numerics allowed for Country Code [Phone No.I]...!");
		document.reg_step4.txtisd1.focus();
		return false;
		}
		else if(document.reg_step4.txtstd1.value == "") 
		{
		alert("Please enter your STD Code [Phone No. I]...!");
		document.reg_step4.txtstd1.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtstd1.value, "1234567890"))
		{
		alert("Only Numerics allowed for State Code [Phone No.I]...!");
		document.reg_step4.txtstd1.focus();
		return false;
		}
		else if(document.reg_step4.txtphone1.value == "") 
		{
		alert("Please enter your Phone No...!");
		document.reg_step4.txtphone1.focus();
		return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtphone1.value, "1234567890"))
		{
		alert("Only Numerics allowed for Phone No. [Phone No.I]...!");
		document.reg_step4.txtphone1.focus();
		return false;
		}
		
		else if(document.reg_step4.txtphone2.value != "" && document.reg_step4.txtisd2.value == "" && document.reg_step4.txtstd2.value == "")
		{
			alert("Please complete Phone No. II...!");
			document.reg_step4.txtphone2.focus()
			return false;
		}
		else if(document.reg_step4.txtisd2.value != "" && document.reg_step4.txtphone2.value == "" && document.reg_step4.txtstd2.value == "")
		{
			alert("Please complete Phone No. II...!");
			document.reg_step4.txtisd2.focus()
			return false;
		}
		else if(document.reg_step4.txtstd2.value != "" && document.reg_step4.txtphone2.value == "" && document.reg_step4.txtisd2.value == "")
		{
			alert("Please complete Phone No. II...!");
			document.reg_step4.txtstd2.focus()
			return false;
		}
		else if(!charsOccurIn(document.reg_step4.txtmobileno.value, "1234567890"))
	{
	alert("Only Numerics allowed for Mobile No...!");
	document.reg_step4.txtmobileno.focus();
	return false;
	}
	else if(document.reg_step4.txtnationality.value == "") 
	{
		alert("please enter your Nationality");
		document.reg_step4.txtnationality.focus();
		return false;
	}
	
	else if(!charsOccurIn(document.reg_step4.txtnationality.value, "abcdefghijklmnopqrstuvwxyz"))
	{
	alert("Please enter your valid Nationality...!");
	document.reg_step4.txtnationality.focus();
	return false;
	}
	
	else
	{
			return true;
	}


}

function checkaddchange1(ival)
{
	if(document.reg_step4.sameadd.checked==true)
	{
				document.reg_step4.commadd.value=document.reg_step4.txtadd.value;
				document.reg_step4.hidadd.value=document.reg_step4.txtadd.value;
				document.reg_step4.commadd.disabled= true;
	}
	else
	{
		document.reg_step4.commadd.disabled=false;
		document.reg_step4.commadd.value="";
		document.reg_step4.hidadd.value="";
	}

}


