var phone = "()- 0123456789";
var numb = "0123456789";
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
var alphanum = "01234567891abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
var addr = "01234567891abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_ ";
function res(t,v){
var w = "";
for (i=0; i < t.value.length; i++) {
x = t.value.charAt(i);
if (v.indexOf(x,0) != -1)
 w += x; 
}
t.value = w;
}

function cardval(s) {
var v = "0123456789";
var w = "";
for (i=0; i < s.length; i++) {
x = s.charAt(i);
if (v.indexOf(x,0) != -1)
w += x;
}
j = w.length / 2;
if (j < 6.5 || j > 8 || j == 7) return false;
k = Math.floor(j);
m = Math.ceil(j) - k;
c = 0;
for (i=0; i<k; i++) {
a = w.charAt(i*2+m) * 2;
c += a > 9 ? Math.floor(a/10 + a%10) : a;
}
for (i=0; i<k+m; i++) c += w.charAt(i*2+1-m) * 1;
return (c%10 == 0);
}

function checkExistingForm() {
	
		var strErrorMessage = ""

		if (document.existing.password.value.length == 0) {
			strErrorMessage = "\n * Password was not entered" + strErrorMessage
			document.existing.password.focus();
		} else {
			if (document.existing.password.value.length > 50) {
				strErrorMessage = "\n * Password must not exceed 50 characters" + strErrorMessage
				document.existing.password.focus();
			}
		}

		if (document.existing.emailaddress.value.length > 100) {
			strErrorMessage = "\n * Email address must not exceed 100 characters" + strErrorMessage
			document.existing.emailaddress.focus();
		} else {
			if (!isEmail(document.existing.emailaddress.value) && (document.existing.emailaddress.value.toLowerCase() != 'milbank') && (document.existing.emailaddress.value != 'KREDITANSTALT')) {
				strErrorMessage = "\n * A valid email address was not entered" + strErrorMessage
				document.existing.emailaddress.focus();
			}
		}

		return formOK(strErrorMessage)
		
	}



	function checkEmailForm() {
		var strErrorMessage = ""
		
		
		if (document.fw_email.name.value.length == 0) {
			strErrorMessage = "\n * Your name was not entered" + strErrorMessage
			document.fw_email.name.focus();
		} else {
			if (document.fw_email.name.value.length > 50) {
				strErrorMessage = "\n * Your name must not exceed 50 characters" + strErrorMessage
				document.fw_email.name.focus();
			}
		}
		if (document.fw_email.email1.value.length > 100) {
			strErrorMessage = "\n * Email address must not exceed 100 characters" + strErrorMessage
			document.fw_email.email1.focus();
		} else {
			if (!isEmail(document.fw_email.email1.value)) {
				strErrorMessage = "\n * Your email address was not valid" + strErrorMessage
				document.fw_email.email1.focus();
			}
		}

		if (document.fw_email.toemail1.value.length > 100) {
			strErrorMessage = "\n * Recipient 1 email address must not exceed 100 characters" + strErrorMessage
			document.fw_email.toemail1.focus();
		} else {
			if ((document.fw_email.toemail1.value.length > 0)&&(!isEmail(document.fw_email.toemail1.value))) {
				strErrorMessage = "\n * Recipient 1 email address was not valid" + strErrorMessage
				document.fw_email.toemail1.focus();
			}
		}

		if (document.fw_email.toemail2.value.length > 100) {
			strErrorMessage = "\n * Recipient 2 email address must not exceed 100 characters" + strErrorMessage
			document.fw_email.toemail2.focus();
		} else {
			if ((document.fw_email.toemail2.value.length > 0)&&(!isEmail(document.fw_email.toemail2.value))) {
				strErrorMessage = "\n * Recipient 2 email address was not valid" + strErrorMessage
				document.fw_email.toemail2.focus();
			}
		}

		if (document.fw_email.toemail3.value.length > 100) {
			strErrorMessage = "\n * Recipient 3 email address must not exceed 100 characters" + strErrorMessage
			document.fw_email.toemail3.focus();
		} else {
			if ((document.fw_email.toemail3.value.length > 0) && (!isEmail(document.fw_email.toemail3.value))) {
				strErrorMessage = "\n * Recipient 3 email address was not valid" + strErrorMessage
				document.fw_email.toemail3.focus();
			}
		}
		if ((!isEmail(document.fw_email.toemail1.value)) && (!isEmail(document.fw_email.toemail2.value)) && (!isEmail(document.fw_email.toemail3.value))) {
				strErrorMessage = "\n * you have not enter a valid Recipient email address. " + strErrorMessage
				document.fw_email.toemail3.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.fw_email.submit();
			return false;
		}
	}

	function showPrivacyStatment() {
	var newwindow
		if (typeof(newWindow2) == 'object') {
			if (!newWindow2.closed) {
				newWindow2.close();
				newWindow2 = window.open('includes/privacystatement.asp','privacystatement', 'width=650,height=680,resizable=0,scrollbars=yes,status=yes')
			} else {
				newWindow2 = window.open('includes/privacystatement.asp','privacystatement', 'width=650,height=680,resizable=0,scrollbars=yes,status=yes')
			}
		} else {
			newWindow2 = window.open('includes/privacystatement.asp','privacystatement', 'width=650,height=680,resizable=0,scrollbars=yes,status=yes')
		}
	}	
	
		function showTermsAndConditions() {
	var newwindow
		if (typeof(newWindow2) == 'object') {
			if (!newWindow2.closed) {
				newWindow2.close();
				newWindow2 = window.open('includes/termsandconditions.asp','termsandconditions', 'width=650,height=680,resizable=0,scrollbars=yes,status=yes')
			} else {
				newWindow2 = window.open('includes/termsandconditions.asp','termsandconditions', 'width=650,height=680,resizable=0,scrollbars=yes,status=yes')
			}
		} else {
			newWindow2 = window.open('includes/termsandconditions.asp','termsandconditions', 'width=650,height=680,resizable=0,scrollbars=yes,status=yes')
		}
	}

	function formOK(strErrorMessage) {
		if (strErrorMessage.length > 0 ) {
			bFormHasBeenSubmitted = false
			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+$/;
	 	if (! strEmail.match(emailFormat)) {
			return false;
		} else {
			return true;
		}
	}
	
	function SubmitIt(action) {
		document.forms[0].action = action;
		document.forms[0].submit();
		return false;
	}


	
	function checkForm() {
		

		var theform = document.register
		var strErrorMessage = ""
		var strCheckJunkEmail = ""
		var selectListOK = false
		var today = new Date();
		//var biSelectedCountry
		var iSelectedType;
		var iSelectedHear;
		//var iSelectedPIQ;

		
		var iSelectedTitle;
		var iSelectedCountry;		
		// name information
		selectListOK = false
		for (i=0; i<theform.title.length; i++) {
			if (theform.title.options[i].selected) {
			iSelectedTitle = theform.title.options[i].value }
		}
		if (iSelectedTitle == "") {
			strErrorMessage = strErrorMessage + "\n * Title was not selected"
		}

		if (theform.firstname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * First Name was not entered"
			theform.firstname.focus();
		}
		if (theform.lastname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Surname was not entered"
			theform.lastname.focus();
		}
		if (theform.jobtitle.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Your Job Title was not entered"
			theform.jobtitle.focus();
		}

		for (i=0; i<theform.companyType.length; i++) {
			if (theform.companyType.options[i].selected) {
			iSelectedType = theform.companyType.options[i].value }
		}
		if (iSelectedType == "") {
			strErrorMessage = strErrorMessage + "\n * Company Type was not selected"
		}
		//alert(iSelectedType)
		if ((iSelectedType == "Other (Specify)") && (theform.companyTypeOther.value.length==0)) {
			strErrorMessage = strErrorMessage + "\n * you didn't specify other company type"
		}
		
/*
		if (theform.companyType.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Company Type was not entered"
			theform.companyType.focus();
		}
*/
		if (theform.telephone.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Telephone number was not entered"
		}
		//alert(theform.email1.value.indexOf("yahoo.com"))
		
/*		strCheckJunkEmail = theform.email1.value.toLowerCase(); 
		//alert(strCheckJunkEmail)
		var junky = new Array(28)
		junky[0] = "@yahoo";
		junky[1] = "@hotmail";
		junky[2] = "@msn";
		junky[3] = "@free";
		junky[4] = "@euromoney";
		junky[5] = "@asiamoney";
		junky[6] = "@institutionalinvestor";
		junky[7] = "@opi";
		junky[8] = "@gmail";
		junky[9] = "@fastmail";
		junky[10] = "@earthlink";
		junky[11] = "@googlemail";
		junky[12] = "@aol";
		junky[13] = "@noos";
		junky[14] = "@1webmail";
		junky[15] = "@teleflip";
		junky[16] = "@doramail";
		junky[17] = "@kittymail.com";
		junky[18] = "@btinternet.com";
		junky[19] = "@sympatico.ca";
		junky[20] = "@optonline.net";
		junky[21] = "@tiscali";
		junky[22] = "@ft.com";
		junky[23] = "@doramail.com";
		junky[24] = "@iinews.com";
		junky[25] = "@ekit.com";
		junky[26] = "@bellsouth.net";
		junky[27] = "@bluebottle.com";

		
		
		
		
		

		
		
		
		for (i=0; i<28; i++) {
 
		
			if ( strCheckJunkEmail.indexOf(junky[i]) >= 0) {
			strErrorMessage = strErrorMessage + "\n * An acceptable email address was not entered: \n we do not accept submissions from accounts such as yahoo/gmail/hotmail etc" 
			theform.email1.focus();

			}
		}
*/			


	if (!isEmail(theform.email1.value)) {
			strErrorMessage = strErrorMessage + "\n * A valid email address was not entered" 
			theform.email1.focus();
		}
		else {
			if (theform.email1.value != theform.email2.value) {
			strErrorMessage = strErrorMessage + "\n * Email address in both fields shoud be identical"
			theform.email2.focus();

			}
		
		}

	
		if (theform.companyname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Company Name was not entered"
			theform.companyname.focus();
		}
		
		if (theform.areaofresponsibility.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Area of responsibility name was not entered"
			theform.areaofresponsibility.focus();
		}


selectListOK = false

		if (theform.Address1.value.length == 0) {
			strErrorMessage = strErrorMessage +  "\n * Address1 was not entered" 
			theform.Address1.focus();
		}

		if (theform.city.value.length == 0) {
			strErrorMessage = strErrorMessage +  "\n * City was not entered" 
			theform.city.focus();
		}
		if (theform.postcode.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Postcode was not entered"
			theform.postcode.focus();
		}
		for (i=0; i<theform.country.length; i++) {
			if (theform.country.options[i].selected) {
			iSelectedCountry = theform.country.options[i].value }
		}
		if (iSelectedCountry == 0) {
			strErrorMessage = strErrorMessage + "\n * Country was not selected"
		}
		for (i=1; i<theform.state.length; i++) {
			if (theform.state.options[i].selected) { selectListOK = true }
		}
		if (selectListOK && iSelectedCountry!=115 && iSelectedCountry!=10 && iSelectedCountry!=29 && iSelectedCountry!=103 && iSelectedCountry!=2 && iSelectedCountry!=147 && iSelectedCountry!=146 && iSelectedCountry!=148 ) {
			strErrorMessage = strErrorMessage +  "\n * A US state can only be selected for the United States" 
		}
		
		for (i=0; i<theform.Hear.length; i++) {
			if (theform.Hear.options[i].selected) {
			iSelectedHear = theform.Hear.options[i].value }
		}
		if (iSelectedHear == "") {
			strErrorMessage = strErrorMessage + "\n * Where did you hear option was not selected"
		}
		
		if ((iSelectedHear == "Other (Specify)") && (theform.HearOther.value.length==0)) {
			strErrorMessage = strErrorMessage + "\n * you didn't specify other where did you hear option"
		}
	
		
		/*for (i=0; i<theform.PIQ.length; i++) {
			if (theform.PIQ.options[i].selected) {
			iSelectedPIQ = theform.PIQ.options[i].value }
		}
		if (iSelectedPIQ == "") {
			strErrorMessage = strErrorMessage + "\n * Plesae answer audit question."
		}*/
		
		if (theform.PIQ.value.length < 2) {
			strErrorMessage = strErrorMessage + "\n * Plesae answer audit question"
			theform.PIQ.focus();
		}


	if (!theform.ccCopies.checked) {
		strErrorMessage = strErrorMessage + "\n * You cannot continue without agreeing to receive copies of SCI." 
	}

				


	if (!theform.termsandconditions.checked) {
		strErrorMessage = strErrorMessage + "\n * You cannot continue without agreeing to the terms and conditions." 
	}

		// show the error dialog or submit the form
		return formOK(strErrorMessage)
}







	function checkTrialForm() {
		

		var theform = document.register
		var strErrorMessage = ""
		var strCheckJunkEmail = ""
		var selectListOK = false
		var today = new Date();
		//var biSelectedCountry
		var iSelectedType;
		var iSelectedHear;
		var iCheckedInterest;
		//var iSelectedPIQ;

		
		var iSelectedTitle;
		var iSelectedCountry;		
		// name information
		selectListOK = false
		for (i=0; i<theform.title.length; i++) {
			if (theform.title.options[i].selected) {
			iSelectedTitle = theform.title.options[i].value }
		}
		if (iSelectedTitle == "") {
			strErrorMessage = strErrorMessage + "\n * Title was not selected"
		}

		if (theform.firstname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * First Name was not entered"
			theform.firstname.focus();
		}
		if (theform.lastname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Surname was not entered"
			theform.lastname.focus();
		}
		if (theform.jobtitle.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Your Job Title was not entered"
			theform.jobtitle.focus();
		}

		for (i=0; i<theform.companyType.length; i++) {
			if (theform.companyType.options[i].selected) {
			iSelectedType = theform.companyType.options[i].value }
		}
		if (iSelectedType == "") {
			strErrorMessage = strErrorMessage + "\n * Company Type was not selected"
		}
		//alert(iSelectedType)
		if ((iSelectedType == "Other (Specify)") && (theform.companyTypeOther.value.length==0)) {
			strErrorMessage = strErrorMessage + "\n * you didn't specify other company type"
		}
		
/*
		if (theform.companyType.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Company Type was not entered"
			theform.companyType.focus();
		}
*/
		if (theform.telephone.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Telephone number was not entered"
		}
		//alert(theform.email1.value.indexOf("yahoo.com"))
		
/*		strCheckJunkEmail = theform.email1.value.toLowerCase(); 
		//alert(strCheckJunkEmail)
		var junky = new Array(28)
		junky[0] = "@yahoo";
		junky[1] = "@hotmail";
		junky[2] = "@msn";
		junky[3] = "@free";
		junky[4] = "@euromoney";
		junky[5] = "@asiamoney";
		junky[6] = "@institutionalinvestor";
		junky[7] = "@opi";
		junky[8] = "@gmail";
		junky[9] = "@fastmail";
		junky[10] = "@earthlink";
		junky[11] = "@googlemail";
		junky[12] = "@aol";
		junky[13] = "@noos";
		junky[14] = "@1webmail";
		junky[15] = "@teleflip";
		junky[16] = "@doramail";
		junky[17] = "@kittymail.com";
		junky[18] = "@btinternet.com";
		junky[19] = "@sympatico.ca";
		junky[20] = "@optonline.net";
		junky[21] = "@tiscali";
		junky[22] = "@ft.com";
		junky[23] = "@doramail.com";
		junky[24] = "@iinews.com";
		junky[25] = "@ekit.com";
		junky[26] = "@bellsouth.net";
		junky[27] = "@bluebottle.com";

		
		
		
		
		

		
		
		
		for (i=0; i<28; i++) {
 
		
			if ( strCheckJunkEmail.indexOf(junky[i]) >= 0) {
			strErrorMessage = strErrorMessage + "\n * An acceptable email address was not entered: \n we do not accept submissions from accounts such as yahoo/gmail/hotmail etc" 
			theform.email1.focus();

			}
		}
*/			

/*
	if (!isEmail(theform.email1.value)) {
			strErrorMessage = strErrorMessage + "\n * A valid email address was not entered" 
			theform.email1.focus();
		}
		else {
			if (theform.email1.value != theform.email2.value) {
			strErrorMessage = strErrorMessage + "\n * Email address in both fields shoud be identical"
			theform.email2.focus();

			}
		
		}
*/
	
		if (theform.companyname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Company Name was not entered"
			theform.companyname.focus();
		}
		
		if (theform.areaofresponsibility.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Area of responsibility name was not entered"
			theform.areaofresponsibility.focus();
		}


selectListOK = false

		if (theform.Address1.value.length == 0) {
			strErrorMessage = strErrorMessage +  "\n * Address1 was not entered" 
			theform.Address1.focus();
		}

		if (theform.city.value.length == 0) {
			strErrorMessage = strErrorMessage +  "\n * City was not entered" 
			theform.city.focus();
		}
		if (theform.postcode.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Postcode was not entered"
			theform.postcode.focus();
		}
		for (i=0; i<theform.country.length; i++) {
			if (theform.country.options[i].selected) {
			iSelectedCountry = theform.country.options[i].value }
		}
		if (iSelectedCountry == 0) {
			strErrorMessage = strErrorMessage + "\n * Country was not selected"
		}
		for (i=1; i<theform.state.length; i++) {
			if (theform.state.options[i].selected) { selectListOK = true }
		}
		if (selectListOK && iSelectedCountry!=115 && iSelectedCountry!=10 && iSelectedCountry!=29 && iSelectedCountry!=103 && iSelectedCountry!=2 && iSelectedCountry!=147 && iSelectedCountry!=146 && iSelectedCountry!=148 ) {
			strErrorMessage = strErrorMessage +  "\n * A US state can only be selected for the United States" 
		}
		
		for (i=0; i<theform.Hear.length; i++) {
			if (theform.Hear.options[i].selected) {
			iSelectedHear = theform.Hear.options[i].value }
		}
		if (iSelectedHear == "") {
			strErrorMessage = strErrorMessage + "\n * Where did you hear option was not selected"
		}
		
		if ((iSelectedHear == "Other (Specify)") && (theform.HearOther.value.length==0)) {
			strErrorMessage = strErrorMessage + "\n * you didn't specify other where did you hear option"
		}
		selectListOK = false
		for (i=0; i<theform.interest.length; i++) {
			if (theform.interest[i].checked) { selectListOK = true;}
 
		}
		if (!selectListOK) {
			strErrorMessage = strErrorMessage + "\n * Please check at least one area of interest box"
		}
		
		/*for (i=0; i<theform.PIQ.length; i++) {
			if (theform.PIQ.options[i].selected) {
			iSelectedPIQ = theform.PIQ.options[i].value }
		}
		if (iSelectedPIQ == "") {
			strErrorMessage = strErrorMessage + "\n * Plesae answer audit question."
		}*/
		
		if (theform.PIQ.value.length < 1) {
			strErrorMessage = strErrorMessage + "\n * Plesae answer audit question"
			theform.PIQ.focus();
		}


	if (!theform.ccCopies.checked) {
		strErrorMessage = strErrorMessage + "\n * You cannot continue without agreeing to receive copies of SCI." 
	}

				


	if (!theform.termsandconditions.checked) {
		strErrorMessage = strErrorMessage + "\n * You cannot continue without agreeing to the terms and conditions." 
	}

		// show the error dialog or submit the form
		return formOK(strErrorMessage)
}











function checkFormMyAccount() {
		

		var theform = document.register
		var strErrorMessage = ""
		var selectListOK = false
		var today = new Date();
		//var biSelectedCountry
		var iSelectedType;
		var iSelectedTitle;
		var iSelectedCountry;	
		var iSelectedHear;
	
		// name information
		selectListOK = false
		for (i=0; i<theform.title.length; i++) {
			if (theform.title.options[i].selected) {
			iSelectedTitle = theform.title.options[i].value }
		}
		if (iSelectedTitle == "") {
			strErrorMessage = strErrorMessage + "\n * Title was not selected"
		}

		if (theform.firstname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * First Name was not entered"
			theform.firstname.focus();
		}
		if (theform.lastname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Surname was not entered"
			theform.lastname.focus();
		}
		if (theform.jobtitle.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Your Job Title was not entered"
			theform.jobtitle.focus();
		}

		for (i=0; i<theform.companyType.length; i++) {
			if (theform.companyType.options[i].selected) {iSelectedCType = theform.companyType.options[i].value }
		}
		if (iSelectedCType == "") {
			strErrorMessage = strErrorMessage + "\n * Company Type was not selected"
		}
		if ((iSelectedCType == "Other (Specify)") && (theform.companyTypeOther.value.length==0)) {
			strErrorMessage = strErrorMessage + "\n * you didn't specify other company type"
		} 
		
		
		
		
		for (i=0; i<theform.Hear.length; i++) {
			if (theform.Hear.options[i].selected) {
			iSelectedHear = theform.Hear.options[i].value }
		}
		if (iSelectedHear == "") {
			strErrorMessage = strErrorMessage + "\n * Where did you here option was not selected"
		}
		if ((iSelectedHear == "other (please list)") && (theform.HearOther.value.length==0)) {
			strErrorMessage = strErrorMessage + "\n * you didn't specify other wher did you hear option"
		}
		


		if (theform.telephone.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Telephone number was not entered"
		}
	

	
		if (theform.companyname.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Company Name was not entered"
			theform.companyname.focus();
		}
		
		if (theform.areaofresponsibility.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Area of responsibility name was not entered"
			theform.areaofresponsibility.focus();
		}

selectListOK = false

		if (theform.Address1.value.length == 0) {
			strErrorMessage = strErrorMessage +  "\n * Address1 was not entered" 
			theform.Address1.focus();
		}

		if (theform.city.value.length == 0) {
			strErrorMessage = strErrorMessage +  "\n * City was not entered" 
			theform.city.focus();
		}
		if (theform.postcode.value.length == 0) {
			strErrorMessage = strErrorMessage + "\n * Postcode was not entered"
			theform.postcode.focus();
		}
		for (i=0; i<theform.country.length; i++) {
			if (theform.country.options[i].selected) {
			iSelectedCountry = theform.country.options[i].value }
		}
		if (iSelectedCountry == 0) {
			strErrorMessage = strErrorMessage + "\n * Country was not selected"
		}
		for (i=1; i<theform.state.length; i++) {
			if (theform.state.options[i].selected) { selectListOK = true }
		}
		if (selectListOK && iSelectedCountry!=115 && iSelectedCountry!=10 && iSelectedCountry!=29 && iSelectedCountry!=103 && iSelectedCountry!=2 && iSelectedCountry!=147 && iSelectedCountry!=146 && iSelectedCountry!=148 ) {
			strErrorMessage = strErrorMessage +  "\n * A US state can only be selected for the United States" 
		}
		
		
		return formOK(strErrorMessage)
}







	
	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=300,resizable=0,scrollbars=no,status=no');
			} else {
				newWindow = window.open('/includes/login/passwordinformer.asp','passwordinformer', 'width=360,height=300,resizable=0,scrollbars=no,status=no');
			}
		} else {
			newWindow = window.open('/includes/login/passwordinformer.asp','passwordinformer', 'width=360,height=300,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 showSecurityCode() {
	var newWindow3
	if (typeof(newWindow3) == 'object') {
		if (!newWindow2.closed) {
			newWindow3.close();
			newWindow3 = window.open('/includes/shoppingcart/securitycodehelp.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
		} else {
			newWindow3 = window.open('/includes/shoppingcart/securitycodehelp.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
		}
	} else {
		newWindow3 = window.open('/includes/shoppingcart/securitycodehelp.htm','termsandconditions', 'width=400,height=450,resizable=0,scrollbars=no,status=yes')
	}
}



function DropMenu(i)
{

var w=13;

if(navigator.appVersion.indexOf('MSIE 8.01')==-1){w=0};

var widthOffset =findPosX(document.getElementById('DropMenu' + i))
var heightOffset = findPosY(document.getElementById('DropMenu' + i)) + w
if(navigator.appVersion.indexOf('MSIE 4.01')!=-1)
		
			{
			
		//eval("document.all.DropList" + i + ".style.top = 100")
		//eval("document.all.DropList" + i + ".style.left = document.all.DropMenu" + i + ".offsetLeft + 0")
		eval("document.all.DropList" + i + ".style.top = widthOffset")
		eval("document.all.DropList" + i + ".style.left = heightOffset")

		eval("document.all.DropList" + i + ".style.visibility = 'Visible'")
	}
	else
	{
		
		//alert(findPosX(document.getElementById('DropMenu1'))

	//alert(heightOffset);
	//alert(document.getElementById('DropMenu1').clientWidth)
		eval("document.getElementById('DropList" + i + "').style.top =  heightOffset")
		eval("document.getElementById('DropList" + i + "').style.left = widthOffset")
		eval("document.getElementById('DropList" + i + "').style.visibility = 'Visible'")
	}
return true
}

function HideMenu(y)
{
if(navigator.appVersion.indexOf('MSIE 4')!=-1)
	{
		eval("document.all.DropList" + y + ".style.visibility = 'hidden'")
	}
	else
	{
		eval("document.getElementById('DropList" + y + "').style.visibility = 'hidden'")
	}
return true
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}


