<!--

   // SP@M-FREE EMAIL ADDRESS SCRIPT
   var at='@';
   var shopEmailAddress = 'zane' + at + 'zanesmagicshop.com';
   var webmasterEmailAddress = 'martyn.harvey' + at + 'ellydesign.co.uk';

	// PRODUCT OPTIONS
	// Note: Hard-coded for a small number of products: (copied from /database/product_options.js 090711)
	// when implementing replication of BUY buttons

	// Note: Included here as it's used by Category Page, Product Page, Search Results (results.js) and NEW TRICKS (new_tricks.js)
	// To add specific Product Options, they should be updated HERE mh 110711

	// ADD OPTIONS DETAILS FOR TRICKS ON THIS PAGE -->
	// CELL 0 IS THE PRODUCT CODE -->
	// CELL 1 IS THE OPTION INFO THAT IS DISPLAYED ON THE PAYPAL SITE -->
	// THE REST OF THE CELLS ARE THE OPTIONS AVAILABLE -->

	var productoptions=[

	['zms0012','Colour','Select Colour','Red','Blue','Purple','Yellow','Orange','Green','Black','White'],
	['zms0013','Colour','Select Colour','Red','Blue','Purple','Yellow','Orange','Green','Black','White'],
	['zms0014','Colour','Select Colour','Red','Blue','Purple','Yellow','Orange','Green','Black','White'],
	['zms0015','Colour','Select Colour','Red','Blue','Purple','Yellow','Orange','Green','Black','White'],
	['zms0026','Colour','Select Colour','Red','Blue'],
	['zms0241','Colour','Select Colour','White','Red'],
	['zms0242','Colour','Select Colour','White','Red'],
	['zms0243','Colour','Select Colour','Black','White'],
	['zms0244','Colour','Select Colour','Black','White'],
	['zms0320','Size-metal','Size and Finish','Large Gold','Medium Gold','Large Silver','Medium Silver'],
	['zms0328','Size','Select Size','Large 23mm','Medium 21mm'],
	['zms0345','Colour','Select Colour','Red','Blue'],
	['zms0387','Colour','Select Colour','White','Red']

	]


   // renderBuyButtons() in included here as we have 500+ pages, all hard-coded with very few #included scripts
   // default.js is #included by both the Category Page and the Product Page and is therefore the only place we can out this function
   // This function makes maintenance of the payment panel simpler as it is called by both Category and Product pages

   function renderBuyButtons(p) {

	var dw='';

	// HEADER -->
	//dw+='<h2 style="margin-top: 3px; margin-left: 0px; margin-bottom: 56px; font-family: arial; font-size: 16px; font-weight: bold"></h2>';

	// IF-LOOP CHECKS TO SEE IF THE TRICK IS A FREEBIE OR DELETED TRICK -->

	if(prod[p][5]!="") {

		// MAIN ADD TO CART FORM -->
		dw+='<form name="paypal" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="return Validator(this,whichPressed);">';
	
		// DROP-DOWN SELECTION - UK -->

		// mh: Note 'j' and 'i' changed to k and m respectively, to prevent conflict with vars in loop where this function is called 090711

		for (k=0;k<productoptions.length;k++) {
			if (prod[p][0]==productoptions[k][0]) {
				dw+='<p class="prodoptions"><input type="hidden" name="on0" value="'+productoptions[k][1]+'">';
				dw+='<select name="os0">';
				for (m=2;m<productoptions[k].length;m++) {
					dw+='<option value="'+productoptions[k][m]+'">'+productoptions[k][m];
					}
				dw+='</select></p>';
				}
			}

		<!-- ADD TO CART BUTTON -->
		dw+='<p class="bttnbuynow"><input type="image" name="submit" src="/graphics/buttons/buynow.gif" name="submit" alt="Add this item to your shopping cart"  onmouseover="src=\'/graphics/buttons/buynowmo.gif\'" onmouseout="src=\'/graphics/buttons/buynow.gif\'" onclick="whichPressed=this.value" /></p>';
		dw+='<input type="hidden" name="item_name" value="'+prod[p][1]+' ['+prod[p][0]+']" />';
		dw+='<input type="hidden" name="amount" value="'+prod[p][5]+'" />';
		dw+='<input type="hidden" name="add" value="1" />';
		dw+='<input type="hidden" name="cmd" value="_cart" />';
		dw+='<input type="hidden" name="business" value="magic_zane@btinternet.com" />';
		dw+='<input type="hidden" name="no_note" value="1" />';
		dw+='<input type="hidden" name="currency_code" value="GBP" />';
		dw+='<input type="hidden" name="lc"value="GB" />';
		dw+='<input type="hidden" name="bn" value="PP-ShopCartBF" />';
		dw+='</form>';

		// VIEW CART BUTTON -->
		dw+='<p class="bttnviewcart"><a href="https://www.paypal.com/cart/display=1&business=magic_zane@btinternet.com" target="_blank"><img src="/graphics/buttons/viewcart.gif" border="0" onmouseover="src=\'/graphics/buttons/viewcartmo.gif\'" onmouseout="src=\'/graphics/buttons/viewcart.gif\'"></a></p>';

		// PAYMENT EXPLAINED LINK -->

	//	dw+='<p style="margin-top: 10px; margin-left: 5px; text-align: left"><a href="../../info/about_payment.html" style="margin-left: 0px; font-size: 12px" title="More about secure payments with the PayPal Secure online payments service">Payments explained</a></p>';
	//	dw+='<p style="margin-left: 0px; margin-top: 13px; margin-bottom: 8px;">';

		dw+='<table style="margin-top: 10px; margin-left: 0px; margin-bottom: 0px; width: 120px; padding: 0px"><tr>';
		dw+='<td width="35px" style="padding: 0px; text-align: left">';
		dw+='<img src="/graphics/icons/securepadlock.gif" style="margin-left: 0px"></td>';
		dw+='<td style="text-align: left; padding-left: 10px">';
		dw+='<a href="../../info/about_payment.html" title="More about secure payments with the PayPal Secure online payments service">Secure shopping</a>'
		dw+='</td></tr></table></p>';

		//dw+='</p>';

		} //END OF IF-LOOP -->

		else { dw+='<p>Sorry\, this product is not available for purchase.</p>'; }

		return dw;
	}

   function Validator(theForm,whichButton) {

   <!-- VALIDATES THE DROP DOWN INFO -->
	var error = ""; 
	if (theForm.os0.options[0].selected == true) { error += "Please select from the dropdown list."; }
	if (error != "") {
		alert(error);
		return (false); }
	else { return (true); }
   }


//-->
