/*
Copyright 2004, Active Media Architects - www.activema.com
Usage of these scripts is limited to their original intent as developed and deployed for via-it.com by Active Media Architects. Copying, selling or distributing of these scripts, in whole or in part, is strictly prohibited.
*/

	///////////////////////////////////////
	// On-Click-Pop-Center
	///////////////////////////////////////
	// Requires "onClick="NewWindow(this.href,'title','400','300','no');return false;"" in the A HREF tag
	// Example: <a href="doc.html" onClick="NewWindow(this.href,'title','400','300','no');return false;">LINK</a>

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=yes'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}




	///////////////////////////////////////
	// Auto-Select Field
	///////////////////////////////////////
	// Requires "onLoad=ready()" in the BODY tag
	// Example: <body onLoad=ready()>
	// Requires form name to match where it reads "form" in script
	// Example: <form name="form">
	// Requires form field name to match where it reads "field" in script
	// Example: <input name="field">

function ready(){document.form.field.focus();}


	///////////////////////////////////////
	// Form Validation
	///////////////////////////////////////


function validateSubUnsub(form) {
	return (
				 checkSelect(form.elements["email"],"V","","Please enter Your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply valid E-mail Address.",false));
}

function validateEmailme(form) {
	return (
				 checkSelect(form.elements["recipient"],"V","","Please enter the Recipient's Name.",false) &&
				 checkSelect(form.elements["to"],"V","","Please enter the Recipient's E-mail.",false) &&
				 checkEmail(form.elements["to"],false) &&
				 checkSelect(form.elements["to"],"V","joe@example.com","Please supply valid E-mail Address.",false) &&
				 checkSelect(form.elements["comments"],"V","","Please enter the Message to Recipient.",false) &&
				 checkSelect(form.elements["sender"],"V","","Please enter Your Name.",false) &&
				 checkSelect(form.elements["from"],"V","","Please enter Your E-mail.",false) &&
				 checkEmail(form.elements["from"],false) &&
				 checkSelect(form.elements["from"],"V","joe@example.com","Please supply valid E-mail Address.",false));
}

function validateQuote(form) {
	return (
				 checkSelect(form.elements["companyname"],"V","","Please enter your Company Name.",false) &&
				 checkSelect(form.elements["companyname"],"V","Company Name","Please enter a valid Company Name. If you are an individual, please enter Individual for the Company Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkUSPhone(form.elements["phone"],false) &&
				 checkSelect(form.elements["interest"],"V","","Please select your Primary Interest.",false) &&
				 checkSelect(form.elements["project"],"V","","Please provide a Project Description.",false));
}

function validateMerchant(form) {
	return (
				 checkSelect(form.elements["business"],"V","","Please enter your Business Name.",false) &&
				 checkSelect(form.elements["business"],"V","Business Name","Please enter a valid Business Name. If you are an individual, please enter Individual for the Business Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkUSPhone(form.elements["phone"],false) &&
				 checkSelect(form.elements["address"],"V","","Please enter your Business Address.",false) &&
				 checkSelect(form.elements["city"],"V","","Please enter your City.",false) &&
				 checkSelect(form.elements["state"],"V","","Please select your State.",false) &&
				 checkSelect(form.elements["zip"],"V","","Please enter your Zip Code.",false));
}

function validateRealtorSetup(form) {
	return (
				 checkSelect(form.elements["pkg"],"V","","Please select a Site Reign Realtor Package.",false) &&
				 checkSelect(form.elements["agency"],"V","","Please enter the name of your Agency. If you are independent, please enter the word Independent.",false) &&
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkUSPhone(form.elements["phone"],false) &&
				 checkSelect(form.elements["address"],"V","","Please enter your Street Address.",false) &&
				 checkSelect(form.elements["city"],"V","","Please enter your City.",false) &&
				 checkSelect(form.elements["state"],"V","","Please select your State.",false) &&
				 checkSelect(form.elements["zip"],"V","","Please enter your Zip Code.",false));
}

function validateRealtorSetupCustom(form) {
	return (
				 checkSelect(form.elements["emailAccts"],"V","","Please tell us how many E-mail Accounts you need.",false) &&
				 checkSelect(form.elements["logins"],"V","","Please tell us how many Logins you need for managing your site.",false) &&
				 checkSelect(form.elements["listings"],"V","","Please tell us how many Listings you will have.",false) &&
				 checkSelect(form.elements["photos"],"V","","Please tell us how many Photos you want to have for each listings.",false) &&
				 checkSelect(form.elements["homepage"],"V","","Please tell us how many listings you want to be able to feature on your Home Page.",false) &&
				 checkSelect(form.elements["custMngr"],"V","","Please tell us if you require the Customer Manager.",false) &&
				 checkSelect(form.elements["contMngr"],"V","","Please tell us if you require the Content Manager.",false) &&
				 checkSelect(form.elements["emailAgent"],"V","","Please tell us if you require the E-mail Agent.",false) &&
				 checkSelect(form.elements["agency"],"V","","Please enter the name of your Agency. If you are independent, please enter the word Independent.",false) &&
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkUSPhone(form.elements["phone"],false) &&
				 checkSelect(form.elements["address"],"V","","Please enter your Street Address.",false) &&
				 checkSelect(form.elements["city"],"V","","Please enter your City.",false) &&
				 checkSelect(form.elements["state"],"V","","Please select your State.",false) &&
				 checkSelect(form.elements["zip"],"V","","Please enter your Zip Code.",false));
}

function validateComment(form) {
	return (
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkSelect(form.elements["questions"],"V","","Please provide some information in the Questions/Comments field. No sense in submitting this form without anything here.",false));
}

function validateDemo(form) {
	return (
				 checkSelect(form.elements["company"],"V","","Please enter your Company or Agency name. If you are not representing a company, please enter Independent in the field.",false) &&
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkUSPhone(form.elements["phone"],false) &&
				 checkSelect(form.elements["interest"],"V","","Please select the Site Reign product in which you are interested.",false));
}

function validatePress(form) {
	return (
				 checkSelect(form.elements["companyname"],"V","","Please enter your Company Name.",false) &&
				 checkSelect(form.elements["companyname"],"V","Company Name","Please enter a valid Company Name. If you are an independent news source, please enter Independent for the Company Name.",false) &&
				 checkSelect(form.elements["mediatype"],"V","","Please select the Media Type that best matches your company's primary media focus.",false) &&
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkUSPhone(form.elements["phone"],false) &&
				 checkSelect(form.elements["questions"],"V","","Please provide some information in the Questions/Request field. No sense in submitting this form without anything here.",false));
}

function validateReference(form) {
	return (
				 checkSelect(form.elements["companyname"],"V","","Please enter your Company Name.",false) &&
				 checkSelect(form.elements["companyname"],"V","Company Name","Please enter a valid Company Name. If you are an individual, please enter Individual for the Company Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","","Please enter your First Name.",false) &&
				 checkSelect(form.elements["firstname"],"V","First Name","Please enter your real First Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","","Please enter your Last Name.",false) &&
				 checkSelect(form.elements["lastname"],"V","First Name","Please enter your real Last Name.",false) &&
				 checkSelect(form.elements["email"],"V","","Please enter your E-mail.",false) &&
				 checkEmail(form.elements["email"],false) &&
				 checkSelect(form.elements["email"],"V","joe@example.com","Please supply a valid E-mail Address.",false) &&
				 checkUSPhone(form.elements["phone"],false) &&
				 checkSelect(form.elements["found"],"V","","Please tell us How You Found Us by selecting an answer from the drop-down menu.",false));
}



function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
function preloadImages() {
	if (document.images) {
		menu_rollover_01_over = newImage("images/button_customerlogin_over.gif");
		menu_rollover_02_over = newImage("images/button_faqs_over.gif");

		menu_rollover_01top_over = newImage("images/buttontop_company_over.gif");
		menu_rollover_02top_over = newImage("images/buttontop_products_over.gif");
		menu_rollover_03top_over = newImage("images/buttontop_support_over.gif");
		menu_rollover_04top_over = newImage("images/buttontop_newsevents_over.gif");
		menu_rollover_05top_over = newImage("images/buttontop_careers_over.gif");
		menu_rollover_06top_over = newImage("images/buttontop_customerlogin_over.gif");
		menu_rollover_07top_over = newImage("images/buttontop_contactus_over.gif");
		menu_rollover_08top_over = newImage("images/buttontop_commentsandsuggestions_over.gif");
		preloadFlag = true;
	}
}
function VerifyData() {

                   var valid = true;
                   if (document.formtest.firstnewname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your first name.");
							return false;
                           }
                   if (document.formtest.lastnewname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your last name.");
							return false;
                           }
                   return valid;
}
function VerifyData2() {

                   var valid = true;
                   if (document.formtest.username.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a username.");
							return false;
                           }
                   if (document.formtest.password.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a password.");
							return false;
                           }
                   return valid;
}
function VerifyData3() {

                   var valid = true;
                   if (document.formtest.authorizationnumber.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a number that will be unique to the customer.");
							return false;
                           }
                   if (document.formtest.firstname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a first name that matches the customer's first name in the contact information table.");
							return false;
                           }
                   if (document.formtest.lastname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a last name that matches the customer's last name in the contact information table.");
							return false;
                           }
                   if (document.formtest.emailaddress.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter an email address that matches the customer's email address in the contact information table.");
							return false;
                           }
                   if (document.formtest.companyname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please select a company name that matches the customer's ID in the contact information table.");
							return false;
                           }
                   return valid;
}
function VerifyData4() {

                   var valid = true;
                   if (document.formtest.authorizationnumber.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a number that will be unique to the customer.");
							return false;
                           }
                   if (document.formtest.firstname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a first name that matches the customer's first name in the contact information table.");
							return false;
                           }
                   if (document.formtest.lastname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a last name that matches the customer's last name in the contact information table.");
							return false;
                           }
                   if (document.formtest.emailaddress.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter an email address that matches the customer's email address in the contact information table.");
							return false;
                           }
                   if (document.formtest.companyname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please select a company name that matches the customer's ID in the contact information table.");
							return false;
                           }
                   return valid;
}
function VerifyData5() {         
	    var valid = true;
	    if (document.formlogin.username.value == "") {
	                    valid = false;
	            }
		 		if (!valid) {
		 			alert("Please enter username.");
		 		return false;
	            }  
	    if (document.formlogin.password.value == "") {
	                    valid = false;
	            }
		 		if (!valid) {
		 			alert("Please enter password.");
		 		return false;
	            }   
	    return valid;
}
function VerifyData6() {

                   var valid = true;
                   if (document.formtest.firstnewname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your first name.");
							return false;
                           }
                   if (document.formtest.lastnewname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your last name.");
							return false;
                           }
                   return valid;
}
function VerifyData7() {

                   var valid = true;
                   if (document.formtest.authorizationnumber.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your authorization number, or call 1-248-208-1700, Option 1 if you do not have one.");
							return false;
                           }
                   if (document.formtest.firstname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your first name.");
							return false;
                           }
                   if (document.formtest.lastname.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your last name.");
							return false;
                           }
                   if (document.formtest.email.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter your email address.");
							return false;
                           }
                   if (document.formtest.username.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a username.");
							return false;
                           }
                   if (document.formtest.password.value == "") {
                                   valid = false;
                           }
							if (!valid) {
								alert("Please enter a password.");
							return false;
                           }
                   return valid;
}