function check_dropshipform_submission () {

	var errorStr = "";
	if (document.contactusForm.name.value.length < 1) {
		errorStr = errorStr + "Please enter your name\n";
	}

	if (document.contactusForm.email.value.length < 1) {
		errorStr = errorStr + "Please enter your email address\n";
	} else if (!document.contactusForm.email.value.match(/^[a-zA-Z0-9.\-\_]+\@{1,1}[a-zA-Z0-9.-]+\.([a-zA-Z0-9.]+)$/)) {
		errorStr = errorStr + "Invalid email address\n";
	} else {
		if (!document.contactusForm.email.value.match(/[a-zA-Z0-9]$/)) {
			errorStr = errorStr + "Invalid email address\n";
		}
	}

	if (document.contactusForm.company.value.length < 1) {
		errorStr = errorStr + "Please enter the name of your company\n";
	}

	if (document.contactusForm.message.value.length < 1) {
		errorStr = errorStr + "Please enter a message\n";
	}

	if (errorStr.length > 0) {
		alert(errorStr);
		return false;
	} else {
		return true;
	}
}

function check_contactform_submission () {

	var errorStr = "";
	if (document.contactusForm.name.value.length < 1) {
		errorStr = errorStr + "Please enter your name\n";
	}

	if (document.contactusForm.email.value.length < 1) {
		errorStr = errorStr + "Please enter your email address\n";
	} else if (!document.contactusForm.email.value.match(/^[a-zA-Z0-9.\-\_]+\@{1,1}[a-zA-Z0-9.-]+\.([a-zA-Z0-9.]+)$/)) {
		errorStr = errorStr + "Invalid email address\n";
	} else {
		if (!document.contactusForm.email.value.match(/[a-zA-Z0-9]$/)) {
			errorStr = errorStr + "Invalid email address\n";
		}
	}

	if (document.contactusForm.enquirytype.value.length < 1) {
		errorStr = errorStr + "Please enter a subject\n";
	}

	if (document.contactusForm.message.value.length < 1) {
		errorStr = errorStr + "Please enter a message\n";
	}

	if (errorStr.length > 0) {
		alert(errorStr);
		return false;
	} else {
		return true;
	}
}


// From /inc/asthetics.php

function mouseOver(mouseObject, newColor) {
	mouseObject.style.background=newColor
}

function mouseOut(mouseObject, newColor) {
	mouseObject.style.background=newColor
}

function loadPage(pageLink) {
	document.location = pageLink;
}


// From /prod_info.php

function openNewWindow(docLocation){
	docWindow = window.open(docLocation, "docWindow", "directories=no,height=470,width=630,hotkeys=no,location=no,menubar=no,personalbar=no,resizable=no,screenX=50,screenY=50,status=no,toolbar=no,scrollbars=yes,top="+((screen.height - 470) / 2)+",left="+((screen.width - 630) / 2));
	docWindow.focus();
}

function openRecommendWindow(){
	docWindow = window.open('', "recommendWindow", "directories=no,height=360,width=350,hotkeys=no,location=no,menubar=no,personalbar=no,resizable=no,screenX=50,screenY=50,status=no,toolbar=no,scrollbars=yes,top="+((screen.height - 360) / 2)+",left="+((screen.width - 350) / 2));
	docWindow.focus();
}

function openVTypeWindow(docLocation){
	docWindow = window.open("/popup.php?page=vtypes#"+docLocation, "docWindow", "directories=no,height=470,width=630,hotkeys=no,location=no,menubar=no,personalbar=no,resizable=no,screenX=50,screenY=50,status=no,toolbar=no,scrollbars=yes,top="+((screen.height - 470) / 2)+",left="+((screen.width - 630) / 2));
	docWindow.focus();
}

function openWhyBuyWindow(docLocation, docAnchor){
	docWindow = window.open("/popup.php?page="+docLocation+"#"+docAnchor, "docWindow", "directories=no,height=470,width=630,hotkeys=no,location=no,menubar=no,personalbar=no,resizable=no,screenX=50,screenY=50,status=no,toolbar=no,scrollbars=yes,top="+((screen.height - 470) / 2)+",left="+((screen.width - 630) / 2));
	docWindow.focus();
}

function show_versions (prod_id) {
	for (i in invisible) {
		document.getElementById("version-"+prod_id+"-"+invisible[i]).style.display = "block";
	}
	document.getElementById("xAndUnderTitle").style.display = "none";
}

