<!--
	// initialize Msg rider qty variables
	totalMsgqty18 = 0;
	totalMsgqty24 = 0;
	totalMsgqty28 = 0;
	// buyItem - adds an item to the shopping basket

	function buyItem() {
		// set up variables for message riders

		var whichitem = "Message Riders"
		var qty = Msgqty;
		var size = document.Msgriderform.hidden_sizeMsg.value;

		// reinit this hidden field
		document.Msgriderform.hidden_sizeMsg.value = null;		
		itemNo = parseInt(Msgvalue);

		// hard codes color variables as message rider colors do not change
		color = "red";
		bgcolor = "white";

		// copy is static for Msgriders
		copy1 = Msgcopy;

		// copy2 variable is not used for Msgriders
		copy2 = ""

		// sets Msgqty counter for Msgrider prices
		setTotalMsgqty(qty, size);
		oldCart = getCookie('ShopCart');
		newCart = "["+itemNo+"|"+whichitem+"|"+size+"|"+color+"|"+bgcolor+"|"+copy1+"|"+copy2+"|"+qty+"]";
		cartFull = oldCart + newCart;
		setCookie('ShopCart',cartFull);
		self.location.href="shop_view_cart_HELP.htm"
	}
	
	// sets Msgqty cookie so prices can be calculated in view_cart

	function setTotalMsgqty(thisMsgqty,thisMsgsize)
	{
		if (thisMsgsize == "4x18")
		{
			thatMsgqty18 = getCookie('totalMsgqty18');
			if (thatMsgqty18)
			{	totalMsgqty18 = thatMsgqty18;
				totalMsgqty18 = (eval(parseInt(totalMsgqty18) + parseInt(thisMsgqty)));		
			} else {
				totalMsgqty18 = (eval(parseInt(totalMsgqty18) + parseInt(thisMsgqty))); 
				}
			setCookie('totalMsgqty18', totalMsgqty18);
		}
	
		if (thisMsgsize == "6x24")
		{
			thatMsgqty24 = getCookie('totalMsgqty24');
			if (thatMsgqty24)
			{	totalMsgqty24 = thatMsgqty24;
				totalMsgqty24 = (eval(parseInt(totalMsgqty24) + parseInt(thisMsgqty)));		
			} else
			{
				totalMsgqty24 = (eval(parseInt(totalMsgqty24) + parseInt(thisMsgqty))); 
			}
			setCookie('totalMsgqty24', totalMsgqty24);
		}

		if (thisMsgsize == "6x28")
		{
			thatMsgqty28 = getCookie('totalMsgqty28');
			if (thatMsgqty28)
			{	totalMsgqty28 = thatMsgqty28;
				totalMsgqty28 = (eval(parseInt(totalMsgqty28) + parseInt(thisMsgqty)));		
			} else
			{
				totalMsgqty28 = (eval(parseInt(totalMsgqty28) + parseInt(thisMsgqty))); 
			}
			setCookie('totalMsgqty28', totalMsgqty28);
		}
			
	}

	// updates hidden form variable for size
	function updateMsgriderSize(thisSize)
	{
		document.Msgriderform.hidden_sizeMsg.value = thisSize;
		return;
	}
	
	// updates rider copy
	function updateMsgriderCopy(which)
	{
		Msgcopy = null;
		Msgvalue = null;
		var MsgcopyLength = null;
		var Msgdivider = null;
		
		Msgvalue = document.Msgriderform.Msgrider_copy.options[which].value;
		MsgcopyLength = Msgvalue.length;
		Msgdivider = (Msgvalue.indexOf("/") +1);
		Msgcopy = Msgvalue.substring(Msgdivider,MsgcopyLength);
		displayRider(Msgvalue);
	}
	
	// shows message rider graphic on page
	function displayRider(thisPic)	{
		// check if users browser is compliant with image.src
		isImage = (document.images);
		if (isImage)
		{ 
		var P = new Array();
			P[158] = "acreage";
			P[159] = "acres";
			P[138] = "Apartment";
			P[134] = "arrow";
			P[112] = "Assumable";
			P[231] = "Available";
			P[102] = "bedroom";
			P[116] = "belowapp";
			P[148] = "builtby";
			P[147] = "Buildsuit";
			P[163] = "Commercial";
			P[149] = "cus-home";
			P[109] = "Exclusive";
			P[121] = "farm";
			P[186] = "Fireplace";
			P[125] = "forlease";
			P[124] = "forrent";
			P[122] = "forsale";
			P[143] = "forclosure";
			P[150] = "home-off";
			P[108] = "imm-occp";
			P[160] = "land";
			P[130] = "land-fs";
			P[126] = "lease-pur";
			P[222] = "lot-fs";
			P[162] = "lot-num";
			P[157] = "lots-fs";
			P[113] = "lowdown";
			P[156] = "mls";
			P[165] = "mob-home";
			P[151] = "model";
			P[155] = "mod-home";
			P[145] = "new_price";
			P[117] = "no-qual";
			P[137] = "office";
			P[139] = "open";
			P[142] = "open-ho1";
			P[101] = "open-hom";
			P[218] = "open-sat";
			P[219] = "open-sun";
			P[128] = "own-agt";
			P[127] = "own-bkr";
			P[176] = "owner-f";
			P[190] = "pool-spa";
			P[115] = "price-rd";
			P[111] = "price-sl";
			P[177] = "ranch";
			P[153] = "remodel";
			P[164] = "res-lot";
			P[136] = "rv-space";
			P[178] = "saleleas";
			P[129] = "sale-pen";
			P[179] = "saletrad";
			P[133] = "shown-ba";
			P[144] = "short_sale";
			P[131] = "sold";
			P[132] = "sold-hf";
			P[180] = "sold-neg";
			P[184] = "sold-wcs";
			P[196] = "sold-who";
			P[119] = "spec-trm";
			P[166] = "swim-pool";
			P[123] = "term-avail";
			P[154] = "townhous";
			P[120] = "under-cnst";
			P[183] = "warranty";
			P[110] = "willtrade";
			P[135] = "zoning";
			
		picNo = parseInt(thisPic);
		document.images["pic"].src = "http://www.realtysignxpress.com/images/"+P[picNo]+".gif";
	} else return
	}
	
	// validates form fields and adds rider info
	function addRider() {

		Msgqty = document.Msgriderform.Msgrider_qty.value;
		
		if (document.Msgriderform.Msgrider_copy.options.selectedIndex == 0) { alert('Please Select Message Rider Copy.');
		return;
		}
		 
		// validates Msgrider size
		if ((document.Msgriderform.hidden_sizeMsg.value == 'null') || (document.Msgriderform.hidden_sizeMsg.value == ""))
		{
			alert('Please select a size.');
			return;
		} 

		// validates Msg rider size available for riders 218 and 219
	 	if ((parseInt(Msgvalue) == 218) || (parseInt(Msgvalue) == 219))
	 	{
	 		if (document.Msgriderform.hidden_sizeMsg.value == "4x18")
	 		{
	 			alert('Message Riders 218 and 219 are not available in size 4x18');
	 			return;
	 		}
	 	} 

		// validates Msgqty
		if (Msgqty == "" || Msgqty == " ")
		{
			alert('Please enter a quantity.');
			document.Msgriderform.Msgrider_qty.focus();
			return;
		}
		
		isNo = chkForNum(Msgqty);
		if (!isNo)	{
			alert('Please enter only numeric values');
			document.Msgriderform.Msgrider_qty.focus();
			return;
		}
		// adds rider info into cart
		buyItem()
	}
	
	// used in conjunction with button for debugging
	
	function loseCookies()
	{
		delCookie('totalMsgqty18');
		delCookie('totalMsgqty24');
		delCookie('totalMsgqty28');		
	}
	
// -->	