
function phonechk()
{  
  var i;
  var cha="0123456789+-";   
  var v=document.follow.contact_phone.value;
  for (i=0; i<=v.length; i++) 
  {
      if (cha.indexOf(v.charAt(i),0) == -1) 
    {
   		document.follow.contact_phone.value=v.substring(0,v.length-1);
 		return false;
    }
  } 
}

function mobilechk()
{  
  var i;
  var cha="0123456789+-";   
  var v=document.follow.fone_fax.value;
  for (i=0; i<=v.length; i++) 
  {
      if (cha.indexOf(v.charAt(i),0) == -1) 
    {
   		document.follow.fone_fax.value=v.substring(0,v.length-1);
 		return false;
    }
  } 
}

function valPost()
{

alert('test:'+document.getElementByName('AWB').value);
//	if (document.follow.AWB.value == "")
//	{
//		alert("Enter atleast one Air Waybill number!");
//		document.follow.AWB.focus();
//		return 1;
//	}
//	else
//	{
//		numbers = document.follow.AWB.value;
//		number = numbers.split("\n");
//		for(i=0; i<number.length; i++)
//		{
//			if (number[i].length > 10) 
//			{
//				numberSpace = number[i].split(" ");
//				for (j=0; j< numberSpace.length; j++)
//				{
//					flag = isNaN(numberSpace[j]);
//					if (flag == true ) 
//					{
//						alert("Air Waybill number is made up by numbers!");
//						return 1;
//					}
//					if (numberSpace[j].length > 12 || numberSpace[j].length < 8) 
//					{
//						alert("Air Waybill number is not a valid air waybill number!");
//						return 1;
//					}
//					txt = numberSpace[j].substr(0,9);
//					txt1 = numberSpace[j].substr(9,1);
//					test = (txt%7);
//					if (txt1 != test)
//					{
//						alert (numberSpace[j] + " is not valid air waybill number!");
//						return 1;
//					}					
//				} 
//			}
//			else
//			{
//				if (number[i].length > 1)
//				{
//					flag = isNaN(number[i]);
//					if (flag == true ) 
//					{
//						alert("Air Waybill number is made up by numbers!");
//						return 1;
//					}
//					if (number[i].length > 12 || number[i].length < 8) 
//					{
//						alert("Air Waybill number is not a valid air waybill number!");
//						return 1;
//					}
//					txt = number[i].substr(0,9);
//					txt1 = number[i].substr(9,1);
//					test = (txt%7);
//					if (txt1 != test)
//					{
//						alert (number[i] + " is not valid air waybill number!");
//						return 1;
//					}
//				}
//			}
//		}
//	}
//	if (!document.follow.service_type[0].checked && !document.follow.service_type[1].checked && !document.follow.service_type[2].checked && !document.follow.stop_track.checked)
//	{
//	   alert("Select email or SMS or FAX");
//	   document.follow.service_type[0].focus();
//	   return 1;	
//	}
//	else
//	{
//	if (!document.follow.stop_track.checked)
//	{
//	if (document.follow.service_type[1].checked)
//	{
//		if (document.follow.fone_fax.value == "")
//		{	
//		   alert("Enter Mobile number");
//		   document.follow.fone_fax.focus();
//		   return 1;
//		}   
//		if (!document.follow.fone_fax.value == "")
//		{
//			flag=isNaN(document.follow.fone_fax.value);
//			if (flag == true)		
//			{
//			  alert("Enter valid Mobile Number");
//			  document.follow.fone_fax.focus();
//			  return 1;
//			}
//		}	
//	}
//	if (document.follow.service_type[2].checked)
//	{
//		if (document.follow.fone_fax.value == "")
//		{	
//		   alert("Enter Fax number");
//		   document.follow.fone_fax.focus();
//		   return 1;
//		}   
//	}

//	if (document.follow.service_type[0].checked)
//	{
//		if (document.follow.name.value == "")
//		{
//		  alert("Enter Name");
//		  document.follow.name.focus();
//		  return 1;
//		}
//		if (document.follow.mail_addr.value == "")
//		{
//			alert("Enter e-mail address");
//			document.follow.mail_addr.focus();
//			return 1;
//		}
//		else
//		{
//			at=document.follow.mail_addr.value.indexOf("@");
//			if (at == -1)
//			{
//				alert("Not a valid e-mail address (@) missing");
//				document.follow.mail_addr.focus();
//				return 1;
//			}
//			at=document.follow.mail_addr.value.indexOf(".");
//			if (at == -1)
//			{
//				alert("Not a valid e-mail address (.) missing");
//				document.follow.mail_addr.focus();
//				return 1;
//			}			
//		}
//		if (document.follow.contact_phone.value == "")		
//		{
//		  alert("Enter Contact Number");
//		  document.follow.contact_phone.focus();
//		  return 1;
//		}
//		if (!document.follow.contact_phone.value == "")
//		{
//			flag=isNaN(document.follow.contact_phone.value);
//			if (flag == true)		
//			{
//			  alert("Enter valid Contact Number");
//			  document.follow.contact_phone.focus();
//			  return 1;
//			}
//		}		
//	}
//	}	
//	}
//	if (document.follow.stop_track.checked)
//	{
//		if (document.follow.name.value == "")
//		{
//		  alert("Enter Contact Name");
//		  document.follow.name.focus();
//		  return 1;
//		}
//		if (document.follow.contact_phone.value == "")		
//		{
//		  alert("Enter Contact Number");
//		  document.follow.contact_phone.focus();
//		  return 1;
//		}
//		if (!document.follow.contact_phone.value == "")
//		{
//			flag=isNaN(document.follow.contact_phone.value);
//			if (flag == true)		
//			{
//			  alert("Enter valid Contact Number");
//			  document.follow.contact_phone.focus();
//			  return 1;
//			}
//		}		
//	}
//	document.follow.method="post";
//	document.follow.action="http://www.dhl.co.in/cgi-bin/track1.cgi";
//	document.follow.submit();
}
