var email_service="service" + "@" + "strangefortune" + "." + "com";
var email_domain="strangefortune";
var email_extension="com";
function email_link(email_user) {
	var email_link = email_user + "&#64;" + email_domain + "." + email_extension;
	location.href = "mailto:" + email_link;
}
function email_display(email_user) {
	var email_display = email_user + "&#64;" + email_domain + "." + email_extension;
	document.write(email_display);
}

function addtocart(cd_id) {
	document.formcatalog.cd_id.value=cd_id;
	document.formcatalog.submit();
}
function notifystock() { document.formnotify.submit(); }
function postreview() { document.formpost.submit(); }

function currencywindow() {
	CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=150,width=575')
	CurrencyWindow.focus()
	CurrencyWindow.location.href = 'http://www.xe.com/pca/input.cgi?AmountSet=1&FromSelect=USD&ToSelect=EUR'
}

function formaddress_validate() {
	var namestring=document.formaddress.address_name.value;
	var line1string=document.formaddress.address_line1.value;
	var zipstring=document.formaddress.address_zip.value;

	if (namestring=="" || line1string=="" || zipstring=="")
		alert ("Please complete the required fields.");
	else
		document.formaddress.submit();
}

function formaccount_validate() {
	var namestring = document.formaccount.account_name.value;
	var emailstring = document.formaccount.email_address.value;
	var usernamestring = document.formaccount.account_username.value;
	var passwordstring = document.formaccount.account_password.value;

	if (namestring=="" || emailstring=="" || usernamestring=="" || passwordstring=="")
		alert ("Please complete the required fields.");
	else if (emailstring.indexOf("@") <= 0)
		alert ("Please enter a valid email address.");
	else if (usernamestring.length < 3)
		alert ("Please choose a user name at least three characters long.");
	else if (passwordstring.length < 3)
		alert ("Please choose a password at least three characters long.");
	else
		document.formaccount.submit();
}

function cart_minimumorder() {
	if (document.formorder.wholesalevar.value != 0 && document.formorder.totalpricevar.value < 75)
		alert ("The minimum wholesale order is $75. Please add to the list.");
	else
		document.formorder.submit();
}

function validateorder2(payment_method) {
	if (payment_method=="credit") {
		// Validate credit card order
	
		// Get radio button values: a mess in javascript
	
		// Check for missing credit card info
		if (document.formorder2.cc_number.value=='' || document.formorder2.cnp_security.value=='' || document.formorder2.billing_phone.value=='')
			alert ('Please enter all your credit card information.');
	
		// Check credit card expiration date
		
		// Check for incomplete new billing address
	
		// Check for incomplete new shipping address
	
		else
			document.formorder2.submit();
		
	} else {
		// Validate Paypal check or money order
	
		// Get radio button values: a mess in javascript
	
		// Check for incomplete new shipping address
	
		if (0)
			alert ('Please complete the required fields.');
	
		else
			document.formorder2.submit();
		}
}

function validatepost() {
	if (document.formreview.review_name.value=="" || document.formreview.review_text.value=="")
		alert ("Please complete the required fields.");
	else
		document.formreview.submit();
}
