// JavaScript Document



//doesn't matter what page they are, we break out of frames if necessary

if (window != top) {top.location.href = location.href;}



//Control panel popup help
var ht_auth = "NOTE: This should only be ran with approval of webmaster! \
Click here to run the Authorize.net cron job; User-ID is mdmartin and pass is universal password";
var ht_views = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number of 'views' \
reflects the number of times this ad has appeared in search results for the last 6-months.";
var ht_viewsimg = "&nbsp;&nbsp;&nbsp;&nbsp;Number of 'views' \
reflects the number of times your ad has appeared in search results for the last 6-months.";
var ht_myads = "Click here to view your ad(s) published on PlotExchange.com \
and submit ad edits or unsubscribe (cancel) your ad(s).";
var ht_personal = "Click here to view and/or update your personal information or change any personal information.";
var ht_contact = "Click here to view and/or update the information a buyer will use to contact you,\
such as phone numbers and e-mail address, etc.";
var ht_notify = "Click here to edit the text of automated e-mail notifications sent to subscribers and admin.";
var ht_orders = "Click here to view and approve pending free month ads";
var ht_billing = "Click here to view and/or update your credit card number or billing address on file.";
var ht_edits = "Click here to view and approve pending edits of existing ads.";
var ht_members = "Click here to view all current subscribers and access their ad table.";
var ht_searchlog = "Click here to view the search activity on PlotExchange.com.";
var ht_intercept = "Click here to view review Contact Seller inquiries";
var ht_upsell = "Click here to sell a lifetime ad to any subscriber who doesn't have a lifetime ad";
var ht_packages = "Click here to sell any number of ads at any price to non-PlotExchange brokers";
var ht_brokerads = "Click here to view broker pre-paid ads waiting for approval";
var ht_expiring = "Click here to run a procedure which sends expiring ad notifications.";
var ht_renewals = "Click here to view and approve renewal orders for submittal to Authorize.net";
var ht_regadv = "Click here to view regional advertisers in table format. Regional advertisers can also be added and removed from here.";
var ht_natadv = "Click here to view national advertisers in table format. National advertisers can also be added and removed from here.";
var ht_listings = "Click here to view all business listings (includes National and Regional advertisers). New banner-less business listings can also be added and removed from here.";
var ht_unapproved = "Click here to approve or reject new business listings submitted by the general public.";
var ht_adtable = "Click here to view the ad table, pageable and sortable, with links to ad and member CP.";
var ht_optimizedb = "Click here to optimize the database.";
var ht_backupdb = "FOR WEBMASTERS ONLY!! Click here to download a backup of the database's data and structure. User ID is: mdmartin - PASS: current universal Password.";
var ht_unsubscribe = "Click here to cancel your subscription";
var ht_setrate ="Click here to set New Subscription Charge";
var ht_group ="Click here to send email to one or more subscribers";
var ht_zipcode ="FOR WEBMASTERS ONLY!! Read the 'Site Docs' Zip Update section first! Click here to delete the current zip code database and insert new zip code data (need commerical.txt in uploads directory)";
var ht_webmail ="Click here to check office email: The User ID is office@plotexchange.com - PASS: current universal Password";
var ht_swebmail ="FOR WEBMASTERS ONLY!! Click here to check server email, returned emails end up here: The User ID is plotexch - PASS: current universal Password";
var ht_search_engines ="Click here to check your current rankings on the top Search Engines";
var ht_vendors ="Click here to view current vendors, service providers and open accounts for The Plot Exchange.";
var ht_inotify ="Click here to view and manage current Instant Notification Subscribers of new published cemetery plots.";
var ht_docs ="Click here to view the site's technical documentation";
var ht_stats ="Click here to view web site stats: USER-ID: plotexch  - PASS: current universal Password";
var ht_fix ="Click here to view pending additions or fixes to the site";
var ht_database ="FOR WEBMASTERS ONLY!! Click here to view and edit the database tables: USER-ID: plotexch  - PASS: current universal Password";
var ht_server ="Click here to obtain server software versions information";
var ht_ml ="Click here to get files and to allow access to MySQL Server ";
var ht_vps ="FOR WEBMASTERS ONLY!! Click here to login to the Virtual Private Server (VPS) - USER-ID is: root - PASS: ask John";
var ht_vir ="FOR WEBMASTERS ONLY!! Click here to login to the Virtuozzo Control Panel (VPS) - USER-ID is: root - PASS: ask John";
var ht_verizon ="Click here to use the Verizon National Connection Stabilizer - after window pops up, just minimize it and continue with your work....";
var ht_cp ="FOR WEBMASTERS ONLY!! Click here to login into PlotExchange.com's Server Control Panel, manage email accounts, etc: USER-ID is plotexch - Pass: current universal Password";
var ht_wells = "Click here to obtain bank statements";

//Send mail popup help

var ht_home = "Go back to ad table home.";
var ht_active = "Click here to send e-mail to active (paid and free month) subscribers";
var ht_trash = "Click here to send e-mail to unsubscribed ads (the ones in the -- unsubscribed -- trash bin).";
var ht_bad = "Click here to send e-mail to bad transaction subscribers - payment not received";
var ht_deleted = "Click here to send e-mail to deleted ads (the ones in the -- deleted -- trash bin).";
var ht_optout = "Click here to send e-mail to opt-out ads.";
var ht_free = "Click here to send e-mail to free month subscribers.";
var ht_renew = "Click here to send e-mail to all paid/renewed subscribers.";
var ht_everyone = "Click here to send e-mail to EVERYONE within database.  Use only if security breach or other emergency communication is required.";
var ht_pending = "Click here to send e-mail to Pending Order Subscribers.";
var ht_help = "<h5 align=center><font color=blue><u>Newsletter</u></font></h5>\
This <b>E-mail Form</b> allows the Site Administrator to email one or more of the Subscribers.<p>\
Simply enter a subject, write your email/message, click on one or more subscribers, then click send.<p>\
<p align=center><button onclick=\"writetxt(0)\">Close Help</button>";

function showmap(url) {

	map = window.open(url,"_blank","toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,left=0,width=730,top=0,height=600");

}



function newzip() {

	with (document.frmqs) {

		if (zipcode.value.length < 5) {

			alert("Please enter a valid 5-digit zip code or use our EZ Zip Finder");

			zipcode.focus(); return false;

		}

		if (isNaN(zipcode.value.substring(0,5))) {

			alert("Please enter a valid 5-digit zip code or use our EZ Zip Finder");

			zipcode.focus(); return false;

		}

		submit();

	}

}



function validateqs() {

	with (document.frmqs) {

		if (zipcode.value.length < 5) {

			alert("Please enter a valid 5-digit zip code or use our EZ Zip Finder.");

			zipcode.focus(); return false;

		}

		if (isNaN(zipcode.value.substring(0,5))) {

			alert("Please enter a valid 5-digit zip code or use our EZ Zip Finder.");

			zipcode.focus(); return false;

		}

		submit();

	}

}

function valin() {

	with (document.frmnotify) {

		if (email.value.length == 0) {

			alert("Please enter your e-mail address");

			email.focus(); return false;

		}

		if (email.value.indexOf("@") == -1 || email.value.indexOf(".") == -1) {

			alert("Your e-mail address does not appear to be formatted correctly.");

			email.focus(); return false;

		}

		submit();

	}

}



function validate() {

	with (document.frmqs) {

		/*if (isNaN(radius.value)) {

			alert("Invalid radius. Please enter a number between 0 and 999.");

			radius.focus(); return false;

		} else {

			var test = parseInt(radius.value);

			if (test < 0 || test > 999) {

				alert("Invalid radius. Please enter a number between 0 and 999.");

				radius.focus(); return false;

			}

		}*/

		if (zipcode.value.length < 5) {

			alert("Please enter a valid 5-digit zip code or use our EZ Zip Finder.");

			zipcode.focus(); return false;

		}

		if (isNaN(zipcode.value.substring(0,5))) {

			alert("Please enter a valid 5-digit zip code or use our EZ Zip Finder.");

			zipcode.focus(); return false;

		}

		submit();

	}

}

function popup(url) {

	var win = window.open(url,"_blank","toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,left=0,width=580,top=0,height=650");

}



function fullphoto(filename, w, h) {

	photo = window.open("","_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=0,width=" + w + ",top=0,height=" + h);

	with (photo.document) {

		write("<html><head><title>Image</title></head><body topmargin=0 leftmargin=0>");

		write("<img src=https://www.plotexchange.com/uploads/" + filename + " width=" + w + " height=" + h + ">");

		write("</body></html>");

	}

}



function zipfinder(txtbox) {

	searchwin = window.open("zipfinder.php?txtbox=" + txtbox,"_blank","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,left=100,width=300,top=100,height=400")

}



function EvalSound(soundobj) {

	var thissound=document.getElementById(soundobj);

	thissound.Play();

}



function backtoblack(element) {
	with (element) {
		style.backgroundColor = "white";
		style.color = "black";
		if (element.name == "contactvcode" || element.name == "newbusvcode" || element.name == "contactsellervcode") {
			element.value = "";
		}
	}
}

