/* COPYRIGHT DREW WALLER - fizzstream 2004 - 2008*/
var whereFrom="";

function modquant(t) {
          if(t.id=="qty") {
	document.forms[0].elements["quantity_1"].value=t.options[t.selectedIndex].value;
	document.forms[1].elements["item_quantity_1"].value=t.options[t.selectedIndex].value;
          } else if (t.id=="qty2") {
	document.forms[2].elements["quantity_1"].value=t.options[t.selectedIndex].value;
	document.forms[3].elements["item_quantity_1"].value=t.options[t.selectedIndex].value;
          } else if (t.id=="qty3") {
	document.forms[4].elements["quantity_1"].value=t.options[t.selectedIndex].value;
	document.forms[5].elements["item_quantity_1"].value=t.options[t.selectedIndex].value;
          } else if (t.id=="qty4") {
	document.forms[6].elements["quantity_1"].value=t.options[t.selectedIndex].value;
	document.forms[7].elements["item_quantity_1"].value=t.options[t.selectedIndex].value;
          }
//	alert(t.options[t.selectedIndex].value+"  "+document.forms[3].elements["item_quantity_1"].value);
//	alert(t.id);
	};
/* PayPal */
	function doPayPal(itemname,itemamount){
		var r="http://www.equielements.co.uk/" ;  
		var cr="http://www.equielements.co.uk/index.html" ;  
		var u=self.location.href
		var ustr=u.substr(0,u.lastIndexOf("/"));
		var uniqueID=new Date().getTime();
		var currcode="GBP";

		sform="<form class='ppform' onsubmit=\"return w_validate(whereFrom)\" action='https://www.paypal.com/cgi-bin/webscr' method='POST' target='_self'>"
		  +"<input type='hidden' name='cmd' value='_cart'/>"
		  +"<input type='hidden' name='business' value='bodysilicon@gmail.com'/>"
		  +"<input type='hidden' name='item_name' value='"+uniqueID+"'/>"
		  +"<input type='hidden' name='item_number' value='"+whereFrom+"'/>"
		  +"<input type='hidden' name='currency_code' value='"+currcode+"'/>"
		  +"<input type='hidden' name='return' value='"+r+"'/>"
		  +"<input type='hidden' name='cancel_return' value='"+cr+"'/>"
		  +"<input type='image' name='submit' src='assets/btn_buynowCC_LG.gif''/>"
		  +"<input type='hidden' name='upload' value='1'/>";
		sform+="<input type=\"hidden\" name=\"quantity_1\" value=\"1\"/> \
		            <input type=\"hidden\" name=\"shipping_1\" value=\"0\"/> \
		            <input type=\"hidden\" name=\"item_name_1\" value=\""+itemname+"\"/> \
		            <input type=\"hidden\" name=\"amount_1\" value=\""+itemamount+"\"/>";
		sform+="</form>";
		document.write(sform);

	};
	function doGCheckOut(itemname,itemamount,itemdesc){
// <form action=\"https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/523906665511421\" id=\"BB_BuyButtonForm\" method=\"post\" name=\"BB_BuyButtonForm\">\r\n \

		var sform="\
<form onsubmit=\"return w_validate(whereFrom)\" action=\"https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/523906665511421\" id=\"BB_BuyButtonForm\" method=\"post\" name=\"BB_BuyButtonForm\">\r\n \
    <input name=\"item_name_1\" type=\"hidden\" value=\""+itemname+"\"/>\r\n \
    <input name=\"item_description_1\" type=\"hidden\" value=\""+itemdesc+"\"/>\r\n \
    <input name=\"item_quantity_1\" type=\"hidden\" value=\"1\"/>\r\n \
    <input name=\"item_price_1\" type=\"hidden\" value=\""+itemamount+"\"/>\r\n \
<input type=\"hidden\" name=\"shopping-cart.merchant-private-data\" value=\""+whereFrom+"\">\r\n \
    <input name=\"item_currency_1\" type=\"hidden\" value=\"GBP\"/>\r\n \
    <input name=\"_charset_\" type=\"hidden\" value=\"utf-8\"/>\r\n \
    <input alt=\"\" src=\"https://checkout.google.com/buttons/buy.gif?merchant_id=523906665511421&amp;w=117&amp;h=48&amp;style=white&amp;variant=text&amp;loc=en_UK\" type=\"image\"/>\r\n \
</form>\r\n";
		document.write(sform);
	};
function w_set(v) {
	whereFrom=v.value;
//	return false;
	};
function w_validate(name,price,descript) {
//price=15.95;
//doGCheckOut(name,price,descript);
	// UNCOMMENT BELOW IF VALIDATION REQUIRED (HTML TXT/SELECT BOX IS ACTIVE)
	// if (w=="") {
	//                alert("Special offer requires a \"How you heard..\" select box value (top of page).");	
	//	return false;
	// }
	return true;
	};
