	function mediacns(pagename){
		mediacns_window=window.open(pagename,'mediacns_window','toolbar=no,location=no,borders=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=0,width=874,height=610');
	}


	function test(obj,msg) {
		  var regex = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
		  if (regex.test(obj.value))
		  {
			return true;
		  }
		  else{
			alert(msg);
			obj.focus();
			return false;
		  }
		}
	function checkint(obj,msg)
	{
	 if(isNaN(obj.value))
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	function checkempty(obj,msg)
	{
	 if(obj.value=="" || obj.value=="NULL")
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
	
	function checklength(obj,rlen,msg)
	{
	 if(obj.value.length<rlen)
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
	
	
function checkpassword(obj,obj1,msg)
	{
	 if(obj.value!=obj1.value)
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
	
	function checkboxcheck(obj,msg)
	{
	 if(!obj.checked)
	 {
	  alert(msg);
	  obj.focus();
	  return false;
	 }
	}
	
	
function check_regform()
	{
			if (checkempty(document.reg_form.name,"Type your Name")==false) return false;
		if (checkempty(document.reg_form.coname,"Type your Company Name")==false) return false;
        if (checkempty(document.reg_form.address,"Type your address")==false) return false;
		if (checkempty(document.reg_form.city,"Type your city Name")==false) return false;
        if (checkempty(document.reg_form.phone,"Type your phone number")==false) return false;
        if (checkempty(document.reg_form.fax,"Type your fax number")==false) return false;
        if (test(document.reg_form.email,"Please Enter Valid Email Address")==false) return false;
        if (checkempty(document.reg_form.comments,"Please leave your comments")==false) return false;
//if (checkempty(document.signup_form.scode,"Please Enter displayed Security Code")==false) return false;	
return true;

	}


function checkresform()
	{
		if (checkempty(document.resform.servicetype,"Please Select a Service Type")==false) return false;
		if (checkempty(document.resform.no_of_pass,"Please Enter Number of Passengers")==false) return false;
		if (checkempty(document.resform.names_of_passengers,"Please Enter Names of Passengers")==false) return false;
		if (checkempty(document.resform.tel_of_passengers,"Please Enter Tel(s) of Passengers")==false) return false;
		if (checkempty(document.resform.vehtype,"Please Select a Vehicle Type")==false) return false;
		if (checkempty(document.resform.service_time,"Please Select a Service Time")==false) return false;
		if (checkempty(document.resform.date_service,"Please Select a Service Date")==false) return false;
		if (checkempty(document.resform.pickup_street,"Please Enter a Pickup Place Name")==false) return false;
		if (checkempty(document.resform.pickup_city,"Please Enter a Pickup city")==false) return false;
		if (checkempty(document.resform.dest_street,"Please Enter a Destination Place Name")==false) return false;
		if (checkempty(document.resform.dest_city,"Please Enter a Destination City")==false) return false;
		if (checkint(document.resform.no_of_pass,"Number of Passenger must be Integer")==false) return false;
		if (checkint(document.resform.no_of_hours,"Number of Hours must be Integer")==false) return false;
if (checkboxcheck(document.resform.chkterms,"You must be agreed with Terms & Conditions to Go to Next Step")==false) return false;
}



<!--
function animationdiv(id){
document.getElementById(id).style.visibility="visible"
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->



//----------------------------------------
//---------------------------------------
// 	auto tab function
//------------------------------------------
//-------------------------------------------


var isNN = (navigator.appName.indexOf("Netscape")!=-1);

function autoTab(input,len, e) {
  var keyCode = (isNN) ? e.which : e.keyCode; 
  var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
  if(input.value.length >= len && !containsElement(filter,keyCode)) {
    input.value = input.value.slice(0, len);
    input.form[(getIndex(input)+1) % input.form.length].focus();
  }

  function containsElement(arr, ele) {
    var found = false, index = 0;
    while(!found && index < arr.length)
    if(arr[index] == ele)
    found = true;
    else
    index++;
    return found;
  }

  function getIndex(input) {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
    if (input.form[i] == input)index = i;
    else i++;
    return index;
  }
  return true;
}
