﻿// JScript File
var name ="ctl00_pageContent_";

function checkForm(frm){	
     var msg = "Sorry, there was a problem with your submission. Please specify your ";
     var comp = document.getElementById(name+"txtCompany");
     
     var add = document.getElementById(name+"txtAddress");
     var email = document.getElementById(name+"txtEmail");
     var contact = document.getElementById(name+"txtContact");
     var tel = document.getElementById(name+"txtPhone");

     if (comp.value =="") {alert(msg + "company/organisation. If you are self-employed, please enter the name of your limited company."); comp.focus(); return false;}
     if (tel.value =="") {alert(msg + "contact telephone number during office hours."); tel.focus(); return false;}	
     if (add.value =="") {alert(msg + "contact address within your company/organisation."); add.focus(); return false;}
     if (contact.value =="") {alert(msg + "name. This is required to help us contact you in case there is a problem with your application."); contact.focus(); return false;}
     if (email.value =="") {alert(msg + "email address. We will send your registration code, billing and subscription details to this address. Where possible, please specify your business email account -- we discourage applications from individuals using public webmail services (e.g. Hotmail, GMail) for business use."); email.focus(); return false;}
     if (checkMail(email)==false) {return false;}
     disableButton();
     return true;
 }
 
 function clearOjb() {
  document.getElementById(name+"txtCompany").value="";
  document.getElementById(name+"txtAddress").value="";
  document.getElementById(name+"txtEmail").value="";
  document.getElementById(name+"txtContact").value="";
  document.getElementById(name+"txtPhone").value="";
  document.getElementById(name+"txtCompany").focus();
  document.getElementById("ctl00_pageContent_Err").innerHTML = "";
 }
 
function disableButton() {	
	window.setTimeout("enableButton('" + window.event.srcElement.id + "')", 0);
}			            
function enableButton(buttonID) {
	document.getElementById(buttonID).disabled=true;         
}	

