if (location.href.indexOf("//yo-god.com") > -1) location.href = "http://www.yo-god.com";

function getCookie(name)
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0)
			return null;
	}
	else
		begin += 2;
	var end = document.cookie.indexOf(";", begin);
	if (end == -1)
		end = dc.length;
	return unescape(dc.substring(begin + prefix.length, end));
}

function setCookie(name, value, seconds)
{
   var today = new Date();
   var expires = new Date();
   expires.setTime(today.getTime() + (seconds * 1000));
   thisCookie = name + "=" + escape(value) + "; path=/"
      + ((expires == null) ? "" : ("; expires=" + expires.toGMTString()));
   document.cookie = thisCookie;
}

function getPassedParm(parm,lowerCase)
{
	if (location.search == "") return "";
	if (typeof(lowerCase) == "undefined") lowerCase = true;
	var parmList = "&" + location.search.substring(1,location.search.length) + "&";
	var re = new RegExp("&" + parm + "=([^&]*)&","i");
	var foundArray = re.exec(parmList);
	if (foundArray == null) return "";
	return lowerCase ? foundArray[1].toLowerCase() : foundArray[1];
}

var rootDir="/";
var bd="BRODEEN";
var sampleReg="RD23763267";
var bannedRegistrationNumbers="SV10303425";
var orderPage= "order4.htm"
var invoiceNum=getCookie("invoiceNum");
//var invoiceNum="";
window.defaultStatus="Welcome to Yo-God!";
var referrer = document.referrer.toLowerCase();

var passedRefID=getPassedParm("refid");
if (passedRefID.toLowerCase() == "clear")
{
	passedRefID="";
	setCookie("referenceID", "YG", 3600*24*14);
}

//if (passedRefID.toLowercase()=="infd" && referrer.indexOf("infidel") == -1 && referrer.indexOf("thedeepdark") == -1) passedRefID="";
if (referrer.indexOf("google") != -1 && passedRefID.toLowerCase() != "ygg") passedRefID="";

if (passedRefID != "") setCookie("referenceID", passedRefID, 3600*24*14);
refID=getCookie("referenceID");
//window.defaultStatus=passedRefID + "--" + refID;
if (refID=="undefined" || refID==null || refID=="")
{
	refID="YG";
	setCookie("referenceID", refID, 3600*24 * 14);
}
refID=refID.toUpperCase();

badIP=getCookie('badIP');
if (badIP!="undefined"&& badIP=="yes") location.href='http://www.google.com';
//setCookie("refID", "", 1);
//prevent right-click saving or viewing
if (document.layers) document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=captureClick;

function captureClick(ev)
{
return;
	if ((document.all && event.button == 2) || (document.layers && ev.which == 3))
	{
		if (location.href.indexOf(".asp")>-1) alert("Copyright ©2002  Yo-God! All rights reserved.");
		return false;
	}
}

function writeTop()
{
	var topImg="<img src=\"" + rootDir + "images/toppic.gif\" width=\"489\" height=\"129\" border=0> ";
	//XMAS LOGO
	//if (location.href.indexOf("xefault") != -1 || location.href.indexOf("thebox") != -1 || location.href.indexOf("one.") != -1 || location.href.indexOf("detectors") != -1 || location.href.indexOf("deluxe") != -1) topImg="<img src=\"" + rootDir + "images/toppic_xmas2.gif\" width=\"489\" height=\"129\"> ";
	document.write(topImg);
}
function writeSidebar()
{
	arrow=new Array;
	for(var i=1;i<=17;i++){arrow[i]="&nbsp;"};
	arrow[pgNum]="<img src=\"" + rootDir +"images/arrow.gif\" width=\"5\" height=\"9\" border=0> ";
	var arrowSpace="<img src=\"" + rootDir +"images/spacer.gif\" width=\"5\" height=\"9\" border=0> ";
	if (pgNum != 5) arrow[5]=arrowSpace; //no spaces for pics
	if (pgNum != 10) arrow[10]=arrowSpace;
	if (pgNum != 14) arrow[14]=arrowSpace;
	if (pgNum != 15) arrow[15]=arrowSpace;
	if (pgNum != 17) arrow[17]=arrowSpace;
	sidebar="<TABLE width=\"125\" bgcolor=\"#c0c0c0\">";
	sidebar+="<TR><TD valign=\"top\">";
	sidebar+="<TABLE cellpadding=\"1\">";
	sidebar+="<TR><TD width=\"5\">"+arrow[1]+"</TD><TD><a href=\"javascript:goPage('default') \" class=\"sidebar\" id=default onmouseover=\"mouseOverSidebar('default'); return true;\" onmouseout=\"mouseOutSidebar('default')\">Home</a></TD></TR>";
	sidebar+="<TR><TD width=\"5\" valign=top>&nbsp;</TD><TD NOWRAP><a href=\"javascript:goPage('detectors')\" class=\"sidebar\" id=detectors onmouseout=\"mouseOutSidebar('detectors')\" onmouseover=\"mouseOverSidebar('detectors'); return true;\">Detectors:</a>"
	sidebar+="<br>"+arrow[5]+"<a href=\"javascript:goPage('detectors')\" class=\"subSidebar\" id=standard onmouseout=\"mouseOutSidebar('standard')\" onmouseover=\"mouseOverSidebar('standard'); return true;\">Standard</a>";
	sidebar+="<br>"+arrow[14]+"<a href=\"javascript:goPage('deluxe')\" class=\"subSidebar\" id='deluxe' onmouseout=\"mouseOutSidebar('deluxe')\" onmouseover=\"mouseOverSidebar('deluxe'); return true;\">Deluxe</a>";
	sidebar+="<br>"+arrow[15]+"<a href=\"javascript:goPage('one')\" class=\"subSidebar\" id='one' onmouseout=\"mouseOutSidebar('one')\" onmouseover=\"mouseOverSidebar('one'); return true;\">One-of-a-Kind</a>";
	sidebar+="<br>"+arrow[10]+"<a href=\"javascript:goPage('bythebox')\" class=\"subSidebar\" id='bythebox' onmouseout=\"mouseOutSidebar('bythebox')\" onmouseover=\"mouseOverSidebar('bythebox'); return true;\">Display Cases</a>";
	sidebar+="<br>"+arrow[17]+"<a href=\"javascript:goPage('fashion')\" class=\"subSidebar\" id='fashion' onmouseout=\"mouseOutSidebar('fashion')\" onmouseover=\"mouseOverSidebar('fashion'); return true;\">Fashion</a>";
	sidebar+="</TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[2]+"</TD><TD><a href=\"javascript:goPage('faq')\" class=\"sidebar\" id='faq' onmouseout=\"mouseOutSidebar('faq')\" onmouseover=\"mouseOverSidebar('faq'); return true;\">Frequently &nbsp;Asked &nbsp;Questions</a></TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[13]+"</TD><TD><a href=\"javascript:goPage('network')\" class=\"sidebar\" id='network' onmouseout=\"mouseOutSidebar('network')\" onmouseover=\"mouseOverSidebar('network'); return true;\">Member Map</TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[3]+"</TD><TD><a href=\"javascript:goPage('reports')\" class=\"sidebar\" id='reports' onmouseout=\"mouseOutSidebar('reports')\" onmouseover=\"mouseOverSidebar('reports'); return true;\">Dial Movement &nbsp;Reports</a></TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[4]+"</TD><TD><a href=\"javascript:goPage('discussion')\" class=\"sidebar\" id='discussion' onmouseout=\"mouseOutSidebar('discussion')\" onmouseover=\"mouseOverSidebar('discussion'); return true;\">Comments</a></TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrowSpace+"</TD><TD><a href=\"http://yogod.createforum.net/index.php\" class=\"sidebar\" target=\"forum\"id='forum' onmouseout=\"mouseOutSidebar('forum')\" onmouseover=\"mouseOverSidebar('forum'); return true;\">Forum</a></TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[6]+"</TD><TD><a href=\"javascript:goPage('outreach')\" class=\"sidebar\" id='outreach' onmouseout=\"mouseOutSidebar('outreach')\" onmouseover=\"mouseOverSidebar('outreach'); return true;\">Outreach &#151;<br>&nbsp;Act Now!</a></TD></TR>";
//	sidebar+="<TR><TD width=\"5\">"+arrow[7]+"</TD><TD><a href=\"javascript:goPage('links')\" class=\"sidebar\" id='links' onmouseout=\"mouseOutSidebar('links')\" onmouseover=\"mouseOverSidebar('links'); return true;\">Links</TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[12]+"</TD><TD><a href=\"javascript:goPage('order')\" class=\"sidebar\" id='order' onmouseout=\"mouseOutSidebar('order')\" onmouseover=\"mouseOverSidebar('order'); return true;\">Mail Order &<br>&nbsp;International</TD></TR>";
	sidebar+="<TR><TD width=\"5\">" + arrowSpace + "</TD><TD><a href=\"javascript:goPage('cafepress')\" class=\"sidebar\" id='other' onmouseout=\"mouseOutSidebar('other')\" onmouseover=\"mouseOverSidebar('other'); return true;\">Other Yo-Stuff</a></TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[16]+"</TD><TD><a href=\"javascript:goPage('tellafriend')\" class=\"sidebar\" id='tellafriend' onmouseout=\"mouseOutSidebar('tellafriend')\" onmouseover=\"mouseOverSidebar('tellafriend'); return true;\">Tell a Friend</TD></TR>";
	sidebar+="<TR><TD width=\"5\">"+arrow[8]+"</TD><TD><a href=\"javascript:goPage('contact')\" class=\"sidebar\" id='contact' onmouseout=\"mouseOutSidebar('contact')\" onmouseover=\"mouseOverSidebar('contact'); return true;\">Contact</a></TD></TR>";
	sidebar+="</TABLE>";
	sidebar+="</TD></TR></TABLE>";
//BEGIN SIDE PICS
	if (pgNum != 5) arrow[5]="";//no spaces for pics
	if (pgNum != 10) arrow[10]="";
	if (pgNum != 14) arrow[14]="";
	if (pgNum != 15) arrow[15]="";
	sidebar+="<TABLE width=\"125\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\">";
	sidebar+="<TR><TD align=center>";

donate="<br><form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
donate+="<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">";
donate+="<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif\" border=\"0\" name=\"submit\" alt=\"Help keep Yo-God! up and running!\">";
donate+="<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">";
donate+="<input type=\"hidden\" name=\"encrypted\" value=\"-----BEGIN PKCS7-----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-----END PKCS7-----";
donate+="\"></form>";
	sidebar+=donate;
	sidebar+="&nbsp;<BR>&nbsp;";
	sidebar+="<a href=\"javascript:goPage('detectors')\" onmouseover=\"mouseOverLinks('detectors'); return true;\">";
	sidebar+="<img src=\"" + rootDir + "images/detectors_tiny.gif\" width=116 height=142 border=0><BR>";
	sidebar+="<span class=\"smallText\">" + arrow[5] +"Standard</span></a>";
	sidebar+="</TD></TR>";
	sidebar+="<TR><TD align=center>";
	sidebar+="&nbsp;<BR>&nbsp;";
	sidebar+="<a href=\"javascript:goPage('deluxe')\" onmouseover=\"mouseOverLinks('deluxe'); return true;\">";
//	deluxeGif = "<img src=\"" + rootDir + "images/deluxe_tiny.gif\" width=110 height=98 border=0>";
//	deluxeGif = "<img src=\"" + rootDir + "images/clock-doves-tiny.jpg\" width=110 height=92 border=0>";
//	deluxeGif = "<img src=\"" + rootDir + "images/deluxe_tiny-wood.gif\" width=110 height=72 border=0>";
//	deluxeGif = "<img src=\"" + rootDir + "images/deluxe_tiny-belle.gif\" width=116 height=110 border=0>";
//	deluxeGif = "<img src=\"" + rootDir + "images/eagle_tiny.gif\" width=115 height=110 border=0>";
//	deluxeGif = "<img src=\"" + rootDir + "images/eagle3_tiny.gif\" width=110 height=133 border=0>";
//	deluxeGif = "<img src=\"" + rootDir + "images/virgin_pg_anim5.gif\" width=100 height=197 border=0>";
	deluxeGif = "<img src=\"" + rootDir + "images/jesus_small.gif\" width=116 height=149 border=0>";
	deluxeGif = "<img src=\"" + rootDir + "images/tv_tiny.gif\" width=116 height=133 border=0>";
	sidebar+=deluxeGif + "<BR>";
	sidebar+="<span class=\"smallText\">"+arrow[14] +"Deluxe</span></a>";
	sidebar+="</TD></TR>";
	sidebar+="<TR><TD align=center>";
	sidebar+="&nbsp;<BR>&nbsp;";
	sidebar+="<a href=\"javascript:goPage('one')\" onmouseover=\"mouseOverLinks('one'); return true;\">";
	oneGif = "<img src=\"" + rootDir + "images/lady-tiny.jpg\" width=110 height=116 border=0>";
//	oneGif = "<img src=\"" + rootDir + "images/monkey_bush_pg2.gif\" width=\"74\" height=\"200\" border=0>";
	sidebar+=oneGif + "<BR>";
	sidebar+="<span class=\"smallText\">"+arrow[15] +"One-of-a-Kind</span></a>";
	sidebar+="</TD></TR>";
	sidebar+="<TR><TD align=center>";
	sidebar+="<BR>&nbsp;";
	sidebar+="<a href=\"javascript:goPage('bythebox')\" onmouseover=\"mouseOverLinks('bythebox'); return true;\">";
	sidebar+="<img src=\"" + rootDir + "images/godbox_tiny.gif\"  width=116 height=156 border=0><BR>";
	sidebar+="<span class=\"smallText\">"+ arrow[10] +"Display Cases</span></a>";
	sidebar+="</TD></TR>";
	sidebar+="<TR><TD align=center>";
	sidebar+="<BR>&nbsp;";
	sidebar+="<a href=\"javascript:goPage('tellafriend')\" onmouseover=\"mouseOverLinks('tellafriend'); return true;\">";
	sidebar+="<img src=\"" + rootDir + "images/tellafriend_button.gif\" width=108 height=23 border=0><BR>";
	sidebar+="</TD></TR>";
	sidebar+="</TABLE>";
	document.write(sidebar);

}

function loadDefault()
{
	//setCookie("popdone","no",3600*24*1);
	//if (getCookie("popdone") != "yes") popup(rootDir+"schoolsale.htm", "sale", "toolbar=no,menubar=no,resizable=no,width=461,height=229,scrollbars=no");
	//setCookie("popdone","yes",3600);
	//if (getCookie("popdone") != "yes") popup(rootDir+"eaglesale.htm", "sale", "toolbar=no,menubar=no,resizable=no,width=307,height=371,scrollbars=no");
	//setCookie("popdone","yes",3600);
	//if (getCookie("popdone") != "yes") popup(rootDir+"watchsale2.htm", "sale", "toolbar=no,menubar=no,resizable=no,width=461,height=229,scrollbars=no");
	//setCookie("popdone","no",3600*24*1);
	//if (getCookie("popdone") != "yes") popup(rootDir+"viewdetectors.htm", "detectors", "toolbar=no,menubar=no,resizable=no,width=378,height=435,scrollbars=no");
	//if (getCookie("popdone") != "yes") popup(rootDir+"notice.htm", "notice", "toolbar=no,menubar=no,resizable=no,width=350,height=300,scrollbars=no");
	//setCookie("popdone","yes",3600*24*1);
}

function mouseOverSidebar(id)
{
	obj=document.getElementById(id);
	if (obj !=null) obj.style.color="#FF0033";
	mouseOverLinks(id)
}

function mouseOutSidebar(id)
{
	obj=document.getElementById(id);
	if (obj !=null) obj.style.color="#000000";
	self.status="Welcome to Yo-God!";
}

function mouseOverLinks(pgKey)
{
// onmouseover="mouseOverLinks('ask'); return true;" onmouseout="mouseOutLinks()"
	switch (pgKey)
	{
		case "contact":
			statusMsg= "Contact Yo-God.";
			break;
		case "resale":
			statusMsg= "";
			break;
		case "ask":
			statusMsg= "Ask a question.";
			break;
		case "customerservice":
			statusMsg= "Contact Yo-God customer service.";
			break;
		case "notify":
			statusMsg= "";
			break;
		case "default":
			statusMsg= "Go to the Yo-God home page.";
			break;
		case "outreach":
			statusMsg= "Go to the Outreach page.";
			break;
		case "submit_reg":
			statusMsg= "Submit your registration information.";
			break;
		case "submit_report":
			statusMsg= "Submit your report.";
			break;
		case "submit_comment":
			statusMsg= "Submit your comment.";
			break;
		case "verify":
			statusMsg= "Verify your Yo-God God Detector registration number.";
			break;
		case "network":
			statusMsg= "Register your detector or view the Yo-God map.";
			break;
		case "detectors":
		case "standard":
			statusMsg= "See the Yo-God God Detectors.";
		break;
		case "bythebox":
			statusMsg= "See the Yo-God display case versions.";
		break;
		case "order":
			statusMsg= "Join the Yo-God network.";
		break;
		case "discussion":
			statusMsg= "Tell us what you think.";
		break;
		case "reports":
			statusMsg= "View or report Yo-God God Detector activity.";
		break;
		case "faq":
			statusMsg= "View answers to frequently asked quesitons.";
		break;
		case "coming":
			statusMsg= "";
		break;
		case "pamphlet":
			statusMsg= "View the Yo-God pamphlet.";
		break;
		case "viewmagnets":
			statusMsg= "View the Yo-God refrigerator magnets.";
		break;
		case "viewpatch":
			statusMsg= "View the Yo-God pocket patch.";
		break;
		case "viewhand":
			statusMsg= "View the Yo-God God Detector with an image of God's hand.";
		break;
		case "viewface":
			statusMsg= "View the Yo-God God Detector with an image of God's face.";
		break;
		case "deluxe":
		case "viewdeluxe":
			statusMsg= "View the deluxe Yo-God God Detectors.";
		break;
		case "one":
			statusMsg= "View one-of-a-kind Yo-God God Detectors.";
		break;
		case "viewbox":
			statusMsg= "View the Yo-God God Detector display case versions.";
		break;
		case "viewreg":
			statusMsg= "View a sample registration number.";
		break;
		case "viewkeychainc":
			statusMsg= "View the caribiner-click God Detector.";
		break;
		case "viewrailroad":
			statusMsg= "View the railroad detector styles.";
		break;
		case "viewknife":
			statusMsg= "View the God-Detector/Knife set.";
		break;
		case "viewwall":
			statusMsg= "View the wall-mount God Detector.";
		break;
		case "viewdoves":
			statusMsg= "View the porcelain birds God Detector.";
		break;
		case "viewroman":
			statusMsg= "View the Roman-style God Detector.";
		break;
		case "viewmother":
			statusMsg= "View the modern-sculpture style Goddess Detector.";
		break;
		case "viewitalian":
			statusMsg= "View the ornate Italian-style God Detector.";
		break;
		case "viewtile":
			statusMsg= "View the Mosaic God Detector.";
		break;
		case "viewpope":
			statusMsg= "View the Picture Perfect God Detector.";
		break;
		case "viewtools":
			statusMsg= "View the Tool-Kit God Detector.";
		break;
		case "viewlapus":
			statusMsg= "View the Elegant Deco God Detector.";
		break;
		case "viewlight":
			statusMsg= "View the Electronic God Detector.";
		break;
		case "viewlady":
			statusMsg= "View the Enchanted Woman God Detector.";
		break;
		case "viewgrandpa":
			statusMsg= "View the Mini Grandpa God Detector.";
		break;
		case "viewacorn":
			statusMsg= "View the Travel Clock God Detector.";
		break;
		case "viewbelle":
			statusMsg= "View the Southern Belle God Detector.";
		break;
		case "viewwood":
			statusMsg= "View the varieties of Crafted Wood God Detectors.";
		break;
		case "viewwoodsm":
			statusMsg= "View the varieties of Space Age Wood God Detectors.";
		break;
		case "viewmonolith":
			statusMsg= "View the Monolith God Detector.";
		break;
		case "vieweagle":
			statusMsg= "View the Eagle vs.Serpent God Detector.";
		break;
		case "viewframe":
			statusMsg= "View the Three-Piece Frame Set God Detector.";
		break;
		case "viewkeychain":
			statusMsg= "View the Yo-God Keychain God Detector.";
		break;
		case "viewspace":
			statusMsg= "View the Bauhaus God Detectors.";
		break;
		case "viewbaby":
			statusMsg= "View the Baby Clothes God Detector.";
		break;
		case "viewcowboy":
			statusMsg= "View the Cowboy God Detector.";
		break;
		case "viewporcelain":
			statusMsg= "View the White Porcelain God Detector.";
		break;
		case "viewbutterfly":
			statusMsg= "View the Butterfly Trellis God Detector.";
		break;
		case "viewheart":
			statusMsg= "View the I Heart God Detector.";
		break;
		case "viewcustom":
			statusMsg= "View a sample custom God Detector.";
		break;
		case "addtocart":
			statusMsg= "Click to add this item to your cart.";
		break;
		case "viewcart":
			statusMsg= "Click to view your cart.";
		break;
		case "orderform":
			statusMsg= "Create a printable order form.";
		break;
		case "tellafriend":
			statusMsg= "Tell a friend about Yo-God!";
		break;
		case "cafepress":
			statusMsg= "Buy Yo-God! T-shirts, mugs, and other Yo-Stuff!";
		break;
		case "viewimage":
			statusMsg= "View an enlarged version of this image.";
		break;
		default:
			//statusMsg= "Welcome to Yo-God!";
			statusMsg=pgKey;
	}
	self.status=statusMsg;
}
function mouseOutLinks()
{
//use pgnum for different default statuses
	self.status="";
//	return true;
}

function goPage(pgKey)
{
	switch (pgKey)
	{
		case "contact":
			location.href="mailto:deanbooth@yo-god.com";
			break;
		case "resale":
			location.href="mailto:bulk_quantities@yo-god.com";
			break;
		case "ask":
			location.href="mailto:ask_a_question@yo-god.com";
			break;
		case "customerservice":
			location.href="mailto:customer_service@yo-god.com";
			break;
		case "notify":
			location.href="mailto:notifyme@yo-god.com";
			break;
		case "outreach":
			//location.href=rootDir+"data/outreach3.asp";
			location.href=rootDir+"outreach_mayday.htm";
			break;
		case "network":
			location.href=rootDir+"data/network.asp";
			//location.href=rootDir+"network.htm";
			break;
		case "detectors":
			location.href=rootDir+"detectors2.htm";
		break;
		case "deluxe":
			location.href=rootDir+"deluxe7.htm";
			//location.href=rootDir+"deluxe4.htm";
			//location.href=rootDir+"deluxe_sale.htm";
		break;
		case "bythebox":
			location.href=rootDir+"bythebox3.htm";
		break;
		case "order":
			location.href=rootDir+orderPage;
		break;
		case "discussion":
			location.href=rootDir+"data/discussion3.asp";
		break;
		case "discussionBottom":
			location.href=rootDir +"data/discussion3.asp?#bot"
		break;
		case "reports":
			location.href=rootDir+"data/reports.asp";
		break;
		case "coming":
			alert("Yo-God! God Detectors are coming soon! Please check back in a few days.");
		break;
		case "pamphlet":
			popup(rootDir+"pamphlet.htm", "pamphlet", "toolbar=no,menubar=no,resizable=no,width=328,height=316,scrollbars=no");
		break;
		case "viewhand":
			//popup("/images/detectors_pg.gif", "picWin1", "toolbar=no,menubar=no,resizable=yes,width=375,height=431,scrollbars=no");
			popup(rootDir+"viewhand.htm", "viewhand", "toolbar=no,menubar=no,resizable=no,width=130,height=130,scrollbars=no");
		break;
		case "viewmagnets":
			popup(rootDir+"viewmagnets.htm", "viewmagnets", "toolbar=no,menubar=no,resizable=no,width=316,height=200,scrollbars=no");
		break;
		case "viewpatch":
			popup(rootDir+"viewpatch.htm", "viewpatch", "toolbar=no,menubar=no,resizable=no,width=170,height=200,scrollbars=no");
		break;
		case "viewface":
			popup(rootDir+"viewface.htm", "viewface", "toolbar=no,menubar=no,resizable=no,width=130,height=130,scrollbars=no");
		break;
		case "viewdeluxe":
			popup(rootDir+"viewdeluxe.htm", "viewdeluxe", "toolbar=no,menubar=no,resizable=no,width=600,height=486,scrollbars=no");
		break;
		case "viewbox":
			popup(rootDir+"viewbox.htm", "viewbox", "toolbar=no,menubar=no,resizable=no,width=416,height=524,scrollbars=no");
		break;
		case "viewreg":
			popup(rootDir+"viewreg.htm", "viewreg", "toolbar=no,menubar=no,resizable=no,width=170,height=170,scrollbars=no");
		break;
		case "viewrailroad":
			popup(rootDir+"viewrailroad.htm", "viewrailroad", "toolbar=no,menubar=no,resizable=no,width=625,height=440,scrollbars=no");
		break;
		case "infidelguy":
			popup("http://www.infidelguy.com?refid=dean", "infidel", "toolbar=yes,menubar=yes,resizable=yes,width=625,height=440,scrollbars=yes");
		break;
		case "viewwall":
			popup(rootDir + pgKey +".htm", pgKey, "toolbar=no,menubar=no,resizable=no,width=412,height=410,scrollbars=no");
		break;
		case "viewdoves":
			popup(rootDir+pgKey+".htm", pgKey, "toolbar=no,menubar=no,resizable=no,width=419,height=352,scrollbars=no");
		break;
		case "viewroman":
			popup(rootDir+pgKey+".htm", pgKey, "toolbar=no,menubar=no,resizable=no,width=265,height=419,scrollbars=no");
		break;
		case "viewmother":
			popup(rootDir+pgKey+".htm", pgKey, "toolbar=no,menubar=no,resizable=no,width=419,height=367,scrollbars=no");
		break;
		case "viewitalian":
			popup(rootDir+pgKey+".htm", pgKey, "toolbar=no,menubar=no,resizable=no,width=410,height=496,scrollbars=no");
		break;
		case "viewknife":
			popup(rootDir+"viewknife.htm", "viewknife", "toolbar=no,menubar=no,resizable=no,width=575,height=311,scrollbars=no");
		break;
		case "viewkeychainc":
			popup(rootDir+"viewkeychain.htm", "viewkeychain", "toolbar=no,menubar=no,resizable=no,width=187,height=394,scrollbars=no");
		break;
		case "viewtile":
			popup(rootDir+"viewtile.htm", "viewtile", "toolbar=no,menubar=no,resizable=no,width=623,height=555,scrollbars=no");
		break;
		case "viewjetage":
			popup(rootDir+"viewjetage.htm", "viewjetage", "toolbar=no,menubar=no,resizable=no,width=638,height=403,scrollbars=no");
		break;
		case "viewpope":
			popup(rootDir+"viewpope.htm", "viewpope", "toolbar=no,menubar=no,resizable=no,width=691,height=542,scrollbars=no");
		break;
		case "viewtools":
			popup(rootDir+"viewtools.htm", "viewtools", "toolbar=no,menubar=no,resizable=no,width=732,height=535,scrollbars=no");
		break;
		case "viewlapus":
			popup(rootDir+"viewlapus.htm", "viewlapus", "toolbar=no,menubar=no,resizable=no,width=548,height=460,scrollbars=no");
		break;
		case "viewlight":
			popup(rootDir+"viewlight.htm", "viewlight", "toolbar=no,menubar=no,resizable=no,width=437,height=440,scrollbars=no");
		break;
		case "viewlady":
			popup(rootDir+"viewlady.htm", "viewlady", "toolbar=no,menubar=no,resizable=no,width=524,height=553,scrollbars=no");
		break;
		case "viewgrandpa":
			popup(rootDir+"viewgrandpa.htm", "viewgrandpa", "toolbar=no,menubar=no,resizable=no,width=251,height=589,scrollbars=no");
		break;
		case "viewacorn":
			popup(rootDir+"viewacorn.htm", "viewacorn", "toolbar=no,menubar=no,resizable=no,width=450,height=526,scrollbars=no");
		break;
		case "viewfigurines":
			popup(rootDir+"figurines.htm", "figurines", "toolbar=no,menubar=no,resizable=yes,width=400,height=550,scrollbars=yes");
		break;
		case "viewwood":
			popup(rootDir+"viewwood.htm", "viewwood", "toolbar=no,menubar=no,resizable=no,width=721,height=472,scrollbars=no");
		break;
		case "viewwoodsm":
			popup(rootDir+"viewwoodsm.htm", "viewwoodsm", "toolbar=no,menubar=no,resizable=no,width=708,height=411,scrollbars=no");
		break;
		case "vieweagle":
			popup(rootDir+"images/eagle3_pop.jpg", "vieweagle", "toolbar=no,menubar=no,resizable=no,width=430,height=520,scrollbars=no");
		break;
		case "viewkeychain":
			popup(rootDir+"images/keychain_pop.jpg", "viewkeychain", "toolbar=no,menubar=no,resizable=no,width=610,height=435,scrollbars=no");
		break;
		case "viewframe":
			popup(rootDir+"images/frame_pop.jpg", "viewframe", "toolbar=no,menubar=no,resizable=no,width=465,height=600,scrollbars=no");
		break;
		case "viewmonolith":
			popup(rootDir+"viewmonolith.htm", "viewmonolith", "toolbar=no,menubar=no,resizable=no,width=377,height=385,scrollbars=no");
		break;
		case "viewspace":
			popup(rootDir+"viewspace.htm", "viewspace", "toolbar=no,menubar=no,resizable=no,width=765,height=345,scrollbars=no");
		break;
		case "viewbelle":
			popup(rootDir+"viewbelle.htm", "viewbelle", "toolbar=no,menubar=no,resizable=no,width=581,height=254,scrollbars=no");
		break;
		case "viewbaby":
			popup(rootDir+"viewbaby.htm", "viewbaby", "toolbar=no,menubar=no,resizable=no,width=585,height=326,scrollbars=no");
		break;
		case "viewcowboy":
			popup(rootDir+"viewcowboy.htm", "viewcowboy", "toolbar=no,menubar=no,resizable=no,width=451,height=508,scrollbars=no");
		break;
		case "viewbutterfly":
			popup(rootDir+"viewbutterfly.htm", "viewbutterfly", "toolbar=no,menubar=no,resizable=no,width=429,height=471,scrollbars=no");
		break;
		case "viewporcelain":
			popup(rootDir+"viewporcelain.htm", "viewporcelain", "toolbar=no,menubar=no,resizable=no,width=403,height=528,scrollbars=no");
		break;
		case "viewheart":
			popup(rootDir+"viewheart.htm", "viewheart", "toolbar=no,menubar=no,resizable=no,width=462,height=447,scrollbars=no");
		break;
		case "viewcustom":
			popup(rootDir+"viewcustom.htm", "viewcustom", "toolbar=no,menubar=no,resizable=no,width=638,height=509,scrollbars=no");
		break;
		case "tellafriend":
			popup(rootDir+"data/tellafriend1.asp", "tellafriend", "toolbar=no,menubar=no,resizable=yes,width=400,height=375,scrollbars=no");
		break;
		case "cafepress":
			var cafepress="http://www.cafepress.com/cp/store/store.aspx?storeid=yogod"; //,yogodyes";
			popup(cafepress, "cafepress", "toolbar=yes,menubar=yes,resizable=yes,width=800,height=550,scrollbars=yes");
			break;
		default:
			location.href=rootDir+ pgKey+".htm";
	}
}

function writeBottom()
{
	mybottom="<center>";
	//mybottom+="<img src=\"" + rootDir + "images/copyright.gif\" width=146 height=14>";
	mybottom+="<span style=\"font-size:8pt;color:red;\">&copy; 2002-2010 www.yo-god.com</span>"
	mybottom+="</center>";
	mybottom+="<a href=\"#\" name=\"bot\"> </a>";
	document.write(mybottom);
	if (location.search.indexOf("?gobot")>-1) location.href="#bot";
}
function popupImg(imgName)
{
	switch (imgName)
	{
		case "yogod_detector_pic":
			popup("/images/detectors_pg.gif", "picWin1", "toolbar=no,menubar=no,resizable=yes,width=375,height=431,scrollbars=no");
			break;
		case "bythebox":
			popup("/images/yo-god-display-20.gif", "picWin2", "toolbar=no,menubar=no,resizable=yes,width=416,height=524,scrollbars=no");
			break;
		case "hand":
			popup("/images/g01.gif", "picWin3", "toolbar=no,menubar=no,resizable=yes,width=150,height=150,scrollbars=no");
			break;
		case "face":
			popup("/images/f01.gif", "picWin4", "toolbar=no,menubar=no,resizable=yes,width=150,height=150,scrollbars=no");
			break;
		default:
		alert('Coming Soon!');
	}
}

function popupImage(imgName,height,width)
{
		popup("/images/" + imgName, "picwin", "toolbar=no,menubar=no,resizable=yes, width=" + width + ",height=" + height +",scrollbars=no");
}

function popPic(imgName,width,height, title)
{
		if (location.href.indexOf("one.htm") > -1) titleParm="&title=" + "Yo, God! One-of-a-Kind God Detector";
		else if (typeof(title) != "undefined") titleParm="&title=" + title;
			else titleParm="";
		popup("picviewer.htm?pic=" + imgName + titleParm, "picwin"+imgName.substring(0,3), "toolbar=no,menubar=no,resizable=yes, width=" + width + ",height=" + height +",scrollbars=no");
}

function popup(destination,remoteName,parms)
{
	if (typeof(parms)==typeof(notDefined) || parms=="") parms="toolbar=yes,menubar=yes,resizable=yes,width=640,height=480,scrollbars=yes";
	if (typeof(remoteName)==typeof(notDefined) || remoteName=="") remoteName="remote";
	newWind=window.open(destination,remoteName,parms);
	if (newWind.opener == null)
		newWind.opener = window;
	else
		newWind.focus();
}

// network.asp
function verifyRegistration()
{
	var thisZip=document.form1.zipCode.value;
//	var numbers="1234567890";
//	var isDigit=true;
//	for(var i=0;i<5;i++){ if(numbers.indexOf(thisZip.substring(i,i+1)) < 0) isDigit=false; }
//	if (thisZip.length !=5 || !isDigit)
	if (thisZip == "")
	{
		alert("Please enter a zip code.");
		return false;
	}
	var thisNum=document.form1.regNum.value;
	if (isValidRegistrationNumber(thisNum)) return true;
		else if (thisNum!="") alert("I'm sorry, that's not a valid registration number.");
			else alert("You haven't entered a  registration number.");
	return false;
}

function submitRegistration()
{
	if (verifyRegistration()) document.form1.submit();
}

function verifyRegistrationNumber()
{
	var thisNum=document.form1.regNum.value;
	if (isValidRegistrationNumber(thisNum)) alert("Great, that's a valid registration number!");
		else if (thisNum!="") alert("I'm sorry, that's not a valid registration number.");
			else alert("You haven't entered a  registration number.");
}
function submitComment()
{
	setCookie("author",document.form1.name.value,360000);
	if (verifyComment()) document.form1.submit();
}

commentPw=Math.round(Math.random() * (9999)) + 1
function verifyComment()
{
	if (location.href.indexOf("discussion3")>-1 && document.form1.pw.value !=commentPw)
	{
		alert("To help prevent spamming, please enter the number shown next to your name.");
		return false;
	}
	if (document.form1.name.value =="") document.form1.name.value="Anonymous"
	if (document.form1.comment.value =="")
	{
		alert("You haven't entered a comment yet.");
		return false;
	} else return true;
}

function submitReport()
{
	if (verifyReport()) document.form1.submit();
}

function verifyReport()
{
	var thisNum=document.form1.regNum.value;
	if (thisNum.toLowerCase()=="wg11287180")
	{
		alert("Sorry, Allison, I can't let you file a report using a detector set to Yes!");
		return false;
	}

	if (!isValidRegistrationNumber(thisNum))
	{
		if (thisNum!="") alert("I'm sorry, the Yo-God God Detector registration number you've entered is not valid.");
			else alert("You haven't entered a  registration number.");
		return false;
	}
	if (document.form1.rptType.value == "")
	{
		alert("Please select a report type and try again.");
		return false;
	}
	if (document.form1.comment.value =="")
	{
		alert("You haven't entered any information.")
		return false;
	} else return true;
}

function isValidRegistrationNumber(regNum)
{
	regNum=regNum.toUpperCase()
	if (regNum==bd)
	{
		badApple();
		return false;
	}
	if (regNum==sampleReg)
	{
		alert("I detect someone using my sample registration number. An inquisitive person like you needs a Yo-God God Detector!");
		return false;
	}
	if (regNum.length != 10) return false;
	if (bannedRegistrationNumbers.indexOf(regNum)>-1)
	{
		alert("Yo-God! frowns upon your fraudulent reports, Andy. Do you not believe that God is powerful enough to reveal himself?");
		return false;
	}
	var chars = new Array;
	for (var i=0; i <10;i++)
	{
		//alert("i =" + i + "  " + regNum.substring(i, i+1))
		chars[i+1] = regNum.substring(i, i+1);
	}
	var letters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var sum = (letters.indexOf(chars[1])+1) * (letters.indexOf(chars[2])+1);
	regNumbers = parseInt(chars[3])+ parseInt(chars[4])+ parseInt(chars[5])+ parseInt(chars[6])+ parseInt(chars[7]);
	if (regNumbers < 3) regNumbers=9999;
	sum = sum + regNumbers;
	if (sum.length== 1) sum = "00" + sum;
	if (sum.length== 2) sum = "0" + sum;
	var regNumchk = "" + chars[8] + chars[9] + chars[10]
	if (sum != 0 && sum==regNumchk) return true;
		else return false;
}

var price_std="4.95 - Temporarily out of stock" //4.95";
var price_march="3.50";
var price_march_order="3.00";
var price_rainbow="7.99";
var price_watch="19.99";
var price_roman="29.99";
var price_mother="34.99";
var price_doves="34.99";
var price_italian="79.99";
var price_knife="29.99";
var price_caribiner="18.99";
var price_box="85.00";
var price_3boxes="225.00";
var price_dialMagnet="2.95";
var price_logoMagnet="1.95";
var price_keychain="7.95";
var price_keycard="65.00";
var price_prayer="12.95";
var price_tire="5.95";
var price_horseshoe="24.95";

var price_black="24.99";
var price_tile="22.99";
var price_pope="24.99";
var price_tools="24.99";
var price_lapus="34.99";
var price_light="34.99";
var price_lady="129.99";
var price_acorn="29.99";
var price_dutch="29.99";
var price_heart="24.99";
var price_custom="24.99";
var price_porcelain="22.99";
var price_grandpa="24.99";
var price_cowboy="29.99";
var price_baby="12.99";
var price_belle="12.99";
var price_baseball="29.99";
var price_wood="19.99";
var price_woodsm="16.99";
var price_monolith="10.99";
var price_space="16.99";
var price_eagle="24.99";
var price_frame="12.99";
var price_singleframe="8.99";
var price_magnet="1.00";
var price_palm="24.99";
var price_grapes="24.99";
var price_baroque="34.99";
var price_travel="29.99";
var price_dunoon="22.99";
var price_laura="20.99";
var price_teapot="24.99";
var price_diver="49.99";
var price_monkey="29.99";
var price_deer="24.99";
var price_horse="24.99";
var price_books="26.99";
var price_chickens="24.99";
var price_wicker="24.99";
var price_santa="18.99";
var price_cityhall="12.99";
var price_grace="17.99";
var price_dome="14.99";
var price_virgin="24.99";
var price_turin="24.99";
var price_thermo="29.99";
var price_silver="29.99";
var price_solid="29.99";
var price_glass="29.99";
var price_gimbal="34.99";
var price_marble="12.99";
var price_train="34.99";
var price_crystal="24.99";
var price_elephant="34.99";
var price_benedict="22.99";
var price_arch="24.99";
var price_pillars="19.99";
var price_figurine="9.99";
var price_monkeys="29.99";
var price_nativity="29.99";
var price_angel="24.99";
var price_rooster="29.99";
var price_dragon="34.99";
var price_motorcycle="24.99";
var price_camel="29.99";
var price_tv="12.99";

var price_brasspen="29.99";
var price_silverpen="26.99";
var price_globe="36.99";
var price_spade="24.99";
var price_liberty="39.99";

var price_candle_large="6.99";
var price_candle_small="5.99";
var price_candle_pair="10.99";

var price_ironon_face_large="7.00";
var price_ironon_hand_large="7.00";
var price_ironon_face_small="4.00";
var price_ironon_hand_small="4.00";
var price_ironon_face_small_logo="4.00";
var price_ironon_hand_small_logo="4.00";
var price_button="3.00";
var price_3_buttons="6.00";
var price_10_buttons="17.50";
//var price_eagle_2="29.99";
//var price_santa_2="21.99";
//var price_frame_2="21.99";

function addToCart(item, quantity)
{
//var rnd1=Math.round(Math.random() * (9999999999)) + 1
	switch (item)
	{
		case "magnet":
			iName="Convert+to+Refrigerator+Magnet";
			iNumber=refID + "-001m";
			cost=price_magnet;
			break;
		case "deluxe_magnet":
			iName="Convert+Deluxe+to+Refrigerator+Magnet";
			iNumber=refID + "-009m";
			cost=price_magnet;
			break;
		case "march":
			iName="Yo-God+God+Detector,+to+be+sent+to+the+U.S.+Congress";
			iNumber=refID + "-1776";
			cost=price_march;
			break;
		case "march_order":
			iName="Yo-God+God+Detector,+to+be+sent+to+the+U.S.+Congress+(requires+other+detector+ordered)";
			iNumber=refID + "-1776_special";
			cost=price_march_order;
			break;
		case "hand":
			iName="Yo-God+God+Detector,+Hand+of+God+image+-+TEMPORARILY+OUT+OF+STOCK";
			iNumber=refID + "-001";
			cost=price_std;
			cost="0.00";
			break;
		case "face":
			iName="Yo-God+God+Detector,+Face+of+God+image+-+TEMPORARILY+OUT+OF+STOCK";
			iNumber=refID + "-002";
			cost=price_std;
			cost="0.00";
			break;
		case "deluxe":
			iName="Deluxe Rainbow Yo-God+God+Detector,+Face+of+God+image";
			iNumber=refID + "-009f";
			cost=price_rainbow;
			break;
		case "deluxehand":
			iName="Deluxe Rainbow Yo-God+God+Detector,+Hand+of+God+image";
			iNumber=refID + "-009h";
			cost=price_rainbow;
			break;
		case "tire":
			iName="Traveler's+Yo-God+God+Detector";
			iNumber=refID + "-011";
			cost=price_tire;
			break;
		case "railroad":
			iName="Railroad-watch+style+Yo-God+God+Detector";
			iNumber=refID + "-022";
			cost=price_watch;
			break;
		case "roman":
			iName="Roman-clock style+Yo-God+God+Detector";
			iNumber=refID + "-023";
			cost=price_roman;
			break;
		case "horseshoe":
			iName="Lucky Cowboy+Yo-God+God+Detector";
			iNumber=refID + "-024";
			cost=price_horseshoe;
			break;
		case "doves":
			iName="Porcelain+Flowers+and+Doves+Yo-God+God+Detector";
			iNumber=refID + "-025";
			cost=price_doves;
			break;
		case "italian":
			iName="Ornate+Italian+design+Yo-God+God+Detector";
			iNumber=refID + "-026";
			cost=price_italian;
			break;
		case "knife":
			iName="Railroad-watch+style+Yo-God+God+Detector";
			iNumber=refID + "-027";
			cost=price_knife
			break;
		case "santa":
			iName="Santa+and+His+Sleigh+Yo-God+God+Detector";
			iNumber=refID + "-028";
			cost=price_santa
			break;
		case "grace":
			iName="Amazing+Grace+Yo-God+Wall+Clock+God+Detector";
			iNumber=refID + "-029";
			cost=price_grace
			break;
		case "cityhall":
			iName="City+Hall+Yo-God+God+Detector";
			iNumber=refID + "-030";
			cost=price_cityhall
			break;
		case "box":
			iName="Display+Box,+20+Yo-God+God+Detectors";
			iNumber=refID + "-050";
			cost=price_box;
			break;
		case "keycard":
			iName="Display+Card,+11+Yo-God+Keychain+God+Detectors";
			iNumber=refID + "-055";
			cost=price_keycard;
			break;
		case "dialMagnet":
			iName="Magnetic+Yo-God+God+Detector";
			iNumber=refID + "-060";
			cost=price_dialMagnet;
			break;
		case "logoMagnet":
			iName="Yo-God+Magentic+Logo";
			iNumber=refID + "-065";
			cost=price_logoMagnet;
			break;
		case "tile":
			iName="Mosaic+Yo-God+God+Detector";
			iNumber=refID + "-901";
			cost=price_tile;
			break;
		case "pope":
			iName="Picture+Perfect+Yo-God+God+Detector";
			iNumber=refID + "-902";
			cost=price_pope;
			break;
		case "tools":
			iName="Creator+Tool+Kit+Yo-God+God+Detector";
			iNumber=refID + "-903";
			cost=price_tools;
			break;
		case "lapus":
			iName="Deco+Brass+Yo-God+God+Detector";
			iNumber=refID + "-904";
			cost=price_lapus;
			break;
		case "light":
			iName="Electronic+Yo-God+God+Detector";
			iNumber=refID + "-905";
			cost=price_light;
			break;
		case "lady":
			iName="Enchanted+Woman+Yo-God+God+Detector";
			iNumber=refID + "-906";
			cost=price_lady;
			break;
		case "acorn":
			iName="Secret+Compartment+Yo-God+God+Detector";
			iNumber=refID + "-907";
			cost=price_acorn;
			break;
		case "dutch":
			iName="Dutch+Secret+Compartment+Yo-God+God+Detector";
			iNumber=refID + "-907d";
			cost=price_dutch;
			break;
		case "grandpa":
			iName="Mini+Grandfather+Yo-God+God+Detector";
			iNumber=refID + "-910";
			cost=price_grandpa;
			break;
		case "heart":
			iName="I+Heart+Yo-God+God+Detector";
			iNumber=refID + "-908";
			cost=price_heart;
			break;
		case "porcelain":
			iName="White+Porcelain+Yo-God+God+Detector";
			iNumber=refID + "-909";
			cost=price_porcelain;
			break;
		case "cowboy":
			iName="Cowboy+Yo-God+God+Detector";
			iNumber=refID + "-911";
			cost=price_cowboy;
			break;
		case "baseball":
			iName="Baseball+Yo-God+God+Detector";
			iNumber=refID + "-912";
			cost=price_baseball;
			break;
		case "dunoon":
			iName="Dunoon+Thermometer+and+Yo-God+God+Detector";
			iNumber=refID + "-913";
			cost=price_dunoon;
			break;
		case "belle":
			iName="Southern+Belle+Yo-God+God+Detector";
			iNumber=refID + "-921";
			cost=price_belle;
			break;
		case "baby":
			iName="Baby+Pajamas+Yo-God+God+Detector";
			iNumber=refID + "-922";
			cost=price_baby;
			break;
		case "wood":
			iName="Crafted+Wood+Yo-God+God+Detector";
			iNumber=refID + "-923";
			cost=price_wood;
			break;
		case "woodsm":
			iName="Space+Age+Wood+Yo-God+God+Detector";
			iNumber=refID + "-924";
			cost=price_woodsm;
			break;

		case "brasspen":
			iName="Mahogany+and+Brass+Yo-God+God+Detector+Desk+Set";
			iNumber=refID + "-960bp";
			cost=price_brasspen;
			break;
		case "silverpen":
			iName="Silver+and+Acrylic+Yo-God+God+Detector+Desk+Set";
			iNumber=refID + "-960sp";
			cost=price_silverpen;
			break;
		case "globe":
			iName="Gemstone+Globe+Yo-God+God+Detector+Desk+Set";
			iNumber=refID + "-960glb";
			cost=price_globe;
			break;
		case "spade":
			iName="King+of+Hearts+Yo-God+God+Detector";
			iNumber=refID + "-960spd";
			cost=price_spade;
			break;
		case "liberty":
			iName="Optical+Fireworks+Yo-God+God+Detector";
			iNumber=refID + "-960lib";
			cost=price_liberty;
			break;

		case "tv":
			iName="Space+Age+Plastic+Yo-God+God+Detector";
			iNumber=refID + "-924p";
			cost=price_tv;
			break;
		case "eagle":
			iName="Eagle+vs.+Serpent+Yo-God+God+Detector";
			iNumber=refID + "-927";
			cost=price_eagle;
			break;
		case "eagle_2":
			iName="2-Pack, Eagle+vs.+Serpent+Yo-God+God+Detectors";
			iNumber=refID + "-927_2";
			cost=price_eagle_2;
			break;
		case "singleframe":
			iName="Single+Frame+Yo-God+God+Detector";
			iNumber=refID + "-928s";
			cost=price_singleframe;
			break;
		case "frame":
			iName="3-Piece+Frame+Set+Yo-God+God+Detector";
			iNumber=refID + "-928";
			cost=price_frame;
			break;
		case "monolith":
			iName="Mini-Monolith+Yo-God+God+Detector";
			iNumber=refID + "-925";
			cost=price_monolith;
			break;
		case "space":
			iName="Bauhaus+Yo-God+God+Detector";
			iNumber=refID + "-926";
			cost=price_space;
			break;
		case "dome":
			iName="Mini+Dome+Domini+Yo-God+God+Detector";
			iNumber=refID + "-930";
			cost=price_dome;
			break;
		case "virgin":
			iName="Our+Lady+of+Quite+Loopy+Yo-God+God+Detector";
			iNumber=refID + "-931";
			cost=price_virgin;
			break;
		case "turin":
			iName="Watch-of-Turin-Style+Yo-God+God+Detector";
			iNumber=refID + "-932";
			cost=price_turin;
			break;
		case "custom":
			iName="Custom+Yo-God+God+Detector+(Email+me+instructions,+please.)";
			iNumber=refID + "-999";
			cost=price_custom;
			break;
		case "3boxes":
			iName="3+Display+Boxes,+20+Yo-God+God+Detectors+each";
			iNumber=refID + "-350";
			cost=price_3boxes;
			break;
		case "palm":
			iName="Swami+Yo-God+God+Detector";
			iNumber=refID + "-931";
			cost=price_palm;
			break;
		case "grapes":
			iName="Grapes+of+Wrath+Yo-God+God+Detector";
			iNumber=refID + "-932";
			cost=price_grapes;
			break;
		case "baroque":
			iName="Baroque+Yo-God+God+Detector";
			iNumber=refID + "-933";
			cost=price_baroque;
			break;
		case "travel":
			iName="Travel+Yo-God+God+Detector";
			iNumber=refID + "-934";
			cost=price_travel;
			break;
		case "laura":
			iName="Bedside+Yo-God+God+Detector";
			iNumber=refID + "-936";
			cost=price_laura;
			break;
		case "teapot":
			iName="Teapot+Yo-God+God+Detector";
			iNumber=refID + "-937";
			cost=price_teapot;
			break;
		case "diver":
			iName="Diving+Bell+Yo-God+God+Detector";
			iNumber=refID + "-938";
			cost=price_diver;
			break;
		case "keychain":
			iName="Yo-God+God+Detector+Keychain";
			iNumber=refID + "-010";
			cost=price_keychain;
			break;
		case "prayer":
			iName="Illuminated+Yo-God+God+Detector";
			iNumber=refID + "-012";
			cost=price_prayer;
			break;
		case "figurine":
			iName="Figurine+Yo-God+God+Detector";
			iNumber=refID + "-712";
			cost=price_figurine;
			break;
		case "monkeys":
			iName="Monkey+Shriners+Yo-God+God+Detector";
			iNumber=refID + "-713";
			cost=price_monkeys;
			break;
		case "nativity":
			iName="Nativity+Scene+Yo-God+God+Detector";
			iNumber=refID + "-714";
			cost=price_nativity;
			break;
		case "angel":
			iName="Angelic+Yo-God+God+Detector";
			iNumber=refID + "-715";
			cost=price_angel;
			break;
		case "rooster":
			iName="Rooster+Family+Yo-God+God+Detector";
			iNumber=refID + "-716";
			cost=price_rooster;
			break;
		case "dragon":
			iName="Dragon+Yo-God+God+Detector";
			iNumber=refID + "-717";
			cost=price_dragon;
			break;
		case "motorcycle":
			iName="Motorcycle+Yo-God+God+Detector";
			iNumber=refID + "-718";
			cost=price_motorcycle;
			break;
		case "camel":
			iName="Arabian+Yo-God+God+Detector";
			iNumber=refID + "-719";
			cost=price_camel;
			break;
		case "monkey":
			iName="Monkey+Do+Yo-God+God+Detector";
			iNumber=refID + "-939";
			cost=price_monkey;
			break;
		case "deer":
			iName="Deer+God+Yo-God+God+Detector";
			iNumber=refID + "-940";
			cost=price_deer;
			break;
		case "horse":
			iName="Horse+Head+Yo-God+God+Detector";
			iNumber=refID + "-941";
			cost=price_horse;
			break;
		case "books":
			iName="Good+Book+Yo-God+God+Detector";
			iNumber=refID + "-942";
			cost=price_books;
			break;
		case "chickens":
			iName="Free+Range+Yo-God+God+Detector";
			iNumber=refID + "-943";
			cost=price_chickens;
			break;
		case "wicker":
			iName="Something+Wicker+Yo-God+God+Detector";
			iNumber=refID + "-944";
			cost=price_wicker;
			break;
		case "thermo":
			iName="Desk+Thermometer+Yo-God+God+Detector";
			iNumber=refID + "-961";
			cost=price_thermo;
			break;
		case "silver":
			iName="Metal+and+Glass+Pen+Desk+Set+Yo-God+God+Detector";
			iNumber=refID + "-962";
			cost=price_silver;
			break;
		case "solid":
			iName="Solid Mahogany+Desk+Set+Yo-God+God+Detector";
			iNumber=refID + "-963";
			cost=price_solid;
			break;
		case "glass":
			iName="Mahogany+and+Glass+Desk+Set+Yo-God+God+Detector";
			iNumber=refID + "-964";
			cost=price_glass;
			break;
		case "marble":
			iName="Rock+of+Ages+Yo-God+God+Detector";
			iNumber=refID + "-040";
			cost=price_marble;
			break;
		case "train":
			iName="This+Train+Yo-God+God+Detector";
			iNumber=refID + "-970";
			cost=price_train;
			break;
		case "crystal":
			iName="Crystal+Yo-God+God+Detector";
			iNumber=refID + "-980";
			cost=price_crystal;
			break;
		case "gimbal":
			iName="Gimbal+Yo-God+God+Detector";
			iNumber=refID + "-965";
			cost=price_gimbal;
			break;
		case "elephant":
			iName="Elephant+Altar+Yo-God+God+Detector";
			iNumber=refID + "-966";
			cost=price_elephant;
			break;
		case "arch":
			iName="Black+Arch+Yo-God+God+Detector";
			iNumber=refID + "-967";
			cost=price_arch;
			break;
		case "pillars":
			iName="Colonnade+Yo-God+God+Detector";
			iNumber=refID + "-968";
			cost=price_pillars;
			break;
		case "benedict":
			iName="Pope+Benedict+Frame+Yo-God+God+Detector";
			iNumber=refID + "-969";
			cost=price_benedict;
			break;
		case "black":
			iName="Black+Wood+Arch+Yo-God+God+Detector";
			iNumber=refID + "-970";
			cost=price_black;
			break;
		case "candle_large":
			iName="6-inch+Flag+Candle";
			iNumber=refID + "1776-1";
			cost=price_candle_large;
			break;
		case "candle_small":
			iName="4+1/2-inch+Flag+Candle";
			iNumber=refID + "1776-2";
			cost=price_candle_small;
			break;
		case "candle_pair":
			iName="Pair+of+large+and+small+Flag+Candles";
			iNumber=refID + "1776-2";
			cost=price_candle_pair;
			break;
		case "ironon_face_large":
			iName="Large+Iron-on+Transfer+(Face+of+God)+for+light-colored+fabric";
			iNumber=refID + "801f";
			cost=price_ironon_face_large;
			break;
		case "ironon_hand_large":
			iName="Large+Iron-on+Transfer+(Hand+of+God)+for+light-colored+fabric";
			iNumber=refID + "801h";
			cost=price_ironon_hand_large;
			break;
		case "ironon_face_large_dark":
			iName="Large+Iron-on+Transfer+(Face+of+God)+for+dark-colored+fabric";
			iNumber=refID + "801fd";
			cost=price_ironon_face_large;
			break;
		case "ironon_hand_large_dark":
			iName="Large+Iron-on+Transfer+(Hand+of+God)+for+dark-colored+fabric";
			iNumber=refID + "801hd";
			cost=price_ironon_hand_large;
			break;
		case "ironon_face_small":
			iName="3 Pocket-size+Iron-on+Transfers+(Face+of+God)+for+light-colored+fabric";
			iNumber=refID + "802f";
			cost=price_ironon_face_small;
			break;
		case "ironon_hand_small":
			iName="3 Pocket-size+Iron-on+Transfers+(Hand+of+God)+for+light-colored+fabric";
			iNumber=refID + "802h";
			cost=price_ironon_hand_small;
			break;
		case "ironon_face_small_dark":
			iName="3 Pocket-size+Iron-on+Transfers+(Face+of+God)+for+dark-colored+fabric";
			iNumber=refID + "802fd";
			cost=price_ironon_face_small;
			break;
		case "ironon_hand_small_dark":
			iName="3 Pocket-size+Iron-on+Transfers+(Hand+of+God)+for+dark-colored+fabric";
			iNumber=refID + "802hd";
			cost=price_ironon_hand_small;
			break;
		case "ironon_face_small_logo":
			iName="4+Pocket-size+Iron-on+Transfers+with+Yo-God+logo+(Face+of+God)+for+light-colored+fabric";
			iNumber=refID + "803f";
			cost=price_ironon_face_small_logo;
			break;
		case "ironon_hand_small_logo":
			iName="4+Pocket-size+Iron-on+Transfers+with+Yo-God+logo+(Hand+of+God)+for+light-colored+fabric";
			iNumber=refID + "803h";
			cost=price_ironon_hand_small_logo;
			break;
		case "button":
			iName="Yo-God+2-inch+button";
			iNumber=refID + "804-1";
			cost=price_button;
			break;
		case "3buttons":
			iName="3+Yo-God+2-inch+buttons";
			iNumber=refID + "804-3";
			cost=price_3_buttons;
			break;
		case "10buttons":
			iName="10+Yo-God+2-inch+buttons";
			iNumber=refID + "804-10";
			cost=price_10_buttons;
			break;
		default:
			iName="Yo-God+God+Detector,+Hand+of+God+image";
			cost=price_std;
			iNumber=refID + "-001";
	}

//	if (quantity=="halfoff")
	if (quantity=="giftsale")
	{
		iName="2+" + iName + escape("s+(Give+a+Gift+Sale)");
		iNumber = iNumber + "_gift";
		//cost= parseFloat((parseInt(cost) + 1)/2);
		cost= (parseFloat(cost) + 5).toString();
		cost=cost.substring(0,5);
	}
	var buyUrl="https://www.paypal.com/cart/add=" + quantity;
	buyUrl +="&business=payments%40yo-god.com";
	buyUrl +="&item_name=" + iName;
	buyUrl +="&item_number=" + iNumber;
	buyUrl +="&amount=" + cost;
	buyUrl +="&return=thanksyou.htm"
	buyUrl +="&cancel_return=cancel.htm"
//	window.open(buyUrl, 'cartwin','width=600,height=400,scrollbars,location,resizable,status');
	window.open(buyUrl, 'cartwin','width=600,height=400,scrollbars,resizable,status,location');
}

function viewCart()
{
	var viewUrl="https://www.paypal.com/cart/display=1"
	viewUrl +="&business=payments%40yo-god.com";
	//window.open(viewUrl, 'cartwin','width=600,height=400,scrollbars,location,resizable,status');
	window.open(viewUrl, 'cartwin','width=600,height=400,scrollbars,resizable,status');
}

function createOrderForm()
{
	document.form1.invoiceNumber.value=refID + "-" + invoiceNum;
	document.form1.submit();
}

function verifyOrderForm()
{
	//orderUrl="empty.htm";
	//newWin = window.open(orderUrl, 'orderWin','width=640,height=480,scrollbars,resizable,menubar,toolbar=no');
	//newWin.focus();
	return true;
}

function writeBanner(linkUrl)
{
	bannerImg="<img src=\"/images/yo-god_banner.gif\" height=60 width=468 border=0>";
	bannerCode="<center>"+bannerImg+"</center>"
	document.write(bannerCode);
}

function setInvoiceNumber()
{
	if (invoiceNum ==null || invoiceNum.length < 10)
	{
		var today = new Date();
		utc= Date.parse(today)+" ";
		rndNum="-"+(Math.round(Math.random() * 99) + 1)
		if (rndNum.length == 2) rndNum ="0"+rndNum;
		invoiceNum= utc.substring(3,7) + "-" + utc.substring(7,utc.length-3) + rndNum;
		setCookie("invoiceNum",invoiceNum,3600)
	}
}

function resetInvoiceNum()
{
	// called on unload of order form
	invoiceNum=""
	setCookie("invoiceNum","",3600)
	setInvoiceNumber();
}

function badApple()
{
	setCookie('badIP','yes',3600000);
	location.href='http://www.google.com';
}

function cookieWall()
{
	if (!hasCookies())
	{
		alert("Sorry, you must have browser cookies enabled to use this page.")
		history.back();
	}
}

function hasCookies()
{
	setCookie('visit','yes',600);
	if (getCookie("visit")=="yes") return true;
	else return false;
}

function writeHalfOffSale(kind, desc)
{
//	link="<TD class=\"smalltext\"><br><b>Back to School Sale, 50% off:</b> " + desc + "</td>";
//	link+="<td><a href=\"javascript:addToCart('" + kind + "','halfoff')\" onmouseover=\"mouseOverLinks('addtocart'); return true;\" onmouseout=\"mouseOutLinks()\">";
//	link+="<img src=\"images/addtocart.gif\" width=\"99\" height=\"22\" align=top border=0 align=right></a></td>";
	link="<TD class=\"smalltext\"><br><b>Give a Gift Sale, 2-for-1 plus $5:</b> " + desc + "</td>";
	link+="<td valign=bottom><a href=\"javascript:addToCart('" + kind + "','giftsale')\" onmouseover=\"mouseOverLinks('addtocart'); return true;\" onmouseout=\"mouseOutLinks()\">";
	link+="<img src=\"images/addtocart.gif\" width=\"99\" height=\"22\" align=top border=0 align=right></a></td>";
	document.write(link)
}

adCode="<br>"
adCode+="<center><a href=\"http://www.secondharvest.org/\" target=\"_blank\"> <img src=\"images/second_harvest.gif\" border=\"0\" alt=\"Dean says: Donate to a Food Bank\"></a>";
//adCode+="<br><span style=\"font-size:7pt;color:#000000;\">Dean says: \"Feed&nbsp;the&nbsp;Hungry\"</span>";
adCode+="</center><br>"
//adCode+="<center><a href=\"http://EvolveFISH.com/\" target=\"_blank\"> <img src=\"http://EvolveFISH.com/partners/evolve1.gif\" border=\"0\" alt=\"Products For Freethinkers\"></a></center>"
amazonDara="<center><iframe src=\"http://rcm.amazon.com/e/cm?t=yg09-20&o=1&p=8&l=as1&asins=1600101224&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=FFFFFF&bg1=C0C0C0&npa=1&f=ifr\" style=\"width:120px;height:240px;\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" frameborder=\"0\"></iframe></center>";
adCode+=amazonDara;
adCode+="<br>"
adCode+="<center><a href=\"http://www.lettertogod.net\" target=\"lettertogod\"><img src=\"/images/angellink2.gif\" height=89 width=99 border=0></a></center>"
adCode+="<br>"
function writeAdCode()
{
	document.write(adCode);
}
