function openWindow(url,nam,w,h,r,s) {    var options = "width=" + w + ",height=" + h + ",";    options += "resizable=yes,scrollbars=yes,status=no,";    options += "menubar=no,toolbar=no,location=no,directories=no";    var newWin = window.open(url,nam,options);}function imageViewer(url,nam,w, h) {    var options = "width=" + w + ",height=" + h + ",";    options += "resizable=no,scrollbars=no,status=no,";    options += "menubar=no,toolbar=no,location=no,directories=no";    var newWin = window.open(url,nam,options);}  function are_you_sure(url,msg){	if (confirm(msg)){		document.location = url;	}	else {		alert("No action was taken");	}}function checkFormFriend(f){	if (f.name.value == ""){		alert("Please enter your Friends Name");		return false;	}	if (f.email.value == ""){		alert("Please enter your Friends Email address");		return false;	}	return true;}function checkFormForgot(f){	if (f.email.value == ""){		alert("Please input your Email before continuing");		return false;	}	return true;}// FORM VALIDATION ROUTINESfunction isLetter (c) {   	return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) );}function isDigit (c) {   	return ((c >= "0") && (c <= "9"));}function isLetterOrDigit (c) {   	return (isLetter(c) || isDigit(c));}function isAlphanumeric (s) {   	var i;    for (i = 0; i < s.length; i++){           var c = s.charAt(i);        if (! (isLetter(c) || isDigit(c) ) ) {        	return false;    	}	}    return true;}function isInteger(s) {    for (i = 0; i < s.length; i++) {           var c = s.charAt(i);        if (!isDigit(c)) return false;    }    return true;}function isEmail(str) {	var at="@"	var dot="."	var lat=str.indexOf(at)	var lstr=str.length	var ldot=str.indexOf(dot)	if (str.indexOf(at)==-1){	   return false	}	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){	   return false	}	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){	    return false	}	if (str.indexOf(at,(lat+1))!=-1){	   return false	}	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){	   return false	}	if (str.indexOf(dot,(lat+2))==-1){	   return false	}	if (str.indexOf(" ")!=-1){	   return false	}	return true					}function checkPlans(f){	if (f.plan_name.value.length < 2){		alert("Please enter a name for the commerce plan");		return false;	}	if (f.applies_to.selectedIndex == 0){		alert("Please select the applies to for the commerce plan");		return false;	}	if (f.number_of_users.selectedIndex == 0 && f.applies_to.value == 'company'){		alert("Please select the number of resellers for the commerce plan");		return false;	}	if (f.duration1.selectedIndex == 0){		alert("Please select a time period for the commerce plan");		return false;	}	if (f.duration2.selectedIndex == 0){		alert("Please select a time period for the commerce plan");		return false;	}	if (f.number_of_listings.selectedIndex == 0){		alert("Please select the number of listings for the commerce plan");		return false;	}	if (f.plan_price.value == ""){		alert("Please enter a price for the commerce plan");		return false;	}	if (f.removal[0].checked == false && f.removal[1].checked == false){		alert("Please select an expiration option for the commerce plan");		return false;	}	return true;}function checkOrder1 (f){	var ct = f.plan_id.length	var checked = false;	for(i=0;i<ct;i++){		if (f.plan_id[i].checked == true){			checked = true;			break;		}	}	if (checked == false){		alert("Please select a commerce plan before continuing");		return false;	}	return checked;}function checkLogin (f){	if (f.username.value.length < 8){		alert ("Your username appears to be invalid, it should be at least 8 characters long");		return false;	}	if (f.password.value.length < 8){		alert ("Your password appears to be invalid, it should be at least 8 characters long");		return false;	}	if (f.login_as.selectedIndex == 0){		alert ("Please select which user mode you will be logging in as");		return false;	}	return true;}function checkForgotPasswordForm(f){	if (!isEmail(f.email.value)){		alert("Please enter a valid email address");		return false;	}	if (f.login_as.selectedIndex == 0){		alert("Please select your login type");		return false;	}	return true;}function checkEmailListingForm(f){	if (f.your_name.value.length < 2){		alert("Please enter your first name");		return false;	}	if (f.friends_name.value.length < 2){		alert("Please enter your friends first name");		return false;	}	if (!isEmail(f.friends_email.value)){		alert("Please enter a valid email address");		return false;	}	return true;}function checkNotifyPriceForm(f){	if (f.first_name.value.length < 2){		alert("Please enter your first name");		return false;	}	if (f.last_name.value.length < 2){		alert("Please enter your last name");		return false;	}	if (!isEmail(f.email.value)){		alert("Please enter a valid email address");		return false;	}	return true;}function checkSelect(f){	if (f.selectedIndex == 0){		alert("Please make a selection before continuing");		return false;	}	else {		return true;	}}function previewLink(){	alert("This link is deactivated for preview mode");}function checkAuthorizeForm(f){	var tag = "";	if (f.x_First_Name.value == ""){		tag += "Missing First Name\n";	}	if (f.x_Last_Name.value == ""){		tag += "Missing Last Name\n";	}	if (f.x_Address.value == ""){		tag += "Missing Address\n";	}	if (f.x_City.value == ""){		tag += "Missing City\n";	}	if (f.x_State.selectedIndex == 0){		tag += "Missing State\n";	}	if (f.x_Zip.value == ""){		tag += "Missing Zip Code\n";	}	if (f.x_Country.selectedIndex == 0){		tag += "Missing Country\n";	}	if (f.x_Phone.value == ""){		tag += "Missing Phone\n";	}	if (!isEmail(f.x_Email.value)){		tag += "Invalid Email address\n";	}	if (f.x_Card_Num){		if (f.x_Card_Num.value == ""){			tag += "Missing Credit Card Number\n";		}	}	if (f.x_Exp_Date){		if (f.x_Exp_Date.value == ""){			tag += "Missing Expiration Date\n";		}	}	if (tag){		alert(tag)		return false	}	else {		return true	}}function changeTarget(f){	f.target = '_blank';}function checkEflyerForm(f){	var check = false;	if (f.to_name.value.length < 4){		alert("Please enter their name\n");		return false;	}	if (!isEmail(f.to_email.value)){		alert("Please enter a valid email address");		return false;	}	if (f.from_name.value.length < 4){		alert("Please enter their name\n");		return false;	}	if (!isEmail(f.reply_to.value)){		alert("Please enter a valid email address");		return false;	}	var cnt = f.elements['listing[]'].length;	if (cnt == undefined) {		if (f.elements['listing[]'].checked == true){			check = true;		}	}	else {		for(i=0;i<cnt;i++){			if (f.elements['listing[]'][i].checked == true){				check = true;				break;			}		}	}	if (check == true){		return true;	}	else {		alert("Please select at least one listing");		return false;	}	return true;}function checkLassieOrderForm(f){	if (f.name.value.length < 2){		alert("Please enter your name");		return false;	}	if (f.address.value.length < 2){		alert("Please enter your address");		return false;	}	if (f.city.value.length < 2){		alert("Please enter your city");		return false;	}	if (f.state.value.length < 2){		alert("Please enter your state");		return false;	}	if (f.zip.value.length < 5){		alert("Please enter your zip");		return false;	}	if (f.phone.value.length < 10){		alert("Please enter your phone");		return false;	}	if (f.number.value < 0){		alert("Please enter the number of licenses");		return false;	}	if (f.total.value < 99){		alert("Please enter the total amount");		return false;	}	if (!isEmail(f.email.value)){		alert("Please enter a valid email address");		return false;	}	if (f.agree.checked == false){		alert("You must agree to the License Agreement before placing your order");		return false;	}	return true;}