function isPostCode(entry){ // checks Canadian codes only
strlen=entry.length;
<!--if (strlen!==6){return false;}-->
entry=entry.toUpperCase();  // in case of lowercase

if(strlen==6)
{
	//alert('IF');
	
// Check for legal characters in string - note index starts at zero
if('ABCEGHJKLMNPRSTVXY'.indexOf(entry.charAt(0))<0) {return false;}
if('0123456789'.indexOf(entry.charAt(1))<0) {return false;}
if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2))<0) {return false;}
if('0123456789'.indexOf(entry.charAt(3))<0) {return false;}
if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(4))<0) {return false;}
if('0123456789'.indexOf(entry.charAt(5))<0) {return false;}
}
else
{
	//alert('else');
	
	// Check for legal characters in string - note index starts at zero
if('ABCEGHJKLMNPRSTVXY'.indexOf(entry.charAt(0))<0) {return false;}
if('0123456789'.indexOf(entry.charAt(1))<0) {return false;}
if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(2))<0) {return false;}
if('-., '.indexOf(entry.charAt(3))<0) {return false;}
if('0123456789'.indexOf(entry.charAt(4))<0) {return false;}
if('ABCDEFGHJKLMNPQRSTUVWXYZ'.indexOf(entry.charAt(5))<0) {return false;}
if('0123456789'.indexOf(entry.charAt(6))<0) {return false;}
}

return true;}




function validation1(frm1)
{
	
	 if(!CheckEmpty(document.frm.fname.value,"You did not give us your First name"))
	{
		document.frm.fname.focus();
		return false;
	}
	if(!CheckEmpty(document.frm.lname.value,"You did not give us your Last name"))
	{
		document.frm.lname.focus();
		return false;
	}
	 if(!CheckEmpty(document.frm.email.value,"Please enter your email Address"))
	{
		document.frm.email.focus();
		return false;
	}
	if(!CheckEmailAddr(document.frm.email.value))
		{
			alert("Please enter a valid email address");
			document.frm.email.value="";
			document.frm.email.focus();
			return false;
		}
		
	 if(!CheckEmpty(document.frm.confirmemail.value,"Please enter the confirm email address"))
	{
		document.frm.confirmemail.focus();
		return false;
	}
		if(!CheckEmailAddr(document.frm.confirmemail.value))
		{
			alert("Please enter a valid confirm email address");
			document.frm.confirmemail.value="";
			document.frm.confirmemail.focus();
			return false;
		}
		
		if(document.frm.email.value!=document.frm.confirmemail.value)
		{
			alert("Your confirm email address do not match");
			document.frm.confirmemail.value="";
			document.frm.confirmemail.focus();
			return false;
		}
		
		
		
	if(!CheckEmpty(document.frm.phone.value,"Please enter your phone"))
	{
		document.frm.phone.focus();
		return false;
	}

	if(document.frm.phone.value.length<10)
	{
		alert('Please enter the Valid phone number');
		document.frm.phone.focus();
		return false;
	}
	
    if(!IsPhone(document.frm.phone.value,"Please enter the Valid phone number ,it "))
	{
		document.frm.phone.focus();
		return false;
	}

    if(frm1.txtCaptcha.value == "")
	{
		alert("Please enter Verification Code");
		frm1.txtCaptcha.focus();
		return false;
	}
	getParam(frm1);
	return (false);	
	
}
	
	
	
	
	
function validation2()
{

dml=document.forms['frm1'];
len = dml.elements.length;
	
	 if(!CheckEmpty(document.frm1.fname.value,"You did not give us your First name"))
	{
		document.frm1.fname.focus();
		return false;
	}
	if(!CheckEmpty(document.frm1.lname.value,"You did not give us your Last name"))
	{
		document.frm1.lname.focus();
		return false;
	}
	 if(!CheckEmpty(document.frm1.email.value,"Please enter your email Address"))
	{
		document.frm1.email.focus();
		return false;
	}
	if(!CheckEmailAddr(document.frm1.email.value))
		{
			alert("Please enter a valid email address");
			document.frm1.email.focus();
			return false;
		}
		
	
	if(!CheckEmpty(document.frm1.phone.value,"Please enter your phone"))
	{
		document.frm1.phone.focus();
		return false;
	}

	if(document.frm1.phone.value.length<10)
	{
		alert('Please enter the Valid phone number');
		document.frm1.phone.focus();
		return false;
	}
	
if(!IsPhone(document.frm1.phone.value,"Please enter the Valid phone number ,it "))
	{
		document.frm1.phone.focus();
		return false;
	}
		
	for( i=0 ; i<len ; i++)
		{
			
			if (dml.elements[i].name=='f[graduation]')
			{
			 	if (dml.elements[i].value=="No high school - I am 19 or older")
				{								
					alert("Please Select When was your High School Graduation year? ");
					dml.elements[i].focus();
					return false;  
			}
				
		}
		
	/*	if (dml.elements[i].name=='f[graduation]')
			{
			 	if (dml.elements[i].value=="2011")
				{								
					alert("Please Select When was your High School Graduation year? ");
					dml.elements[i].focus();
					return false;  
			}
				
		}*/
		
		/*	if (dml.elements[i].name=='f[country]')
			{
			 	
				if (dml.elements[i].value=="Other")
				{								
					alert("We are only accepting candidates from Canada currently");
					dml.elements[i].focus();
					return false;  
			}
				
		}*/
			
			if (dml.elements[i].name=='f[country]')
			{
			 	
				if (dml.elements[i].value=="")
				{								
					alert("In which Country do you live?");
					dml.elements[i].focus();
					return false;  
			}
				
		}
		
		
			if (dml.elements[i].name=='f[province]')
			{
			 	if (dml.elements[i].value=="")
				{								
					alert("In which Province do you live?");
					dml.elements[i].focus();
					return false;  
			}
				
			}
			
		if (dml.elements[i].name=='f[city]')
			{
					if (dml.elements[i].value=="")
					{								
					alert("In which city do you live?");
					dml.elements[i].focus();
					return false;  
					}
				
			}
			
			if (dml.elements[i].name=='f[campus]')
			{
			 	if (dml.elements[i].value=="")
				{								
					alert("Which CDI College campus would you be interested to attend?");
					dml.elements[i].focus();
					return false;  
			}
			}
			
		
	
			
		if (dml.elements[i].name=='f[address1]')
			{
			 	if (dml.elements[i].value=="")
				{								
					alert("What is your street address?");
					dml.elements[i].focus();
					return false;  
			}	
				
		}
		
		
	if(document.frm1.countryselected.value=='CA' || document.frm1.provinceselected.value!='Outside Canada' )
	{
			
			if (dml.elements[i].name=='f[postalcode]')
				{
					if (dml.elements[i].value=="")
					{								
						alert("What is your postal code?");
						dml.elements[i].focus();
						return false;  
				   }	
				   
				   var res=isPostCode(dml.elements[i].value);
					
					if(res==false)
					{
						alert("Please enter a valid postal code");
						dml.elements[i].focus();
						return false;  
					}
					
			}
		
	}
	else
	{
		
			if (dml.elements[i].name=='f[postalcode]')
				{
					if (dml.elements[i].value=="")
					{								
						alert("What is your postal code?");
						dml.elements[i].focus();
						return false;  
				   }	
				   
								
			}
		
	}
		
			/*if (dml.elements[i].name=='f[postalcode]')
			{
				
			 	var res=isPostCode(dml.elements[i].value);
				
				if(res==false)
				{
					alert("Please enter a valid postal code");
					dml.elements[i].focus();
					return false;  
				}
				
		
				
		}*/
		
		
		
		
	/*	
		if (dml.elements[i].name=='postalverify')
			{
			 	if (dml.elements[i].value=="0")
				{								
					alert("Sorry, your postal code location does not match an appropriate campus location, please choose another campus nearer to home.");
					
					return false;  
			}	
				
		}*/
		
		if (dml.elements[i].name=='f[interested]')
			{
			 	if (dml.elements[i].value=="")
				{								
					alert("Which program are you interested to study?");
					dml.elements[i].focus();
					return false;  
			}	
				
		}
		
	/*	if (dml.elements[i].name=='f[comments]')
			{
			 	if (dml.elements[i].value=="")
				{								
					alert("Comments or queries?");
					dml.elements[i].focus();
					return false;  
			}	
				
		}*/
		
	/*	if (dml.elements[i].name=='postalverify')
			{
			 	if (dml.elements[i].value=="0")
				{								
					alert("Sorry, your postal code location does not match an appropriate campus location, please choose another campus nearer to home.");
					
					return false;  
			}	
				
		}*/
		
	
		}

	
	return true;
	}

