/******************************************************************************
 *              Table Of Contents                                           ***
 *  section-name        | Purpose                                           ***
 *  --------------------|---------------------------------------------------***
 *  cookie-functions    | set/get/delete cookie functions                   ***
 *  mootools            | mootools v1.2                                     ***
 *  modalizer           | Creates modal - mainly for writeCart              ***
 *  writeCart           | Creates Floating Cart                             ***
 *  scframework         | SC Framework                                      ***
 *  testimonials        | Home page testimonials                            ***
 *  querystring         | Returns the query string                          ***
 *  encrypt             | Encryption                                        ***
 *  recently-viewed     | Recently Viewed                                   ***
 *  scImageEnlarge      | Image Enlarger - Solid Cactus                     ***
 *  options-realtime    | Options Realtime                                  ***
 *  global              | http://myaccount.spytown.com/globalScript.js      ***
 *  pd-head-tags        | inline                                            ***
 *  functions           | http://site.spytowne.com/js/functions.js          ***
 *  changeDisplay       | Changes Displays                                  ***
 *  mssImgMag           | Mss Image Magnifier                               ***
 *  validateEmail       | Validate Mss Map Email                            ***
 *  shipCalc            | Shipping Calculator                               ***
 *  pdRetrievePasswordCopyEmail  |  Get password for myaccount              ***
 *  mooquee             | Handles Marquee for 'events'                      ***
 ******************************************************************************
 *  To search for something type @section-name in order to locate it        ***
 ******************************************************************************/


/* @cookie-functions A collection of functions that deal with creating/getting/deleting cookies */
// create cookie assigning name, value and expiration days
function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/";}

// read cookie by name and list value - @readCookie
function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null;}

// delete cookie by name - @eraseCookie
function eraseCookie(name) { createCookie(name,"",-1); }

/*	Script: modalizer.js Author: Aaron Newton (aaron [dot] newton [at] cnet [dot] com) @modalizer */

/*
var Modalizer=new Class({
   defaultModalStyle:{display:'block',position:'absolute',top:0,left:0,'z-index':5000,'background-color':'#333',opacity:0.15},
   setModalOptions:function(options){
      this.modalOptions=$merge({width:(window.getScrollSize().x+0),height:(window.getScrollSize().y+0),elementsToHide:'select',hideOnClick:true,modalStyle:{},updateOnResize:true,layerId:'modalOverlay',onModalHide:$empty,onModalShow:$empty},this.modalOptions,options);return this
   },
   toElement:function(){if(!this.modalOptions.layerId)this.setModalOptions();return $(this.modalOptions.layerId)||new Element('div',{id:this.modalOptions.layerId}).inject(document.body)},
   resize:function(){if($(this)){$(this).setStyles({width:(window.getScrollSize().x+300),height:(window.getScrollSize().y+300)})}},
   setModalStyle:function(styleObject){this.modalOptions.modalStyle=styleObject;this.modalStyle=$merge(this.defaultModalStyle,{width:this.modalOptions.width,height:this.modalOptions.height},styleObject);if($(this))$(this).setStyles(this.modalStyle);return(this.modalStyle)},
   modalShow:function(options){
      this.setModalOptions(options);
      $(this).setStyles(this.setModalStyle(this.modalOptions.modalStyle));
      if(mssBrowser.Engine.trident4)$(this).setStyle('position','absolute');
      $(this).removeEvents('click').addEvent('click',function(){this.modalHide(this.modalOptions.hideOnClick)}.bind(this));
      this.bound=this.bound||{};
      if(!this.bound.resize&&this.modalOptions.updateOnResize){this.bound.resize=this.resize.bind(this);window.addEvent('resize',this.bound.resize)}
      if($type(this.modalOptions.onModalShow)=="function")this.modalOptions.onModalShow();
      this.togglePopThroughElements(0);$(this).setStyle('display','block');return this
   },
   modalHide:function(override){if(override===false)return false;this.togglePopThroughElements(1);if($type(this.modalOptions.onModalHide)=="function")this.modalOptions.onModalHide();$(this).setStyle('display','none');if(this.modalOptions.updateOnResize){this.bound=this.bound||{};if(!this.bound.resize)this.bound.resize=this.resize.bind(this);window.removeEvent('resize',this.bound.resize)}return this},
   togglePopThroughElements:function(opacity){if(mssBrowser.Engine.trident4||(mssBrowser.Engine.gecko&&mssBrowser.Platform.mac)){$$(this.modalOptions.elementsToHide).each(function(sel){sel.setStyle('opacity',opacity)})}}
});*/

/*	Script: modalizer.js Author: Aaron Newton (aaron [dot] newton [at] cnet [dot] com) */
/*
var Modalizer2=new Class({defaultModalStyle:{display:'block',position:'absolute',top:0,left:0,'z-index':5000,'background-color':'#333',opacity:0.15},setModalOptions:function(options){this.modalOptions=$merge({width:(window.getScrollSize().x+0),height:(window.getScrollSize().y+0),elementsToHide:'select',hideOnClick:true,modalStyle:{},updateOnResize:true,layerId:'modalOverlay',onModalHide:$empty,onModalShow:$empty},this.modalOptions,options);return this},toElement:function(){if(!this.modalOptions.layerId)this.setModalOptions();return $(this.modalOptions.layerId)||new Element('div',{id:this.modalOptions.layerId}).inject(document.body)},resize:function(){if($(this)){$(this).setStyles({width:(window.getScrollSize().x+300),height:(window.getScrollSize().y+300)})}},setModalStyle:function(styleObject){this.modalOptions.modalStyle=styleObject;this.modalStyle=$merge(this.defaultModalStyle,{width:this.modalOptions.width,height:this.modalOptions.height},styleObject);if($(this))$(this).setStyles(this.modalStyle);return(this.modalStyle)},modalShow:function(options){this.setModalOptions(options);$(this).setStyles(this.setModalStyle(this.modalOptions.modalStyle));if(mssBrowser.Engine.trident4)$(this).setStyle('position','absolute');$(this).removeEvents('click').addEvent('click',function(){this.modalHide(this.modalOptions.hideOnClick)}.bind(this));this.bound=this.bound||{};if(!this.bound.resize&&this.modalOptions.updateOnResize){this.bound.resize=this.resize.bind(this);window.addEvent('resize',this.bound.resize)}if($type(this.modalOptions.onModalShow)=="function")this.modalOptions.onModalShow();this.togglePopThroughElements(0);$(this).setStyle('display','block');return this},modalHide:function(override){if(override===false)return false;this.togglePopThroughElements(1);if($type(this.modalOptions.onModalHide)=="function")this.modalOptions.onModalHide();$(this).setStyle('display','none');if(this.modalOptions.updateOnResize){this.bound=this.bound||{};if(!this.bound.resize)this.bound.resize=this.resize.bind(this);window.removeEvent('resize',this.bound.resize)}return this},togglePopThroughElements:function(opacity){if(mssBrowser.Engine.trident4||(mssBrowser.Engine.gecko&&mssBrowser.Platform.mac)){$$(this.modalOptions.elementsToHide).each(function(sel){sel.setStyle('opacity',opacity)})}}});

*/

/* Handles the testimonials on the home page - @testimonials */
var uniqueArr = new Array();
var y;

function testimonials(classname,showtotal,arrayName){
	if(showtotal > arrayName.length)
		showtotal = arrayName.length;

	for(var i=0; i < showtotal; i ++){
		y = Math.ceil(Math.random()*arrayName.length);
		uniqueArr[i] = arrayName[y-1];
		arrayName.splice(y-1,1);
	}

	document.write("<ul class=\""+ classname +"\">");
	for(var i = 0; i < showtotal; i++){
		document.write("<li>");
		document.write(uniqueArr[i]);
		document.write("</li>");
	}
	document.write("</ul>");
}


/*
http://site.spytowne.com/map-price/QueryString.js
@querystring */

// This script is copywrited and is the soleproperty of 4D Internet Solutions, Inc.
// It may not be used, copied, sold or reproduced in any form without the express written consent of 4D Internet Solutions, Inc.

function QueryString(referrer) {
	if (referrer.indexOf("?") >= 0) {
		this.queryString = parseForQueryString(referrer);
		this.nameValuePairs = splitNameValuePairs(this.queryString);
	}

	this.getValue = function(name) {
		var value = "";

		if (this.nameValuePairs == null) {
			return(null);
		}

		for (var i = 0 ; i < this.nameValuePairs.length ; i++) {
			if (this.nameValuePairs[i].split("=")[0] == name) {
				value = this.nameValuePairs[i].split("=")[1];
				break;
			}
		}

		return(value);
	}

	this.getQueryString = function() {
		return(this.queryString) ;
	}

	this.getNames = function() {
		var names = new Array();

		if (this.nameValuePairs == null) {
			return(null);
		}

		for (var i = 0 ; i < this.nameValuePairs.length ; i++) {
			names[i] = this.nameValuePairs[i].split("=")[0];
		}

		return(names);
	}

	this.getValues = function() {
		var values = new Array();

		if (this.nameValuePairs == null) {
			return(null);
		}

		for (var i = 0 ; i < this.nameValuePairs.length ; i++) {
			values[i] = this.nameValuePairs[i].split("=")[1];
		}

		return(values);
	}

	function splitNameValuePairs(queryString) {
		var nameValuePairs = new Array()

		for (var i = 0 ; i < queryString.split("&").length ; i++) {
			nameValuePairs[i] = queryString.split("&")[i];
		}

		return(nameValuePairs);
	}

	function parseForQueryString(referrer) {
		var queryString = "";

		if (referrer.indexOf("?") >= 0) {
			queryString = referrer.substring(referrer.indexOf("?") + 1) ;
		}

		return(queryString);
	}
}




/*
http://lib.store.yahoo.net/lib/spytown/encrypt.js
@encrypt
*/
var cryptTable=new String(" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789	!@#$%^&*()`'-=[];,./?_+{}|:<>~");
var cryptLength=new Number(cryptTable.length-1)
var escapeChar=cryptTable.charAt(cryptLength);

var lineFeed="\n";
var doubleQuote='"';
var clearMessage=new Number(5000);

function encrypt(input, password){
var inChar, inValue, outValue;

var output="";
var arNumberPw = new Array();

var pwLength=password.length;
var inLength=input.length;

var stopStatus=Math.round(inLength/10);
var statusBar=0;

for (var pwIndex=0; pwIndex<pwLength; pwIndex++)
	{
	arNumberPw[pwIndex]=cryptTable.indexOf(password.charAt(pwIndex));
	}

for (var inIndex=0, pwIndex=0; inIndex<inLength; inIndex++, pwIndex++)
	{
	if (pwIndex==pwLength)
		{
		pwIndex=0;
		}

	inChar=input.charAt(inIndex)
	inValue=cryptTable.indexOf(inChar);

	if (inValue!=-1)
		{
		outValue=arNumberPw[pwIndex] ^ inValue;
		if (outValue>=cryptLength)
			{
			outValue=escapeChar+cryptTable.charAt(outValue-cryptLength);
			}
		else outValue=cryptTable.charAt(outValue);
		}
	else if (inChar=="\r")
		{
		outValue=escapeChar+escapeChar;
		if (input.charAt(inIndex+1)=="\n") inIndex++;
		}
	else if (inChar=="\n")
		{
		outValue=escapeChar+escapeChar;
		}
	else if (inChar==doubleQuote)
		{
		outValue=escapeChar+"'";
		}
	else
		{
		outValue=inChar;
		}

	output+=outValue;

	}

return output;
}

function decrypt(input, password){
var inChar, inValue, outValue, escape=false;

var output="";
var arNumberPw = new Array();

var pwLength=password.length;
var inLength=input.length;

var stopStatus=Math.round(inLength/10);
var statusBar=0;

for (var pwIndex=0; pwIndex<pwLength; pwIndex++)
	{
	arNumberPw[pwIndex]=cryptTable.indexOf(password.charAt(pwIndex));
	}

for (var inIndex=0, pwIndex=0; inIndex<inLength; inIndex++, pwIndex++)
	{
	if (pwIndex>=pwLength)
		{
		pwIndex=0;
		}

	inChar=input.charAt(inIndex);
	inValue=cryptTable.indexOf(inChar);

	if (inValue==-1)
		{
		outValue=inChar;
		}

	else if (escape)
		{
		if (inValue==cryptLength)
			{
			outValue=lineFeed;
			inValue=-1;
			}
		else if (inChar=="'")
			{
			outValue=doubleQuote;
			inValue=-1;
			}
		else
			{
			inValue+=cryptLength;
			}
		escape=false;
		}
	else if (inValue==cryptLength)
		{
		escape=true;
		pwIndex--;
		outValue="";
		inValue=-1;
		}

	if (inValue!=-1)
		{
		outValue=cryptTable.charAt(arNumberPw[pwIndex] ^ inValue);
		}

	output+=outValue;

	}

return output;
}



/*
http://lib.store.yahoo.net/lib/spytown/recently-viewed.js
@recently-viewed
*/
// JavaScript Document
var expDays=60;
var expDate = new Date();
expDate.setTime(expDate.getTime()+(expDays*24*60*60*1000))

/*var writeck = decrypt("	G0wcIG2nr PDwbAzIP0~IxJzc6CeRy0e~E2G4BB eCe+~h~~SCwBe FKr~dMA~b9KnKwvD6~fYFMB2-AnLw0D9wr~dh2y5y~ElMA~bQOTwO GwJ~ElDyK y~ElCDNBFeIy ~b EZOM 9FJ~~Uh2y5yy~Jt~'BwEsEywlFKr~S~']~~hfPzt.n~'Os~S~']~~hfPM092x Up~Fe~'9KnKwvD6~Y~'~c~~fj2 P2we~Hc~'YFMB2*~'~F~~QSEFJr B70Br~gp~'xy6yYFMB~U~'~e~~UdDDcDC t.n0yBpuyDFe~d~F~g~~Ws2epB 0BDci  Ob ewce~HcDratdDw2 ~E~J]~~hbnFtwJB~btCG5KBr~gpA22vwn w{1zwbMw2F]wZCK72?~e~~UdDDcwcFt.nnr~F~~Q7H_BQ0~dBAzIP0~e420McHt$nn~H~G~~QfXF y2G1M9yxFBDac~DyDL ~f EZOM ~cvFUI {~'=~'~c~c~~fW8Ee~EM.c=O~K2G1M9yxFBDa]JrBOwJ=O~H~e~J(~~hS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c~Dy2G1M9y8wI n'r~'~J~'e~gcBQ0s1A3Or~c~~fWhSLIN{2uOdDC+~~hSLUQfDBwrB VFBKxFBDa]AYLMB2_wbFB  y7ZG~ho~D=~~LUQfWwyt0FwgyyTqByyt~gbBC8K8B~dDL qzEVIw+W~~SLUQuywrcC DNIEfHGtn;re0y  ykc0IdDw2 ~aH  7BQp~U.n	EBm02aOyt0Fw99yB0ve~ecNZaiD t9r2w2FKOrawAn*re0y  ykc0IdDw2 ~aH  7BQ~c~~fWhS~~UQfW8Ee~EM.c=O~KDGwy63Z4L1Y=O~H~e~J(WhSL~~QfWhSYwCxqzEVIwe~Hc r2w2FTBrMuyDFe~fI~D=E2JPD~I~'~H~'~H~F~~QfWhSsCyvOBDc~ay1A3Orp~Fe0zEVIwQy5yy~et7n'r~'~J~'e~gcFnGCbAzIP0~Co~Jc~cy~'~ge2uFPFwx~H~'r~HpwsBY2c0~ewAZgm4 yK0M~d~Ft)n~'~ey 0wJ;~h~'~c~~fWhS~N~~QfWh~~LUQ*26Ar~f~~fWhSsCyvOBDc~ay1A3Orp~Fe0zEVIwQy5yy~et~'c;~'y~etwJBuZCK72=~~LUQ*~~hS~N0Hx2`~~LUQAA CT0Fw~c EZOM n;rtCG5KBhnMwe~gc~'F~J~'e~gcBQ0s1A3Or~c~~fW^~~~N~~","encrypt");
eval(setck);


//////////////
function getCookie(cookieName){
   var cookieBeg, cookieEnd;
   var cookieJar = document.cookie;

   //look for the cookie//
   cookieBeg = cookieJar.indexOf(cookieName,0);
   if(cookieBeg < 0)return null;
   else cookieBeg +=  cookieName.length + 1;

   //get value of cookie//
   cookieEnd = cookieJar.indexOf(";",cookieBeg);
   if(cookieEnd < 0)cookieEnd = cookieJar.length;

   //return value of cookie//
   return unescape(cookieJar.substring(cookieBeg,cookieEnd));
}


function setCookie(name,value,expires,path,domain,secure){
   var theDate = new Date();
   theDate.setTime(theDate.getTime() + expires);
   var expCrumb = ((expires == null) ? "" : ("; expires=" + theDate.toGMTString()));
   var pathCrumb = ((path == null) ? "" : ("; path=" + path));
   var domainCrumb = ((domain == null) ? "" : ("; domain=" + domain));
   var secureCrumb = ((secure == true) ? "; secure" : "");
   document.cookie = name + "=" + escape(value) + expCrumb + pathCrumb + domainCrumb + secureCrumb;
}


function setQuickCookie(name,value){
   document.cookie = name + "=" + escape(value);
}

function writeCookie(showHowMany,colperrow){
	var name,id,imageurl,price,saleprice,Lname,Lid,Limageurl,Lprice,Lsaleprice,cookieVal
	Lname = "productName:";
	Lid = "id:";
	Limageurl = "imageurl:";
	Lprice = "price:";
	Lsaleprice = "salepric:";
	var nvp = new Array();
	var recentItemArray = new Array();
	var the_cookie = unescape(document.cookie);
	var ctr = 0 ;
	if(the_cookie.length > 0){
		var cookieArray = the_cookie.split(";");
		for(i=0;i<cookieArray.length;i++){
//			if(cookieArray[i].indexOf(cookieName) > -1){
//				recentItemArray[ctr] = cookieArray[i];
//				ctr = ctr + 1;
//			}
		}
		if(recentItemArray.length>0){
			showHowMany = recentItemArray.length >= showHowMany ? showHowMany : recentItemArray.length;
			colperrow = recentItemArray.length >= colperrow ? colperrow : recentItemArray.length;

			totalRows = Math.ceil(showHowMany/colperrow);
			endPos =-1;
			colWidth = Math.ceil(100/colperrow);

			for(i = 0; i < totalRows; i++){
				startPos = endPos + 1;
				endPos = endPos + colperrow;
				document.write("<tr>");
				for(a = startPos; a <= endPos; a++){
					if(a >= recentItemArray.length)
						document.write("<td align=center>&nbsp;</td>");
					else{
						name = "";
						id = "";
						imageurl = "";
						price = "";
						saleprice = "";
						cookieVal = unescape(recentItemArray[a]);
						nvp = cookieVal.split("=");
						nvp = nvp[1].split("|");
						for(k=0;k<nvp.length;k++){
							if(nvp[k].indexOf("productName:") > -1)
								name = nvp[k].substr(Lname.length);
							if(nvp[k].indexOf("id:") > -1)
								id = nvp[k].substr(Lid.length);
							if(nvp[k].indexOf("imageurl:") > -1)
								imageurl = nvp[k].substr(Limageurl.length);
							if(nvp[k].indexOf("price:") > -1)
								price = nvp[k].substr(Lprice.length);
							if(nvp[k].indexOf("salepric:") > -1)
								saleprice = nvp[k].substr(Lsaleprice.length);
						}
						document.write("<td width='" + colWidth +"%' align=center valign=top>");
						document.write("<table width='100%' border='0' cellpadding='1' cellspacing='1'><tr><td valign=middle align=center height=80>");
						document.write("<a href=" + id + "><img src=" + imageurl + " border=0></a></td></tr>");
						document.write("<tr><td valign=top align=center><a href=" + id + "><b>" + name + "</b></a></td></tr>");
						if(price != "" && price != "0"){
							document.write("<tr><td align=center class='recent-items-price'>");
							if(saleprice != "" && saleprice != "0"){
								document.write(priceText + " ");
								if(showStrikeThrough)
									document.write("<strike>");
							}else
								document.write("<b>");

							document.write("$" + price);
							if(saleprice == "" || saleprice == "0")
								document.write("</b>");
							if(saleprice != "" && saleprice != "0" && showStrikeThrough)
									document.write("</strike>");
							document.write("</td></tr>");
						}
						if(saleprice != "" && saleprice != "0")
							document.write("<tr><td align=center class='recent-items-saleprice'><span>" + salePriceText + "<strong>$" + saleprice + "</strong></span></td></tr>");
						document.write("</table></td>");
						//addedlater
						if(a != endPos)
							document.write("<td width=1 bgcolor='#CCCCCC'><img src=/lib/spytown/spacer.gif width=1 height=1></td>");
					}
				}
				document.write("</tr>");
			}
		}
	}
}

/*
http://lib.store.yahoo.net/lib/spytown/scImageEnlarge.js
@scImageEnlarge
*/
var Y,X; function o0(O0){var l0=SC.getTagArray("\x53\x45LE\x43T"); for (var i=0; i<l0.length; i++){if (O0=="sh\x6fw"){var i0=l0[i].className.replace("\x68\x69deSelec\x74",""); SC.setAttributes(l0[i],"cla\x73sNa\x6de",i0.trim( )); }else if (l0[i].className.indexOf("\x68\x69deSel\x65ct")==-1){var i0=(l0[i].className)?l0[i].className+"\x20\x68ideSel\x65ct": "\150\151\x64eSele\x63t"; SC.setAttributes(l0[i],"\x63l\x61ssName",i0); }}}function scPreviewInsets( ){var I0=SC.getObj("s\x63Im\x67\102\x6fx-i\x6esetPr\x65vi\x65w"); if (arguments.length>0){var o1=SC.getTagArray("img",I0); for (var i=0; i<o1.length; i++){if (i==arguments[0])SC.showHide(o1[i],"\x62\x6cock"); else SC.showHide(o1[i],"\156\157\x6ee"); }O1(I0,"\x62l\x6fck",0,0); }else {SC.showHide(I0,"\x6e\x6fne"); }}function l1( ){SC.showHide(X,"n\x6fne"); SC.showHide(Y,"none");o0("sh\x6fw"); }function scImgEnlargeInit( ){var i1=SC.getObj("scP\x61ge-\x69nsets"); var scMainImage=SC.getObj("\163\x63M\x61inImag\x65"); if (i1 || scMainImage || scMultiMain){SC.I1( ); Y=SC.getObj("\163\x63I\x6dgB\x6fx"); X=SC.getObj("\163cW\x72ap\x70e\x72"); if (X)X.onclick=l1; }}function o2( ){var O2=0,l2=0,i2=0,I2=0; var o3=document.body; var O3=document.documentElement; if (typeof(window.innerWidth)=='nu\x6dbe\x72'){O2=window.innerWidth-027; l2=window.innerHeight-027; }else if (O3 && O3.clientWidth){O2=O3.clientWidth; l2=O3.clientHeight; }else if (o3 && o3.clientWidth){O2=o3.clientWidth; l2=o3.clientHeight; }if (O3 && O3.scrollWidth)I2=O3.scrollWidth; else if (o3.scrollWidth)I2=o3.scrollWidth; else if (o3.offsetWidth)I2=o3.offsetWidth; if (O3 && O3.scrollHeight)i2=O3.scrollHeight; if (o3.scrollHeight && (o3.scrollHeight>i2))i2=o3.scrollHeight; if (o3.offsetHeight && (o3.offsetHeight>i2))i2=o3.offsetHeight; if (i2<l2)i2=l2; if (I2<O2)I2=O2; this.l3=i2; this.i3=I2; this.I3=l2; this.o4=O2; }function O4( ){var o3=document.body; var O3=document.documentElement; var l4=0,i4=0; if (typeof(window.pageYOffset)=='numb\x65\x72'){i4=window.pageYOffset; l4=window.pageXOffset; }else if (o3 && (o3.scrollLeft || o3.scrollTop)){i4=o3.scrollTop; l4=o3.scrollLeft; }else if (O3 && (O3.scrollLeft || O3.scrollTop)){i4=O3.scrollTop; l4=O3.scrollLeft; } this.x=l4; this.y=i4; }function O1(I4,display,o4,I3,top,left){I4.style.top=(top)?top:I4.style.top; I4.style.left=(left)?left:I4.style.left; I4.style.height=(I3==0)?"\x61\x75to":I3; I4.style.width=(o4==0)?"auto":o4; SC.showHide(I4,display); }function scWinResize( ){var i1=SC.getObj("\x73c\x50age-ins\x65ts"); var scMainImage=SC.getObj("scMa\x69nIm\x61ge"); if (i1 || scMainImage || scMultiMain){if (Y.style.display=="block"){var o5=SC.getTagArray("img",Y); var O5=(SC.getObj("scIm\x67Ti\x74le"))?SC.getObj("\x73\x63ImgTitl\x65").firstChild.nodeValue: ""; var l5=SC.createElement("\x61","href",o5[0].src,"t\x69tle",O5); scShowImg(l5,o5[0].height,o5[0].width);}}}function i5(I5){var o6=I5; if (o6.indexOf("\x66\x75nctio\x6e anon\x79mous")>-1){o6=o6.replace(/\x0a/g,""); o6=o6.replace("fu\x6ecti\x6fn anon\x79mous(\x29{","").replace("\x7d",""); }return o6; }SC.I1= function ( ){var i1=SC.getObj("\x73\x63\120\x61g\x65-ins\x65ts"); var O6=SC.getObj("s\x63Img\x4fveral\x6c"); var l6=SC.createElement("\x64\x69v","\x69d","\x73\x63ImgBo\x78"); var i6=SC.createElement("\x64\x69\166","classNam\x65","\x72\x65lativ\x65Pos"); var I6=SC.createElement("a","txt","x","href","\x6a\x61vascr\x69pt:vo\x69d(0);","c\x6cas\x73Name","\x63\x6cose","titl\x65","\x63\x6cose"); I6.onclick=l1; SC.appendElement(i6,I6); SC.createAppend("div",i6,"i\x64","scImgB\x6fx-m\x61inImg"); if (i1){var o7=SC.createElement("\x64iv","\x63\x6cassName","absolut\x65Pos"); var O7=i1.cloneNode( true); for (var i=0; i<O7.childNodes.length; i++){if (O7.childNodes[i].nodeName!="A")O7.replaceChild(document.createTextNode(""),O7.childNodes[i]); }SC.setAttributes(O7,"\x69d","sc\x49m\x67Box-in\x73etPrev\x69ew"); SC.appendElement(o7,O7); var l7=O7.cloneNode( true); SC.setAttributes(l7,"id","scIm\x67\x42ox-in\x73ets"); var i7=SC.createElement("a","\x74\x78t","\x43\x4cOSE","hr\x65f","javas\x63r\x69pt:voi\x64(0);","\x63l\x61ssName","abs\x43los\x65","tit\x6ce","\x43\x4cOSE"); i7.onclick=l1; var I7=SC.getTagArray("\x61",l7); for (var i=0; i<I7.length; i++){var oLink=I7[i]; eval("\x6f\x4cink.o\x6emouse\x6fver =\x20func\x74ion()\x7b\011sc\x50rev\x69ew\x49ns\x65ts\x28"+i+"\x29\x7d;"); oLink.onmouseout=scPreviewInsets; for (var j=0; j<oLink.childNodes.length; j++)oLink.replaceChild(document.createTextNode(i+1),oLink.childNodes[j]); }SC.appendElement(l7,i7); }SC.appendElement(l6,i6); if (i1){SC.appendElement(i6,o7); SC.appendElement(l6,l7); }SC.createAppend("div",O6,"\x69\x64","\x73cW\x72apper","title","C\x6cic\x6b To Clo\x73e"); SC.appendElement(O6,l6); };function scShowImg(I4,I3,o4){var o8=SC.getObj("scImgBox\x2dma\x69nImg"); if (o8){var O8=SC.getObj("sc\x49mgT\x69tle"); if (O8)O8.parentNode.removeChild(O8); if (I4.title){var l8=SC.createElement("\x64\x69v","\164\170\x74",I4.title,"\x69\x64","sc\x49\x6d\x67\x54\x69t\x6ce"); o8.parentNode.insertBefore(l8,o8); var O8=SC.getObj("scImgTi\x74l\x65"); O8.style.width=o4+"\x70\x78"; }var i8=SC.createElement("\151\155\x67"); SC.setAttributes(i8,"\x73rc",I4.href,"\x77i\x64th",o4,"height",I3); o8.className=""; i8.onload= function ( ){ this.parentNode.className="\x73ch\x69debg";};var I8=SC.getTagArray("im\x67",o8); if (I8.length>0){var o9=I8[0]; o8.replaceChild(i8,o9); }else SC.appendElement(o8,i8);O1(Y,"block",0,0,"\0551000px","\x2d\x31000p\x78"); var O9=new o2( ); var l9=new O4( ); var i9=Y.offsetHeight; var I9=Y.offsetWidth; var oa=(i9>O9.I3)?i9-O9.I3+024: 0; var Oa=(i9>O9.l3)?(O9.l3+oa)+"\160\x78":O9.l3+"px"; var la=(I9>O9.o4)?(O9.i3+(I9-O9.o4)+050)+"\x70\x78": "\x31\x300%"; var top=(O9.I3-i9>0 || (l9.y+i9)<O9.l3)?((O9.I3-i9)/2)+l9.y: ((O9.l3-i9)>0)?O9.l3-i9: 024; var left=(O9.o4-I9>0)?((O9.o4-I9)/2): 024; top=(top<0)?024:Math.round(top); left=(left<0)?024:Math.round(left); o0("\x68i\x64e"); O1(Y,"\x62l\x6f\143\x6b",0,0,top+"\x70\x78",left+"p\x78"); O1(X,"\x62l\x6f\143\x6b",la,Oa,0,0); }else {window.location.href=I4.href; }}



/* Options Realtime - @options-realtime*/
function FIND(item) {
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function round_decimals(original_number, decimals) {
    var result1 = original_number * Math.pow(10, decimals)
    var result2 = Math.round(result1)
    var result3 = result2 / Math.pow(10, decimals)
    return pad_with_zeros(result3, decimals)
}

function pad_with_zeros(rounded_value, decimal_places) {
    var value_string = rounded_value.toString()
    var decimal_location = value_string.indexOf(".")
    if (decimal_location == -1) {
        decimal_part_length = 0
        value_string += decimal_places > 0 ? "." : ""
    }
    else {
        decimal_part_length = value_string.length - decimal_location - 1
    }
    var pad_total = decimal_places - decimal_part_length
    if (pad_total > 0) {
        for (var counter = 1; counter <= pad_total; counter++)
            value_string += "0"
        }
    return value_string
}

function toDollarsAndCents(n) {
  var s = "" + Math.round(n * 100) / 100
  var i = s.indexOf('.')
  if (i < 0) return s + ".00"
  var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3)
  if (i + 2 == s.length) t += "0"
  return t
}

function changeQty(id){
  var loc = document.getElementById(id);
  if(loc){
    if(loc.value == 0){
      loc.value = 1;
    }
  }
}


function get_price(thisform,thisinput,num){
	var thedifference = 0;
	var pricevalAr = new Array();
	var direction = "add";
	var modPrice = "";
	var preOptName = "";
	var firstLoop = false;

	if(num == null){
    num = '';
  }


	if(thisinput){
		var isMulti = thisinput.name.indexOf("vwattr");
		var isMulti2 = thisinput.name.indexOf("vwquantity");

		if(isMulti >= 0 ){
			var multiadd = false;
			underScorePos = thisinput.name.indexOf("_");
			preOptName = thisinput.name.substr(0,underScorePos + 1);
		}else
			var multiadd = true;

	}else
		var firstLoop = true;

	if(!firstLoop){
		var price = eval(preOptName + "base"+num+"Price");
		if(price != "")
			price = parseFloat(price);
		else
			price = 0;
	}

	for(i=0;i<thisform.elements.length;i++){
		priceval = 0;
		pricevalAr = 0;

		if(thisform.elements[i].type == "select-one" && (multiadd || thisform.elements[i].name.indexOf(preOptName) > -1)){
				priceval = thisform.elements[i].options[thisform.elements[i].selectedIndex].value

				if(priceval.indexOf("(+$") > -1) {
					pricevalAr = priceval.split("(+$");
					direction = "add";
				}else if(priceval.indexOf("(+") > -1) {
					pricevalAr = priceval.split("(+");
					direction = "add";
				}else if(priceval.indexOf("(-") > -1) {
					pricevalAr = priceval.split("(-");
					direction = "sub";
				}else if(priceval.indexOf("(-$") > -1) {
					pricevalAr = priceval.split("(-$");
					direction = "sub";
				}else if(priceval.indexOf("(*") > -1) {
					pricevalAr = priceval.split("(*");
					direction = "mult";
				}
				if(pricevalAr.length > 1){
					priceval = pricevalAr[1].split(")");
					priceval = parseFloat(priceval[0]);
				} else {
					priceval = 0;
				}

				if(firstLoop){
					isMulti = thisform.elements[i].name.indexOf("vwattr");

					if(isMulti >= 0){
						underScorePos = thisform.elements[i].name.indexOf("_");
						preOptName = thisform.elements[i].name.substr(0,underScorePos + 1);
					}
					var price = eval(preOptName + "base"+num+"Price");
				}
	      addPrice = priceval;
				if(direction == "add")
					price = price + priceval
				else if(direction == "sub")
					price = price - priceval
				else {
					thedifference = (price * priceval) - price;
					price = price * priceval;
					if(thisinput) thisinput.value = "(+" + thedifference + ")";
				}
			} else {
				if(thisform.elements[i].type == "radio" && (multiadd || thisform.elements[i].name.indexOf(preOptName) > -1 || firstLoop)){
					if(thisform.elements[i].checked){
						priceval = thisform.elements[i].value;
						fullinput = priceval;
						if(priceval.indexOf("(+$") > -1) {
							pricevalAr = priceval.split("(+$");
							direction = "add";
						} else if(priceval.indexOf("(+") > -1) {
							pricevalAr = priceval.split("(+");
							direction = "add";
						} else if(priceval.indexOf("(-") > -1) {
							pricevalAr = priceval.split("(-");
							direction = "sub";
						}else if(priceval.indexOf("(-$") > -1) {
							pricevalAr = priceval.split("(-$");
							direction = "sub";
						}else if(priceval.indexOf("(*") > -1) {
							pricevalAr = priceval.split("(*");
							direction = "mult";
						}
						if(pricevalAr.length > 1){
							priceval = pricevalAr[1].split(")");
							priceval = parseFloat(priceval[0]);
						}else
							priceval = 0;

						if(firstLoop){
							underScorePos = thisform.elements[i].name.indexOf("_");
							preOptName = thisform.elements[i].name.substr(0,underScorePos + 1);
							var price = eval(preOptName + "base"+num+"Price");
						}
	          addPrice = priceval;
						if(direction == "add")
							price = price + priceval
						else if(direction == "sub")
							price = price - priceval
						else {
							thedifference = (price * priceval) - price;
							price = price * priceval;
							if(thisinput) thisinput.value = "(+" + round_decimals(thedifference,2) + ")";
						}


						if(firstLoop){
            	price = toDollarsAndCents(price);
            	modPrice = modPrice + "$" + price;
							if (document.getElementById(preOptName + "dispprice"))
								document.getElementById(preOptName + "dispprice").innerHTML = modPrice;
							modPrice = "";
						}
				}
			}
		}
	}
	if(thisinput || !firstLoop){
	  price = toDollarsAndCents(price);
		modPrice = modPrice + "$" + price;
		  if (document.getElementById(preOptName + "dispprice"))
			 document.getElementById(preOptName + "dispprice").innerHTML = modPrice;
	}
	return price;
}

function showPriceQty(num){
    if (num == null){
      num = 0;
    }
    var price = 0;
    for(i = 0; i<=num; i++){
    var cost = 0;
      if(i == 0 && !(document.getElementById('mss-quantity-number'))){
       var qty = parseInt(document.getElementById('mss-quantity-td').innerHTML);
      } else {
        if(i == 0){
          if(document.itemForm.vwquantity0){
            var qty = document.itemForm.vwquantity0.value;
          } else {
            var qty = document.itemForm.vwquantity.value;
          }

          // START - unit pricing
            var costs = salePrice.split(" ");
            costs[0] = costs[0].replace("(", "");
            costs[costs.length - 1] = costs[costs.length - 1].replace(")", "");
            for(var k = 0; k<costs.length; k++){
              costs[k] = (parseInt(parseFloat(costs[k]) * 100))/100;
            }
            for(var j = 1; j < costs.length; j+=2){
              if(j+2 < costs.length){
                if(costs[j+2]>qty && costs[j]<=qty){
                  cost = (costs[j+1]/costs[j]);
                  break;
                } else if(costs[j]>qty){
                  cost = costs[0];
                  break;
                }
              } else {
                cost = (costs[j+1]/costs[j]);
                break;
              }
            }

            if(!costs[1]){
              cost = costs[0];
            }

            if(costs[0] != option0Price){
              cost += (option0Price - costs[0]);
            }

          // END - unit pricing
        }
        else {
          var qty = eval("document.itemForm.vwquantity"+i+".value");
        }
      } // end ifelse


      if (cost == 0){
        cost = eval("option"+i+"Price");
      }

      price +=  (cost * qty);
    } // end for loop

	  price = toDollarsAndCents(price);
		var modPrice = "$" + price;

		if (document.getElementById("mss-update-price")){
			document.getElementById("mss-update-price").innerHTML = "Updated Price:<br /><span id=\"mss-up-price\">"+modPrice+"</span>";
		}
		if(document.getElementById('mss-free-shipping-coupon-image')){
   		if(price >= 500){
            document.getElementById('mss-free-shipping-coupon-image').style.display='block';
         } else {
            document.getElementById('mss-free-shipping-coupon-image').style.display='none';
         }
      }
}


/* Originally from http://myaccount.spytown.com/globalScript.js - @global */


//**********************************************************
//**************** UTILITY FUNCTIONS ***********************
//**********************************************************
function popIt(width, height, scrollbars){
	if(!width) width = "640";
	if(!height) height = "480";
	if(!scrollbars) scrollbars = 1;
	var windowString = 'width=' + width + ',height=' + height + ',resizable=1,status=0,toolbar=no,scrollbars=' + scrollbars + ',scrolling=auto';
	var popItWindow = window.open('',"popIt", windowString);
	return false;
}
function encodeOptions(input) {
	input = String(input).replace(/&/g, "!!amp!!");
	input = String(input).replace(/=/g, "!!eq!!");
	return input;
}

//**********************************************************
//**************** ADD TO FAVORITES BUTTON *****************
//**********************************************************
function addToFavorites(orderForm) {
	var optionString = '';
	var optionList = new Array();
	for(var i=0;i<orderForm.elements.length;i++) {
		if(orderForm.elements[i].type == "select-one" || String(orderForm.elements[i].name).indexOf("vw-inscription-") > -1) {
			var option = new Object();
			option.name = orderForm.elements[i].name;
			option.value = orderForm.elements[i].value;
			optionList.push(option);
		}
	}
	for (i = 0; i <= optionList.length - 1; i++) optionString += encodeOptions(optionList[i].name) + "=" + encodeOptions(optionList[i].value) + "&";
	optionString = optionString.substring(0, optionString.length - 1);	//*** TRIM TRAILING "&"
	popIt(394,400,0);
	var myInput = document.createElement("INPUT");
	myInput.type = "hidden";
	myInput.name = "product-option-list";
	myInput.value = optionString;
	orderForm.appendChild(myInput);
	var tempAction = orderForm.action;
	var tempTarget = orderForm.target;
	orderForm.action="http://myaccount.spytown.com/favoritesAddItem.php";
	orderForm.target="popIt";
	orderForm.submit();
	orderForm.action = tempAction;
	orderForm.target = tempTarget;
	orderForm.removeChild(myInput);
	return false;
}
//**********************************************************
//****** COPY BILLING FROM SHIPPING ON REGISTRY FORM *******
//**********************************************************
function copyBillingInfo(form) {
	if (form.copy.checked) {
		//**********************************************************
		//********* SET SHIPPING FIELDS AS VARIABLES ***************
		//**********************************************************
		try {var billCompany = form.billCompany.value;} catch(e) {}
		var billFirstName = form.billFirstName.value;
		var billLastName = form.billLastName.value;
		var billAddress1 = form.billAddress1.value;
		var billAddress2 = form.billAddress2.value;
		var billCity = form.billCity.value;
		var billState = form.billState.value;
		var billZip = form.billZip.value;
		var billPhone = form.billPhone.value;

		//**********************************************************
		//****** POPULATE SHIPPING FIELDS WITH BILLING DATA ********
		//**********************************************************

		try {form.shipCompany.value = billCompany;} catch(e) {}
		form.shipFirstName.value = billFirstName;
		form.shipLastName.value = billLastName;
		form.shipAddress1.value = billAddress1;
		form.shipAddress2.value = billAddress2;
		form.shipCity.value = billCity;
		form.shipState.value = billState;
		form.shipZip.value = billZip;
		form.shipPhone.value = billPhone;

	}else {

		//**********************************************************
		//******************* RESET BILLING DATA *******************
		//**********************************************************
		try {form.shipCompany.value = "";} catch(e) {}
		form.shipFirstName.value = "";
		form.shipLastName.value = "";
		form.shipAddress1.value = "";
		form.shipAddress2.value = "";
		form.shipCity.value = "";
		form.shipState.value = "";
		form.shipZip.value = "";
		form.shipPhone.value = "";
	   }
}



/* Change Display  @changeDisplay*/
function changeDisplay(off, on) {
	if (off && off != ""){
		document.getElementById(off).style.display = 'none';
		}
	if (on && on != ""){
		document.getElementById(on).style.display = 'block';
		}
}


/*
http://site.spytowne.com/mss/mssImgMagnify2.0.js
@mssImgMag

var mssImgMagnify = new Class({
	initialize: function(element, options) {
		this.options = Object.extend({
			footercolor:		'#000',
			captioncolor:		'#fff',
			caption:			'',
			width:				400,
			thumbWidth:			200,
			hideOnLaunch:		true
		}, options || {});
		this.el = $(element);
		this.elid = element;
		this.el.setStyle('width', this.options.width + 'px');
		this.skipInit = false;
		this.frameRatio = this.options.frameRatio;

		this.loading = new Element('div', {'id': this.elid + '_footer'});
		this.loading.set('html', 'Loading Magnified Image...');
		this.loading.injectInside(this.el);

		if(this.options.caption == ''){	this.options.caption = this.picturename;}

		this.image = $('mssMagImg');
		this.image.setStyles({'left': '-10000px', 'position': 'relative', 'display':'block'});
		this.picturename = this.image.getProperty('src');
		this.continueInit();
	},

	continueInit: function(){
		if(! this.skipInit){
			this.imageWidth = this.image.getSize().x;
			this.imageHeight = this.image.getSize().y;
			this.frameRatio = this.imageWidth / this.options.width;
			this.ratio = this.imageWidth / this.options.thumbWidth;
			this.whratio = this.imageWidth / this.imageHeight;
			this.thumbWidth = this.options.thumbWidth;
			this.thumbHeight = this.imageHeight / this.ratio;
			this.orientation=(this.imageWidth > this.imageHeight)?'landscape':((this.imageWidth < this.imageHeight)?'portrait':'square');
			this.longside = (this.orientation=='landscape') ? this.imageWidth / this.ratio / this.frameRatio : this.imageHeight / this.ratio / this.frameRatio ;
			this.shortside = (this.orientation=='landscape') ? this.longside / this.whratio : this.longside * this.whratio;
			this.frameHeight = (this.orientation=='landscape') ? this.shortside: this.longside;
			this.frameWidth = (this.orientation=='landscape') ? this.longside: this.shortside;
			this.image.dispose();
			this.loading.dispose();

			this.outter = new Element('div', {
				'id': this.elid + '_outter',
				'styles': {
					'width' : this.options.width + 'px',
					'height': this.options.width / this.whratio  + 'px',
					'overflow': 'hidden'
				}
			});

			this.inner = new Element('div', {
				'id': this.elid + '_inner',
				'styles' : {
					'width': this.imageWidth + 'px',
					'height': this.imageHeight + 'px',
					'background': 'transparent url(' + this.picturename + ') no-repeat top left'
				}
			});


			this.footer = ($('mssImgMagnify_footer'))?$('mssImgMagnify_footer'):new Element('div', {
				'id': this.elid + '_footer',
				'styles': {
					'width' : this.options.width + 'px',
					'height': this.thumbHeight + 20 + 'px',
					'position': 'absolute',
					'right':0,
					'background-color': this.options.footercolor
				}
			});

			this.caption = new Element('div', {
				'id': this.elid + '_caption',
				'styles': {
					'float': 'left',
					'padding-left': '5px',
					'color' : this.options.captioncolor,
					'font-family': "Trebuchet MS",
					'font-size': '13px'
				}
			});
			this.caption.set('html',this.options.caption);

			this.thumb = new Element('div', {
				'id': this.elid + '_thumb',
				'styles': {
					'float': 'right',
					'margin-right': '8px',
					//'margin-top': '10px',
					'height': this.thumbHeight +'px',
					'width': this.thumbWidth + 'px',
					'text-align': 'left',
					'border': '2px solid #fff',
					'cursor': 'pointer'
				},
				'title': 'Click to move the frame!'
			});
			if(window.ie){
				this.ieheightadjust = 0;
			}else{
				this.ieheightadjust = 5;
			}
			this.frame = new Element('div', {
				'id': this.elid + '_frame',
				'styles': {
					'height': this.frameHeight +'px',
					'width': this.frameWidth + 'px',
					'position': 'relative',
					'top': '-' + (this.imageHeight / this.ratio + this.ieheightadjust) +'px',
					'margin-bottom': '-' + (this.imageHeight / this.ratio + this.ieheightadjust) +'px',
					'left' : '0px',
					'border': '1px dashed blue',
					'background-color': 'lightblue',
					'cursor': 'move',
					'z-index': '1000',
					'opacity': 0
				},
				'title': 'Drag me to change your view.'
			});

			this.image.setProperty('width',this.thumbWidth );
			this.image.setProperty('height', this.thumbHeight);
			this.image.setStyle('left', '0px');

			//Inject everything
			this.outter.injectInside(this.el);
			this.inner.injectInside(this.outter);
			if (!$('mssImgMagnify_footer'))this.footer.injectInside(this.el);
			this.caption.injectInside(this.footer);

			this.thumb.injectInside(this.footer);
			this.image.injectInside(this.thumb);
			this.frame.injectInside(this.thumb);

			// reset the scroll
			this.outter.scrollTo(0, 0);
			this.createDraggable();
			this.skipInit = true;

			// set events (added by bruce)
			if(this.options.hideOnLaunch){
				this.footer.addEvent('mouseenter',this.show.bind(this));
				this.footer.addEvent('mouseleave',this.hide.bind(this));
			}
		}
	},


	show: function(){
		this.frame.setStyles({
					'opacity': 0.6
				});
		this.outter.setStyles({
					'opacity': 1.0
				});
	},

	hide: function(){
		this.frame.setStyles({
					'opacity': 0
				});
		this.outter.setStyles({
					'opacity': 0
				});
	},

	createDraggable: function() {
		this.dragHandle = this.frame.makeDraggable({
				modifiers: {x : 'left', y : 'top'},
				limit: {x : [0, this.options.thumbWidth - this.frame.offsetWidth ], y:[- this.thumbHeight - this.ieheightadjust, -this.frame.offsetHeight ]},
				onDrag: function() {
					frameleft = this.frame.getStyle('left').toInt();
					frametop = this.frame.getStyle('top').toInt();
					topComp = this.imageHeight / this.ratio + this.ieheightadjust;
					newscrollleft = frameleft * this.ratio;
					newscrolltop = (frametop+topComp) * this.ratio;
					this.outter.scrollTo(newscrollleft, newscrolltop);
				}.bind(this)
		});
	}

});
function init() {
	if($('mssImgMag'))var myImg = new mssImgMagnify('mssImgMag');
}
window.addEvent('domready', init);
*/

/*
http://site.spytowne.com/map-price/validate-email.js
@validateEmail
*/

// This script is copywrited and is the sole property of 4D Internet Solutions, Inc.
// It may not be used, copied, sold or reproduced in any form without the express written consent of 4D Internet Solutions, Inc.
function validateEmailAddress(emailAddress) {
    var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    var ret = true;

    if (regex.test(emailAddress) == false) {
 		ret = false;
   	}
    return(ret);
}

function sendEmail() {
		if (validateEmailAddress(document.getElementById('email-address').value)) {

			var image = document.getElementById('sendemail');
			image.src = "http://site.spytowne.com/map-price/mss-send-map-email.php?emailaddress=" + document.getElementById('email-address').value + "&productid=" + document.getElementById('mss-product-id').value  + "&productprice=" + document.getElementById('mss-map-sale-price').innerHTML + "&productcode=" + document.getElementById('mss-code').innerHTML + "&productname=" + escape(document.getElementById('mss-product-name').value) + "&rn=" + Math.random();


		} else {
			alert('Please enter a valid email address');
		}
	}




/*
http://lib.store.yahoo.net//lib/spytown/scShippingCalculator.js
@shipCalc
*/

function scProgBar() {
	/*
		scProgBar - Public - Generates a progress indicator bar object
		PARAMETERS: none
		RETURN: none
	*/

	// Build HTML objects
	var progBar = document.createElement("div");
	
	progBar.className = "scProgBar";
	progBar.style.overflow = "hidden";
	progBar.style.position = "relative";
	progBar.style.zIndex = "0";
	
	progBar.appendChild(document.createElement("div"));
	progBar.firstChild.className = "progBarBg";
	progBar.firstChild.style.width = "0";
	
	progBar.appendChild(document.createElement("div"));
	progBar.childNodes[1].className = "progBarFg";
	progBar.childNodes[1].style.position = "absolute";
	progBar.childNodes[1].style.top = "0";
	progBar.childNodes[1].style.left = "0";
	progBar.childNodes[1].style.zIndex = "1";
	progBar.childNodes[1].style.width = "100%";
	progBar.childNodes[1].style.textAlign = "center";
	
	progBar.childNodes[1].appendChild(document.createTextNode("0%"));
	

	// Initialize Progress var
	var currProg = 0;

	// Initialize Interval vars
	var throbInt = null;
	var throbTime = 100;

	this.setPseudoTime = function ( num ) {
		/*
			setPseudoTime - Public - Sets the interval time (throbTime) for the pseudo progress bar
			PARAMETERS: num - should be a positive integer value
			RETURN: none
		*/
		var tmpNum = SC.forceInt(num);
		if (tmpNum > 0) {
			throbTime = tmpNum;
		}
	};

	this.pseudoStart = function ( num ) {
		/*
			pseudoStart - Public - Initializes the pseudo progress bar interval
			PARAMETERS: num - should be a positive integer value; if it is not set, throbTime will be used
			RETURN: none
		*/
		var tmpNum = SC.forceInt(num);
		throbInt = setInterval(pseudoUpdate, ((tmpNum > 0)? tmpNum : throbTime));
	};

	function readNum() {
		/*
			getNum - Private - Gets the current progress [percent] value from the prog bar HTML object
			PARAMETERS: none
			RETURN: an integer value for the current progress percentage
		*/
		var num = -1;
		try {
			num = SC.forceInt(progBar.childNodes[1].firstChild.nodeValue);
		} catch (err) {}
		return num;
	}

	function pseudoUpdate() {
		/*
			pseudoUpdate - Private - Iterates the progress bar randomly; will slow as current percent approaches 99%
			PARAMETERS: none
			RETURN: none
		*/
		var num = currProg;
		if (-1 < num < 100) {
			var diff = 100 - num;
			var ran = Math.ceil(Math.random() * 100);
			var adj = Math.abs(diff - ran);
			num += Math.floor(diff / ((adj > 0)? adj : 1) / 2);
			setPercent(num);
		} else {
			clearInterval(throbInt);
		}
	}

	function killPseudo() {
		/*
			killPseudo - Private - Stops the iteration of the pseudo progress bar
			PARAMETERS: none
			RETURN: none
		*/
		if (throbInt) clearInterval(throbInt);
	}

	function setPercent( num ) {
		/*
			setPercent - Private - Sets and writes the current progress percent information to the prog bar HTML object
			PARAMETERS: num - should be a positive integer value
			RETURN: none
		*/
		var tmpNum = SC.forceInt(num);
		if (tmpNum > -1) {
			currProg = tmpNum;
			try {
				progBar.childNodes[1].firstChild.nodeValue = progBar.firstChild.style.width = tmpNum + "%";
			} catch (err) {}
		}
	}

	this.setProg = function( num ) {
		/*
			setProg - Public - Forces the current percent to the value specified; stops a running pseudo bar
			PARAMETERS: num - should be a positive integer value
			RETURN: none
		*/
		killPseudo();
		setPercent(num);
	};

	this.resetProg = function() {
		/*
			resetProg - Public - Resets the current percent value to 0; stops a running pseudo bar
			PARAMETERS: none
			RETURN: none
		*/
		killPseudo();
		setPercent(0);
	};

	this.getProg = function() {
		/*
			getProg - Public - Gets the percent value for the current progress completed
			PARAMETERS: none
			RETURN: a string value of the current percentage
		*/
		return currProg + "%";
	};

	this.getObj = function() {
		/*
			getProg - Public - Gets an HTML object for the progress bar
			PARAMETERS: none
			RETURN: an HTML object (div) containing the progress information
		*/
		return progBar;
	};
}

function scShippingCalculator(){
	/*
		scShippingCalculator - Public - Initializes the shipping calculator
		PARAMETERS: none
		RETURN: none
	*/

	function getOpt( sel ) {
		/*
			getOpt - Private - Gets the selected option for a given select box
			PARAMETERS: the select HTML element to check
			RETURN: the option HTML element that is currently selected
		*/
		return sel.options[sel.selectedIndex];
	}

	var cookieName = "scSMpresets-0148";
	var formEl = SC.$("shippingMgrForm-0148");
	var scriptEl = SC.$("shippingMgrScript-0148");
	var parentDiv = SC.$("shippingMgrDiv-0148");
	var zipIn = SC.$("shippingMgrZip-0148");
	var countrySel = SC.$("shippingMgrCountry-0148");
	var provinceIn = SC.$("shippingMgrProvince-0148");
	var provinceSpan = SC.$("caprovince-0148");
	var bttn = SC.$("shippingMgrSubmit-0148");
	var country = window.shippingMgrC || "US United States";

	function throb( parentDiv ) {
		/*
			throb - Private - Adds the progress bar to a parent element; starts running a pseudo bar
			PARAMETERS: parentDiv - should be an HTML element
			RETURN: none
		*/
		if (parentDiv && (parentDiv.nodeType == 1)) {
			SC.orphan(parentDiv);
			var progBar = new scProgBar();
			SC.appElem(progBar.getObj(), parentDiv);
			var adj = getQty().toString().length - 3;
			adj = (adj > 0)? (adj + adj) / 1.5 : 1;
			progBar.pseudoStart(100 * adj);
		}
	}

	function getQty() {
		var prodId = document.location.href.match(/\/([^\/]+)\.html$/);
		prodId = prodId ? prodId[1] : '';
		//var vwItem = SC.filterByName(SC.getByTag('input'), 'vwitem');
		//for (var i = 0, j = vwItem.length; i < j; i++) {
		//	if (!prodId || (vwItem[i].value == prodId)) {
		//		var vwQty = SC.filterByName(SC.getByTag('input', vwItem[i].form), 'vwquantity');
		//		if (vwQty.length) {
		try {
		
		    var vwQty=document.getElementById("mss-quantity-number");
		    if (vwQty)
		        return SC.forceInt(vwQty.value);
		} catch (e) {
		}        
		//		}
		//	}
		//}
		//delete prodId, vwItem;
		return 1;
	}

	this.getShippingMgrZips = function(){
		/*
			getShippingMgrZips - Public - Finds shipping values (zip, etc), initializes the progress bar loading, and sets the iframe to start receiving data
			PARAMETERS: none
			RETURN: none
		*/
		var zip = zipIn.value.toString();
		var province = (provinceSpan && !SC.hasClass(provinceSpan, "hideMe-0148"))? provinceIn.value : "";
		if(countrySel) {
			country = getOpt(countrySel).value + " " + getOpt(countrySel).text;
		}
		SC.setCookie(cookieName, ("({zip:'" + zip + "', province:'" + province + "', country:'" + country + "'})"), '/', null, 30);

		if (!country.toLowerCase().match(/^usa?/) || (zip != "")) {
			var url = "sc-shipping-calculator-frame.html?country=" + country + "&province=" + province + "&unitPrice=" + shippingMgrUnitPrice + "&itemid=" + shippingMgrItemID + "&storeid=" + shippingMgrStoreID + "&zipcode=" + zip + "&qty=" + getQty();
			throb(parentDiv);
			scriptEl.src = url;
			if (!zip) {
				var noZipMsg = (window.scSCnoZipMsg)? scSCnoZipMsg : "Please consider entering a zip code value for complete results.";
				alert(noZipMsg);
				delete noZipMsg;
			}
		} else {
			var noZipMsg = (window.scSCnoZipUsMsg)? scSCnoZipUsMsg : "A zip code is required; please enter a value.";
				alert(noZipMsg);
				delete noZipMsg;
		}
		delete zip, province, url;
	};

	this.displayProvince = function(){
		/*
			displayProvince - Public - Finds shipping values (zip, etc) and displays the province input if the country is CA(nada)
			PARAMETERS: none
			RETURN: none
		*/
		country = getOpt(countrySel).value + " " + getOpt(countrySel).text;
		var tmpSelInd = countrySel.options.selectedIndex;
		if(countrySel.options[tmpSelInd].value=="CA" || countrySel.options[tmpSelInd].value=="US") {
			if (SC.hasClass(provinceSpan, "hideMe-0148")) {
				SC.removeClass(provinceSpan, "hideMe-0148");
			}
		} else {
			if (!SC.hasClass(provinceSpan, "hideMe-0148")) {
				SC.addClass(provinceSpan, "hideMe-0148");
			}
		}
		delete tmpSelInd;
		refreshSubmit();
	};

	function refreshSubmit( ev ) {
		/*
			refreshSubmit - Private - Classes the submit button accordingly
			PARAMETERS: none
			RETURN: none
		*/
		if (country.toLowerCase().match(/^usa?/) && (zipIn.value.toString() == "")) {
			SC.addClass(bttn, "dimMe-0148");
		} else {
			SC.removeClass(bttn, "dimMe-0148");
		}
	}

	// Shows HTML objects that were hidden in case JS fails; Intializes values from the cookie
	try {
		formEl.style.display = parentDiv.style.display = "block";
		if (provinceSpan) {
			//SC.addClass(provinceSpan, "hideMe-0148");
		}
		if (zipIn) {
			SC.addEvt(zipIn, "keyup", refreshSubmit);
		}
		var smCookie = eval(SC.getCookie(cookieName));
		if (smCookie) {
			zipIn.value = smCookie.zip;
			if (provinceIn) {
				provinceIn.value = smCookie.province;
			}
			if (smCookie.country) {
				country = smCookie.country;
			}
		}
		if (countrySel) {
			var cSelInd = countrySel.options.length;
			var cCode = country.substr(0,2);
			while (--cSelInd > 0 && (countrySel.options[cSelInd].value != cCode)) {}
			countrySel.options.selectedIndex = cSelInd;
			delete cSelInd, cCode;
		}
		delete smCookie;
		refreshSubmit();
	} catch (err) {}
}




/* Retrieve my account login-password
@pdRetrievePasswordCopyEmail
 */
function pdRetrievePasswordCopyEmail(thisLink) {
				 	var email = document.forms.login.email.value;
					var emailQueryString = "?email=" + escape(email);
					thisLink.href = thisLink.href + emailQueryString;
					return true;
				 }



/* @mooquee */
/************************************************
*   mooquee v.1.1                               *
*   Http: WwW.developer.ps/moo/mooquee          *
*   Dirar Abu Kteish dirar@zanstudio.com        *
*   2009-01-30                                  *
*************************************************
*   Extend By www.Sod.hu                        *
*   new directions: top, bottom                 *
*   2008-04-30                                  *
/***********************************************/
/* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details. */

try {

    var mooquee = new Class({
        initialize: function(element, options) {
		    this.setOptions({
			    marHeight: 32,
			    marWidth: 550,
			    steps: 1,
			    speed: 20,
			    direction: 'left',
			    pauseOnOver: true,
			    pauseOnContainerOver: true
	        }, options);
	        this.timer = null;
	        this.textElement = null;
	        this.mooqueeElement = element;
	        this.constructMooquee();
	    },
	    constructMooquee: function() {
		    var el = this.mooqueeElement;
		    this.options.marWidth = el.getSize().x;
		    el.setStyles({
		        'width' : this.options.marWidth
		        ,'height' : this.options.marHeight
		    });
            this.textElement = new Element('div',{
		        'class' : 'mss-alert-text'
		        ,'id' : 'mss-alert-text'
		    }).set('html', el.innerHTML);
		    el.set('html', '');//clear mooqueeElement inner html
		    this.textElement.inject(el);
		    //this.textElement = $('mooquee-text');
            if(!this.setStartPos()){return;}
            if(this.options.pauseOnOver){this.addMouseEvents();}
		    //start marquee
		    this.timer = this.startMooquee.delay(this.options.speed, this);
	    },
	    setStartPos: function(){
	        /* sod.hu Ext */
		    if( this.options.direction == 'bottom' )
                this.textElement.setStyle('bottom', ( -1 * this.textElement.getCoordinates().height.toInt()));
            else if( this.options.direction == 'top' )
                this.textElement.setStyle( 'bottom', this.options.marHeight );
            else if( this.options.direction == 'left' )
                this.textElement.setStyle('left', ( -1 * this.textElement.getCoordinates().width.toInt()));
            else if( this.options.direction == 'right' )
                this.textElement.setStyle( 'left', this.options.marWidth );
            else{
                alert( 'direction config error: ' + this.options.direction );
                return false;
            }
            return true;
	    },
	    addMouseEvents : function(){
	        if(!this.options.pauseOnContainerOver){
	            this.textElement.addEvents({
	                'mouseenter' : function(me){
	                    this.clearTimer();
	                }.bind(this),
	                'mouseleave' : function(me){
	                    this.timer = this.startMooquee.delay(this.options.speed, this);
	                }.bind(this)
	            });
	        }else{
	            this.mooqueeElement.addEvents({
	                'mouseenter' : function(me){
	                    this.clearTimer();
	                }.bind(this),
	                'mouseleave' : function(me){
	                    this.timer = this.startMooquee.delay(this.options.speed, this);
	                }.bind(this)
	            });
	        }
	    },
        startMooquee: function(){
            /* sod.hu Ext */
            if(this.options.direction == 'bottom' || this.options.direction == 'top')
                var pos = this.textElement.getStyle('bottom').toInt();
            else if(this.options.direction == 'left' || this.options.direction == 'right')
                var pos = this.textElement.getStyle('left').toInt();
            if(this.options.direction == 'bottom')
                this.textElement.setStyle( 'bottom', ( pos + -1 ) + 'px' );
            else if(this.options.direction == 'top')
                this.textElement.setStyle( 'bottom', ( pos + 1 ) + 'px' );
            else if(this.options.direction == 'left'){
                this.textElement.setStyle( 'left', ( pos + -1 ) + 'px' );
            }
            else if(this.options.direction == 'right')
                this.textElement.setStyle( 'left', ( pos + 1 ) + 'px' );
            /* sod.hu Ext end */
            this.checkEnd(pos);
            this.timer = this.startMooquee.delay(this.options.speed, this);
        },
        resumeMooquee: function(){
            this.stopMooquee();
            if(this.options.pauseOnOver){this.addMouseEvents();}
            this.timer = this.startMooquee.delay(this.options.speed, this);
        },
        stopMooquee: function(){
            this.clearTimer();
            this.textElement.removeEvents();
        },
        clearTimer: function(){
            $clear(this.timer);
        },
        checkEnd: function(pos){
            /* sod.hu Ext */
            if(this.options.direction == 'bottom'){
                if(pos < -1 * (this.textElement.getCoordinates().height.toInt()))
                    this.textElement.setStyle('bottom', this.options.marHeight);
            } else if(this.options.direction == 'top'){
                if(pos > this.options.marHeight.toInt())
                    this.textElement.setStyle('bottom', -1 * (this.textElement.getCoordinates().height.toInt()) );
            } else if(this.options.direction == 'left'){
                if(pos < -1 * (this.textElement.getCoordinates().width.toInt()))
                    this.textElement.setStyle('left', this.options.marWidth);
            } else if(this.options.direction == 'right'){
                if(pos > this.options.marWidth.toInt())
                    this.textElement.setStyle('left', -1 * (this.textElement.getCoordinates().width.toInt()) );
            }
            /* sod.hu Ext end */
        }
    });
    mooquee.implement(new Options);

    window.addEvent('domready', function(){
    if($('mss-alert-container')){
       var obj = new mooquee($('mss-alert'));
    }
    });

} catch (ex) {
}

function mssNumTest(num){
   // 8 = backspace
   //46 = delete
   //13 = enter
   // 65-90 = a-z
   // 48-57 = 0-9
   // 96-105 = 0-9 (numpad)
   if((num>=65 && num<=90)||(num>=48 && num<=57)||(num>=96 && num<=105)||num==13||num==46||num==8){
      return true;
   }
   return false;
}
