		var selected;
		
		function selectRowEffect(object, buttonSelect) {
		  if (!selected) {
			if (document.getElementById) {
			  selected = document.getElementById('defaultSelected');
			} else {
			  selected = document.all['defaultSelected'];
			}
		  }
		
		  if (selected) selected.className = 'moduleRow';
		  object.className = 'moduleRowSelected';
		  selected = object;
		
		// one button is not an array
		  if (document.checkout_address.shipping[0]) {
			document.checkout_address.shipping[buttonSelect].checked=true;
		  } else {
			document.checkout_address.shipping.checked=true;
		  }
		}
		
		function rowOverEffect(object) {
		  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
		}
		
		function rowOutEffect(object) {
		  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
		}

		function confirmIt()
		//{
			//var product = cart[0].value;
			//var quantity = cart.cart_quantity.value;
			//if(product > 0)
			//{
				//if(quantity > 0)
				{
					alert('This item will now be added to your Shopping Cart');
					//return true;
				}
				//else
				//{
					//alert('Please enter a valid quantity');
					//return false;
				//}
			//}
			//else
			//{
				//alert('Please select an option');
				//return false;
			//}
			//return false;
			
		//}

		function new_window(resource,width,height)
		{	resource_window = window.open('http://www.thebeautifulcompany.co.uk/'+resource+'', 'resource_window', 'width=' + ((width*1)+20) + ', height=' + ((height*1)+20) + ', scrollbars=no')
			resource_window.focus()
		}


		function session_win() {
			  window.open("<?php echo tep_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
		}


		function validateContact() {
				if (document.contact.name.value == "") {
					alert('Please enter your name');
					return false;
				}
				if (document.contact.email_from.value == "") {
					alert('Please enter your Email Address');
					return false;
				}
				if (document.contact.phone.value == "") {
					alert('Please enter your Telephone Number');
					return false;
				}
		return true;
		}

		function validateFields() {
		 if (document.quick_find.keywords.value == "") {
				alert('Please enter a search term');
				return false;
				 }
		return true;
		}
	
		function MM_openBrWindow(theURL,winName,features) { //v2.0
		  window.open(theURL,winName,features);
		}
		   function FormatNumber(num)
		   {
			 if(isNaN(num)) { num = "0"; }
			 sign = (num == (num = Math.abs(num)));
			 num = Math.floor(num*100+0.50000000001);
			 cents = num%100;
			 num = Math.floor(num/100).toString();
			 if(cents<10) { cents = "0" + cents; }
			 for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
			 {
			   num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));
			 }
			 return (((sign)?'':'-') + num + '.' + cents);
		   }
		   
		  function showPrice(form)
		  {  
			var myTotalPrice = 0;
			var showUP = 0;
			var myMathProblem = "";
			myItemPrice = parseFloat(form.nuPrice.value);
			for (var i = 0; i < form.elements.length; i++)
			{
			  var e = form.elements[i];
			  if ( e.type == 'select-one' )
			  {
				showUP = 1;
				Item = e.selectedIndex;
				myPrice = e.options[Item].text;
				myDollarSign = myPrice.indexOf("£",0)
				if ( myDollarSign != "-1" )
				{
				  myParSign = myPrice.indexOf(")", myDollarSign);
				  myAttributeString = myPrice.substring(myDollarSign+1, myParSign);
				  myAttributeString = myAttributeString.replace(/,/,"");
				  myAttributePrice = parseFloat(myAttributeString);
				  myMathProblem = myPrice.charAt(myDollarSign - 1);
				} else { myAttributePrice = 0; }
				  if (myMathProblem == "-")
				  {
					myTotalPrice = myTotalPrice - myAttributePrice;
				  } else {
					myTotalPrice = myTotalPrice + myAttributePrice;
				  }
			  }
			}  
			if ( showUP )
			{
				myTotalPrice = FormatNumber(myTotalPrice + myItemPrice);
				document.getElementById("productNEWprice").innerHTML = "Total price with options <b>&pound;" + myTotalPrice + "</b>";
			}
		  }  
		function rowOverEffect(object) {
		  if (object.className == 'moduleRow') object.className = 'moduleRowOver';
		}
	
		function rowOutEffect(object) {
		  if (object.className == 'moduleRowOver') object.className = 'moduleRow';
		}

		function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
		  if(window.screen)if(isCenter)if(isCenter=="true"){
			var myLeft = (screen.width-myWidth)/2;
			var myTop = (screen.height-myHeight)/2;
			features+=(features!='')?',':'';
			features+=',left='+myLeft+',top='+myTop;
		  }
		  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
		}