var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-4353957-2");
pageTracker._trackPageview();
} catch(err) {}

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function validate_form(thisform)
{
  var form_name = thisform.Name;
  if (form_name.value==null || form_name.value=="") {
    alert("Please enter your name")
    form_name.focus();
    return false;
  }

  var email = thisform.Email;
  var homeno = thisform.HomeNo;
  var offno = thisform.OffNo;
  var hpno = thisform.HPno;
  var faxno = thisform.FaxNo;
  
  if ((email.value==null || email.value=="") &&
      (homeno.value==null || homeno.value=="") &&
      (offno.value==null || offno.value=="") &&
      (hpno.value==null || hpno.value=="") &&
      (faxno.value==null || faxno.value==""))
  {
    alert("Please provide your contact")
    homeno.focus();
    return false;
  }

  if (homeno.value!="" && (homeno.value.length != 8 || !isInteger(homeno.value))) {
    alert("Please enter valid home number")
    homeno.focus();
    return false;
  }
	  
  if (offno.value!="" && (offno.value.length != 8 || !isInteger(offno.value))) {
    alert("Please enter valid office number")
    offno.focus();
    return false;
  }

  if (hpno.value!="" && (hpno.value.length != 8 || !isInteger(hpno.value))) {
    alert("Please enter valid mobile number")
    hpno.focus();
    return false;
  }

  if (faxno.value!="" && (faxno.value.length != 8 || !isInteger(faxno.value))) {
    alert("Please enter valid fax number")
    hpno.focus();
    return false;
  }

  if (email.value!="") {
    apos=email.value.indexOf("@");
    dotpos=email.value.lastIndexOf(".");
    if (apos<1||dotpos-apos<2) {
	  alert("Please enter valid email");
	  return false;
	}
  }
  
  return true;
}