<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}
 
function Set_Cookie(name,value,expires,path,domain,secure) {
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
 
var today = new Date();
var expires = new Date(today.getTime() + (56 * 86400000));
var deleteexpires = new Date(today.getTime() - 1);
 
function set() {
    if (document.loginForm.saveDetails.checked) {
        Set_Cookie("publicuserid",document.loginForm.uid.value,expires,"/");
        Set_Cookie("publicpassword",document.loginForm.pwd.value,expires,"/");         
	}
    else {
        Set_Cookie("publicuserid",document.loginForm.uid.value,deleteexpires,"/");
        Set_Cookie("publicpassword",document.loginForm.pwd.value,deleteexpires,"/");
	}
}

function get() {
    userid = Get_Cookie("publicuserid")
    if (userid != null) {
        document.loginForm.uid.value = userid;
        document.loginForm.saveDetails.checked = true;
    }
    password = Get_Cookie("publicpassword")
    if (password != null) {
        document.loginForm.pwd.value = password;
    }
}
function validateLogin()
{
	with (window.document.loginForm)
	{
	if (uid.value.length == 0){
	    uid.focus();
		alert ("Please enter a valid username in the space provided");
		return false;
	}
	if (pwd.value.length == 0){
	    pwd.focus();
		alert ("Please enter a valid password in the space provided");
		return false;
	}
	set();
	submit();	
	}
}
function greeting(){
	//ITS Insert Greeting Ver 1.0 - © ITS New Media
	ITS_Now = new Date();
	localtime = ITS_Now.toString();
	ITS_Hours = ITS_Now.getHours();
	if (ITS_Hours < 12) {
		document.write("Good Morning");
	} else {
		if (ITS_Hours >= 12 && ITS_Hours < 17)  {
				document.write("Good Afternoon,");
		} else {
			if (ITS_Hours >= 17) {
				document.write("Good Evening,");
				} else {
				document.write("Good Day,");
			}
		}
	}
}

function validateEmail(thisEmailField) {
  if(-1 == thisEmailField.value.indexOf("@")) { 
     alert("Your email address must have a '@'."); 
     return false; 
  }
  if(-1 == thisEmailField.value.indexOf(".")) { 
     alert("Your email address must have a '.'."); 
     return false; 
  }
  if(-1 != thisEmailField.value.indexOf(",")) { 
     alert("Your email address must not have a ',' in it"); 
     return false; 
  }
  if(-1 != thisEmailField.value.indexOf("#")) { 
     alert("Your email address must not have an '#' in it." ); 
     return false; 
  }
  if(-1 != thisEmailField.value.indexOf("!")) { 
     alert("Your email address must not have a '!' in it." ); 
     return false; 
  }
  if(-1 != thisEmailField.value.indexOf(" ")) { 
     alert("Your email address must not have a space in it." ); 
     return false; 
  }
  if(thisEmailField.value.length == (thisEmailField.value.indexOf("@")+1) ) {
     alert("Your email address must have a domain name after the '@'.");
     return false;
  }
  return true;
}	

function validatebooking() 
{
  with (window.document.enquiryForm)
  {
	if (userPeople.value.length == 0){
	  userPeople.focus();
	  alert ("Please enter the number of people attending the conference in the space provided.");
	  return false;
	}
	if (userDelegateName1.value.length == 0){
	  userDelegateName1.focus();
	  alert ("Please enter 1st Delegate Name in the space provided.");
	  return false;
	}
	if (userEmail1.value.length == 0){
	  userEmail1.focus();
	  alert ("Please enter the email address of the 1st delegate.");
	  return false;
	}
	if (userEmail1.value.length != 0){
	  if (validateEmail(userEmail1) == false){
		return false;}
	}
	if (user1DelegateandJobTitle1.value.length == 0){
	  user1DelegateandJobTitle1.focus();
	  alert ("Please enter 1st Delegate Job Title and Department in the space provided.");
	  return false;
	}	
	if (userCompany.value.length == 0){
	  userCompany.focus();
	  alert ("Please enter your company name in the space provided.");
	  return false;
	}
	if (userAddress1.value.length == 0){
	  userAddress1.focus();
	  alert ("Please enter your address in the space provided.");
	  return false;
	}
	if (userTown.value.length == 0){
	  userTown.focus();
	  alert ("Please enter your town in the space provided.");
	  return false;
	}
	if (userCounty.value.length == 0){
	  userCounty.focus();
	  alert ("Please enter your county in the space provided.");
	  return false;
	}
	if (userCountry.value.length == 0){
	  userCountry.focus();
	  alert ("Please enter your country in the space provided.");
	  return false;
	}
	if (userTel.value.length == 0){
	  userTel.focus();
	  alert ("Please enter your telephone number in the space provided.");
	  return false;
	}
	
	if (userPaymentMethod.value.length == 0){
	  userPaymentMethod.focus();
	  alert ("Please select your preferred method of payment from the menu provided.");
	  return false;
	}
	if (policy.checked == false) {
		policy.focus();
		alert("You must agree to our cancellation policies.");
		return false;
	}				
	}
}

	function showhidedropdowns(thisSelect) {
		with (document.all) {
			  document.getElementById("billingsfields").style.display='none';
	
			if (thisSelect.options[thisSelect.selectedIndex].value =="yes") {
			  document.getElementById("billingsfields").style.display='';
			}
			if (thisSelect.options[thisSelect.selectedIndex].value =="no") {
			  document.getElementById("billingsfields").style.display='none';
			}
		}
	}
	function lunhtest(cardNumber) {
		var number = cardNumber;
		var i, sum, weight;
		sum=0;
		for (i = 0; i < number.length - 1; i++) {
			weight = number.substr(number.length - (i + 2), 1) * (2 - (i % 2));
			sum += ((weight < 10) ? weight : (weight - 9));
		}
		if (parseInt(number.substr(number.length-1)) == ((10 - sum % 10) % 10)) {
			return true;
		} 
		else {
			alert("Invalid Card Number");
			return false;
		}
	}
//-->