	function checkForm(theform) {
	
		//var theform = document.OrderForm
		var strErrorMessage = ""
		var selectListOK = false
		var today = new Date();
		
	
		// address information
		if (theform.telephone.value.length == 0) {
			strErrorMessage = "\n * Telephone Number was not entered" + strErrorMessage
			theform.telephone.focus();
		}
		if (theform.country.value.length == 0) {
			strErrorMessage = "\n * A country was not selected" + strErrorMessage
			theform.country.focus();
		}
		
		/*
		Not compulsory for MISTI Asia
		if (theform.postcode.value.length == 0) {
			strErrorMessage = "\n * Postcode or Zip Code was not entered" + strErrorMessage
			theform.postcode.focus();
		}
		*/
		
		if (theform.city.value.length == 0) {
			strErrorMessage = "\n * City was not entered" + strErrorMessage
			theform.city.focus();
		}
		
		if (theform.address1.value.length == 0) {
			strErrorMessage = "\n * Address line 1 was not entered" + strErrorMessage
			theform.address1.focus();
		}
		
		// name information
		if (theform.jobtitle.value.length == 0) {
			strErrorMessage = "\n * Your Job Title was not entered" + strErrorMessage
			theform.jobtitle.focus();
		}
		if (theform.companyname.value.length == 0) {
			strErrorMessage = "\n * Company Name was not entered" + strErrorMessage
			theform.companyname.focus();
		}
		if (theform.lastname.value.length == 0) {
			strErrorMessage = "\n * Last Name was not entered" + strErrorMessage
			theform.lastname.focus();
		}
		if (theform.firstname.value.length == 0) {
			strErrorMessage = "\n * First Name was not entered" + strErrorMessage
			theform.firstname.focus();
		}
		
		if (theform.emailaddress.value.length == 0) {
			strErrorMessage = "\n * A valid email address was not entered" + strErrorMessage
			theform.emailaddress.focus();
		}
		
		if (theform.title.value.length == 0) {
			strErrorMessage = "\n * Title was not entered" + strErrorMessage
			theform.title.focus();
		}

		//BPA Questions
		/*	NOT mandatory for MIS Asia
		if (theform.BPA_HowLearned.value.length == 0) {
			strErrorMessage =  strErrorMessage + "\n * Please choose an option for question 1" 
			theform.BPA_HowLearned.focus();
		}
		
		if (theform.PriorityCode.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Please enter a registration code"
			theform.PriorityCode.focus();
		}

		if (theform.BPA_Function.value.length == 0) {
			strErrorMessage =  strErrorMessage + "\n * Please choose an option for question 2"
			theform.BPA_Function.focus();
		}

		if (theform.BPA_Responsibility.value.length == 0) {
			strErrorMessage =  strErrorMessage + "\n * Please choose an option for question 3" 
			theform.BPA_Responsibility.focus();
		}
	
		if (theform.BPA_Industry.value.length == 0) {
			strErrorMessage =  strErrorMessage + "\n * Please choose an option for question 4" 
			theform.BPA_Industry.focus();
		}
		*/


		if (!(theform.termsandconditions.checked)) {
			strErrorMessage = strErrorMessage + "\n * You cannot continue without agreeing to the terms and conditions"
			theform.termsandconditions.focus();
		}

		if(strErrorMessage!='') {
			return formOK(strErrorMessage)
		}
		else {
			return true;
		}
	
	};

	function showTermsAndConditions() {
	var newwindow
		if (typeof(newWindow2) == 'object') {
			if (!newWindow2.closed) {
				newWindow2.close();
				newWindow2 = window.open('includes/termsandconditions.asp','termsandconditions', 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
			} else {
				newWindow2 = window.open('includes/termsandconditions.asp','termsandconditions', 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
			}
		} else {
			newWindow2 = window.open('includes/termsandconditions.asp','termsandconditions', 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
		}
	}
	function showPrivacyStatment() {
	var newwindow
		if (typeof(newWindow2) == 'object') {
			if (!newWindow2.closed) {
				newWindow2.close();
				newWindow2 = window.open('/includes/privacystatement.asp','privacystatement', 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
			} else {
				newWindow2 = window.open('/includes/privacystatement.asp','privacystatement', 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
			}
		} else {
			newWindow2 = window.open('/includes/privacystatement.asp','privacystatement', 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
		}
	}	

	function checkLoginForm() {
		var strErrorMessage = ""
		if (document.login.password.value.length == 0) {
			strErrorMessage = "\n * Password was not entered" + strErrorMessage
			document.login.password.focus();
		} else {
			if (document.login.password.value.length > 50) {
				strErrorMessage = "\n * Password must not exceed 50 characters" + strErrorMessage
				document.login.password.focus();
			}
		}

		if (document.login.emailaddress.value.length > 100) {
			strErrorMessage = "\n * Email address must not exceed 100 characters" + strErrorMessage
			document.login.emailaddress.focus();
		} else {
			if (!isEmail(document.login.emailaddress.value) && (document.login.emailaddress.value.toLowerCase().indexOf("milbank") < 0) && (document.login.emailaddress.value != 'KREDITANSTALT')) {
				strErrorMessage = "\n * A valid email address was not entered" + strErrorMessage
				document.login.emailaddress.focus();
			}
		}
		if (strErrorMessage.length > 0 ) {
			if (strErrorMessage.indexOf("\n") != strErrorMessage.lastIndexOf("\n")) { SOrNot = "s" } else { SOrNot = "" }
			alert("The form could not be submitted because of the following error"+SOrNot+":\n" + strErrorMessage + "\n\nPlease correct the above error"+SOrNot+" and try submitting the form again");
			return false;
		} else {
			document.login.submit();
			return false;
		}
	}

	function formOK(strErrorMessage) {
		if (strErrorMessage.length > 0 ) {
			if (strErrorMessage.indexOf("\n") != strErrorMessage.lastIndexOf("\n")) { SOrNot = "s" } else { SOrNot = "" }
			alert("The form could not be submitted because of the following error"+SOrNot+":\n" + strErrorMessage + "\n\nPlease correct the above error"+SOrNot+" and try submitting the form again");
			return false;
		} else {
			return true;
		}
	}

	function isEmail(strEmail) {
		//var emailFormat = /^\w+((\.\w+)|(\-\w+))*@\w+((\.\w+)|(\-\w+))*\.\w+$/;
		var emailFormat = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
	 	if (! strEmail.match(emailFormat)) {
			return false;
		} else {
			return true;
		}
	}
	
	function SubmitIt(action) {
		document.forms[0].action = action;
		document.forms[0].submit();
		return false;
	}


	var newWindow
	function selectAddress(addresstype, addressID) {
		if (typeof(newWindow) == 'object') {
			if (!newWindow.closed) {
				newWindow.close();
				newWindow = selectAddress2(addresstype, addressID)
			} else {
				newWindow = selectAddress2(addresstype, addressID)
			}
		} else {
			newWindow = selectAddress2(addresstype, addressID)
		}

	}

	function selectAddress2(addresstype, addressID) {
		return(window.open('/includes/address/editaddress.asp?showUse='+addresstype+'&aID='+addressID,'selectaddress', 'width=600,height=450,resizable=0,scrollbars=yes,status=yes'))
	}


	function UseAddress(strType, aID) {
		window.opener.changeAddress(strType, aID);
		window.close();
		return false;
	}

	function closeAddressWindow() {
		window.opener.details.elements.page.value = 101;
		window.opener.details.submit();
		window.close();
		return false;
	}


	function showReminder(page) {
		if (typeof(newWindow) == 'object') {
			if (!newWindow.closed) {
				newWindow.close();
				newWindow = window.open('/includes/login/'+page,'passwordreminder', 'width=350,height=200,resizable=0,scrollbars=no,status=no');
			} else {
				newWindow = window.open('/includes/login/'+page,'passwordreminder', 'width=350,height=200,resizable=0,scrollbars=no,status=no');
			}
		} else {
			newWindow = window.open('/includes/login/'+page,'passwordreminder', 'width=350,height=200,resizable=0,scrollbars=no,status=no');
		}
		return false;
	}



	function showPasswordReminder() {
		if (typeof(newWindow) == 'object') {
			if (!newWindow.closed) {
				newWindow.close();
				newWindow = window.open('/includes/login/passwordreminder.asp','passwordreminder', 'width=320,height=170,resizable=0,scrollbars=no,status=no');
			} else {
				newWindow = window.open('/includes/login/passwordreminder.asp','passwordreminder', 'width=320,height=170,resizable=0,scrollbars=no,status=no');
			}
		} else {
			newWindow = window.open('/includes/login/passwordreminder.asp','passwordreminder', 'width=320,height=170,resizable=0,scrollbars=no,status=no');
		}
		//return false;
	}

	function showPasswordInformer() {
		if (typeof(newWindow) == 'object') {
			if (!newWindow.closed) {
				newWindow.close();
				newWindow = window.open('/includes/login/passwordinformer.asp','passwordinformer', 'width=360,height=210,resizable=0,scrollbars=no,status=no');
			} else {
				newWindow = window.open('/includes/login/passwordinformer.asp','passwordinformer', 'width=360,height=210,resizable=0,scrollbars=no,status=no');
			}
		} else {
			newWindow = window.open('/includes/login/passwordinformer.asp','passwordinformer', 'width=360,height=210,resizable=0,scrollbars=no,status=no');
		}
		//return false;
	}


	function showEMAF2(PUB,SID,ISS) {
		if (typeof(newWindow) == 'object') {
			if (!newWindow.closed) {
				newWindow.close();
				newWindow = window.open('/includes/EMAF.asp?PUB='+ PUB + '&SID=' + SID + '&ISS=' + ISS,'EMAF', 'width=410,height=300,resizable=0,scrollbars=no,status=no');
			} else {
				newWindow = window.open('/includes/EMAF.asp?PUB='+ PUB + '&SID=' + SID + '&ISS=' + ISS,'EMAF', 'width=410,height=300,resizable=0,scrollbars=no,status=no');
			}
		} else {
			newWindow = window.open('/includes/EMAF.asp?PUB='+ PUB + '&SID=' + SID + '&ISS=' + ISS,'EMAF', 'width=410,height=300,resizable=0,scrollbars=no,status=no');
		}
		//return false;
	}
	
	function isChecked(objCheck) {
	
		var numItems, i, boolTicked
	
		numItems = objCheck.length;
		i = 0;
		boolTicked = false;
		while ((i < numItems) && (!(boolTicked))) {
			if (objCheck[i].checked) {
				boolTicked = true;
			};//end if
			i++;
		};//end while
	
		return boolTicked;
	
	}

	function textLimiter(field,maxlimit) {
	/*Function to limit input in textarea*/

		// if too long, trim and produce an alert
		if (field.value.length > maxlimit) {
			field.value = field.value.substring(0, maxlimit);
			alert ("Maximum input length for this field is " + maxlimit + " characters.")
		} //end if 
	}

	function showSecurityCode() {
		var newWindow3
		if (typeof(newWindow3) == 'object') {
			if (!newWindow2.closed) {
				newWindow3.close();
				newWindow3 = window.open('http://www.euromoneyplc.com/static/stubs/stub107.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
			} else {
				newWindow3 = window.open('http://www.euromoneyplc.com/static/stubs/stub107.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
			}
		} else {
			newWindow3 = window.open('http://www.euromoneyplc.com/static/stubs/stub107.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
		}
	}	

	
	