
	function showPadlockPopup() {
		newWindow = window.open('/includes/Magazine/padlock_popup.asp', 'padlock','width=200,height=150,resizable=0,scrollbars=no,status=no');
		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 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 complete the listed missing information and resubmit the form.");
			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('/security/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('/security/login/'+page,'passwordreminder', 'width=350,height=200,resizable=0,scrollbars=no,status=no');
			} else {
				newWindow = window.open('/security/login/'+page,'passwordreminder', 'width=350,height=200,resizable=0,scrollbars=no,status=no');
			}
		} else {
			newWindow = window.open('/security/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('/security/login/passwordreminder.asp','passwordreminder', 'width=320,height=170,resizable=0,scrollbars=no,status=no');
			} else {
				newWindow = window.open('/security/login/passwordreminder.asp','passwordreminder', 'width=320,height=170,resizable=0,scrollbars=no,status=no');
			}
		} else {
			newWindow = window.open('/security/login/passwordreminder.asp','passwordreminder', 'width=320,height=170,resizable=0,scrollbars=no,status=no');
		}
		return false;
	}
	
	function showTermsAndConditions_New(todo,description,pubid) {
		var newwindow
		if (typeof(newWindow2) == 'object') {
			if (!newWindow2.closed) {
				newWindow2.close();
				newWindow2 = window.open('shared/includes/termsandprivacy.asp?todo=' + todo + '&pubid=' + pubid,description, 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
			} else {
				newWindow2 = window.open('shared/includes/termsandprivacy.asp?todo=' + todo + '&pubid=' + pubid ,description, 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
			}
		} else {
			newWindow2 = window.open('shared/includes/termsandprivacy.asp?todo=' + todo + '&pubid=' + pubid,description, 'width=600,height=450,resizable=0,scrollbars=yes,status=yes')
		}
	}
