// JavaScript Document

<!-- Populates product drop downs -->
function MakeOptions(frmname,opts,selname) {
	var opt_string = opts;
	var opt_array = opt_string.split(",");

	var s = document.forms[frmname].elements[selname];

	 if (s.options.length == 1) {
		  for (var i = 0; i < opt_array.length; i++) {
			   s.options.add(new Option(opt_array[i], opt_array[i]), s.options.length);
		  }
	 }
}

function AddToBasket(description, cost, qty, opt1, opt2) {

	var price;
	var itemDesc;
	var nextURL;
	
	if (opt1 == "Please select one") {
		alert ("Please select a colour");
		return;
	}
	
	if (opt2 == "Size") {
		alert ("Please select a size");
		return;
	}
	
	<!-- validate qty  -->
	if (qty < 1) {
		alert ("No quantity entered");
		return;
	}
	
	if (cost <= 0) {
		alert ("Please enter an amount");
		return;
	}	

	itemDesc = description+" - "+opt1+" Size "+opt2;

	<!-- Replace all spaces with a + -->
	itemDesc=itemDesc.replace(/ /g,"+");
	
	price=cost;
	nextURL=window.location.href;
			
	<!-- Add to and display basket -->
	window.location.href = "http://www.romancart.com/cart.asp?itemname="+itemDesc+"&storeid=20207&quantity="+qty+"&price="+price+"&returnurl=http://www.bumpmagic.co.uk/shophome.html";
	
}

function AddToBasket1(description, cost, qty) {

	var price;
	var itemDesc;
	var nextURL;
	
	<!-- validate qty  -->
	if (qty < 1) {
		alert ("No quantity entered");
		return;
	}
	
	if (cost <= 0) {
		alert ("Please enter an amount");
		return;
	}	

	itemDesc = description;

	<!-- Replace all spaces with a + -->
	itemDesc=itemDesc.replace(/ /g,"+");
	
	price=cost;
	nextURL=window.location.href;
			
	<!-- Add to and display basket -->
	window.location.href = "http://www.romancart.com/cart.asp?itemname="+itemDesc+"&storeid=20207&quantity="+qty+"&price="+price+"&returnurl=http://www.bumpmagic.co.uk/shophome.html";
	
}