var eml_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
function checkit(thisForm) {
if (thisForm.name.value=="name") {
alert("Please supply your name.");
thisForm.name.focus();
thisForm.name.select();
return false;
}

if (thisForm.surname.value=="surname") {
alert("Please supply your surname.");
thisForm.surname.focus();
thisForm.surname.select();
return false;
}

if (thisForm.details.value=="details") {
alert("Please supply a few details.");
thisForm.details.focus();
thisForm.details.select();
return false;
}

if (eml_val.test(thisForm.email.value) &! thisForm.email.value=="") {
thisForm.submit();
return true; }
else {
alert("Please supply a valid e-mail address.");
thisForm.email.focus();
thisForm.email.select();
return false;
}
}

function onField(txtfield) {
if (txtfield.value==txtfield.id)
txtfield.value = "";
txtfield.className='stdinputbox stdinputover'
}

function offField(txtfield) {
if (txtfield.value=="")
txtfield.value=txtfield.id;
if (txtfield.type=='text') {
txtfield.className='stdinputbox'
} else {
txtfield.className='stdinputboxc'
}
}

function onFieldNL(txtfield) {
if (txtfield.value==txtfield.id)
txtfield.value = "";
txtfield.className='stdinputbox stdinputover'
}

function offFieldNL(txtfield) {
if (txtfield.value=="")
txtfield.value=txtfield.id;
txtfield.className='stdinputbox'
}

function addToFavorites() {
var urlAddress = "http://www." + domain;
var pageName = "WebCleanse Blueskies";
if (window.external) {
	window.external.AddFavorite(urlAddress,pageName)
	}
else { 
	alert("Sorry! Your browser doesn't support this function.");
	}
}

function validinput(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
        alert("You must enter a valid number");
        IsNumber = false;
	document.getElementById('passnum').focus();
	document.getElementById("passnum").select();
         }
      }
   return IsNumber;
   
   }
