//--  VALIDATING PRODUCTS INFO --->

function ValidateProd() {
		
if (document.purchase.Pepid_Device.value == "") {
	window.alert("Please tell us where you want to use Wave Medical product.");
	return false;
}


if (document.purchase.Product.value == "") {
	window.alert("Please select a Wave Medical product.");
	return false;
}
if (document.purchase.Pepid_Device.value == "PDA") {
	if (document.purchase.Platform2.value == "") {
		window.alert("Please tell us how you will install Wave Medical to your PDA.");
		return false;
		}
	else
	{	
			if (document.purchase.Platform2.value == "BLACKBERRY") 
			{
				document.purchase.Pepid_Device.value == "BLACKBERRY"
	//			return true;
			}
		
	}
//	return true;
}

if (document.purchase.Quantity.value == "0") {
	window.alert("Quantity can not be 0.");
	return false;
}

 return true;
}

function updatedevice()
{
var WMEM_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMPP_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMUU_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMQQ_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMDP_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMMP_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMID_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMCR_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMRN_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMNN_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMSN_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');
var WMLP_Platform = new Array('Microsoft Windows Mobile','BlackBerry','iPhone','Symbian (Nokia, Sony Ericcson)','Mobile Browser','PC Browser');

var WMEM_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMPP_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMUU_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMQQ_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMDP_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMMP_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMID_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMCR_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMRN_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMNN_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMSN_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');
var WMLP_Platform_V = new Array('PDA','BLACKBERRY','iPhone','SYM','MOBILE','ONLINE');


with (document.purchase.Product)
	{
		var choice = value;
		var choicep = choice;
	}
	document.purchase.Pepid_Device.length = 0;
		if (choice == "#") 
		{ return; } 
		else {
		 var choicev = eval(choice + "_Platform_V");
		choice = eval(choice + "_Platform");
		 }
		for (var i=0;i<choice.length;i++)
		{
		  with (document.purchase.Pepid_Device)
		  {
		       options[length] = new Option(choice[i],choicev[i],false,false);
		  }
		}
		
}


function ValidateNew() {


if (document.purchase.email.value == "") {
	window.alert("Please enter an e-mail address.");
	return false;
}
	
if (document.purchase.email.value.indexOf('@', 0) == -1 || document.purchase.email.value.indexOf('.', 0) == -1 || document.purchase.email.value.indexOf(' ', 1) > 0) { 
   window.alert("Please enter a valid e-mail address."); 
   return false;
}

if (document.purchase.Product.value == "0") {
	window.alert("Please select a Product.");
	return false;
}
if (document.purchase.Pepid_Device.value == "") {
	window.alert("Please tell us where you want to use Wave Medical product.");
	return false;
}


	return true;
}

function ValidateNew() {
		
if (document.purchase.email.value == "") {
	window.alert("Please enter an e-mail address.");
	return false;
}
	
if (document.purchase.email.value.indexOf('@', 0) == -1 || document.purchase.email.value.indexOf('.', 0) == -1 || document.purchase.email.value.indexOf(' ', 1) > 0) { 
   window.alert("Please enter a valid e-mail address."); 
   return false;
}


if (document.purchase.first_name.value.replace(/^\s*/,'').length < 1) {
	window.alert("Please enter your first name.");
	return false;
}

if (document.purchase.last_name.value.replace(/^\s*/,'').length < 1) {
	window.alert("Please enter your last name.");
	return false;
}

if (document.purchase.zip.value.length < 1 ) {
	window.alert("Please enter a valid zip code.");
	return false;
}
if (document.purchase.password.value == "") {
	window.alert("Please choose your password.");
	return false;
}
	
if (document.purchase.password.value.indexOf(' ', 1) > 0) {
	window.alert("No spaces allowed in password.");
	return false;
}

if (document.purchase.password.value.length < 6) {
	window.alert("Password must have 6-10 characters.");
	return false;
}

if (document.purchase.password1.value == "") {
	window.alert("Please re-type your password.");
	return false;
}
	
if (document.purchase.password.value != document.purchase.password1.value) {
	window.alert("The passwords you entered do not match. Please re-type your password.");
	return false;
}	
	

if (document.purchase.company.value == "") {
	window.alert("Please enter your Institution.");
	return false;
}

if (document.purchase.Product.value == "0") {
	window.alert("Please select a Product.");
	return false;
}
if (document.purchase.Pepid_Device.value == "") {
	window.alert("Please tell us where you want to use Wave Medical product.");
	return false;
}


	return true;
}


function csc()
		{
	//	var sUrl = "notes.asp?Cust_ID=" + Cust_ID;
		var sUrl = "csc.asp"
		MM_openBrWindow (sUrl,"SecurityCardInfo","width=650,height=455,resizable=0,scrollbars=1");
		}
		
		


