function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid email address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid email address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid email address")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid email address")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid email address")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid email address")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid email address")
		    return false
		 }

 		 return true;					
	}

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;
}

//  End -->
function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}
function validate_email(field,alerttxt)
{
with (field)
  {
  apos=value.indexOf("@");
  dotpos=value.lastIndexOf(".");
  if (apos<1||dotpos-apos<2)
    {alert(alerttxt);return false;}
  else {return true;}
  }
}

function validate_form1(thisform)
{
with (thisform)
  {
  if (validate_required(name,"Name must be filled out!")==false)
  {name.focus();return false;}
  }
    
	with (thisform)
  {
  if (validate_required(sname,"Surname must be filled out!")==false)
  {sname.focus();return false;}
  }
	
	
	with (thisform)
  {
  if (validate_required(username,"Username must be filled out!")==false)
  {username.focus();return false;}
  }
  
  with (thisform)
  {
  if (validate_email(email,"Not a valid e-mail address!")==false)
    {email.focus();return false;}
  }
  
   /*with (thisform)
  {
  if (validate_required(email,"Email must be filled out!")==false)
  {email.focus();return false;}
  }
  */
  with (thisform)
  {
  if (validate_required(excel,"Current version of Microsoft Excel used must be filled out!")==false)
  {excel.focus();return false;}
  }
  
   with (thisform)
  {
  if (validate_required(phone,"Phone number must be filled out!")==false)
  {phone.focus();return false;}
  }
  
   with (thisform)
  {
  if (validate_required(traded,"Betfair currency traded in must be filled out!")==false)
  {traded.focus();return false;}
  }   
  
  with (thisform)
  {
  if (validate_required(soft,"Choose one!")==false)
  {soft.focus();return false;}
  }   
  
  with (thisform)
  {
  if (validate_required(auto,"Where did you hear about Auto-BF must be filled out!")==false)
  {auto.focus();return false;}
  }   
}

// gustbook js//


// camper deatil js//

function validate_required1(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}

	

