// JavaScript Document

function changetint(imgname) {

	document.getElementById("car").src=imgname;
	
}

<!-- 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);
		  }
	 }
}

<!-- Add item to basket -->
function AddCurtainToBasket(description, cost, qty, col, w) {

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

	wt=w*qty;
	itemDesc = description+" colour:-"+col;


	<!-- 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=16620&quantity="+qty+"&price="+price+"&returnurl="+nextURL+"&weight="+wt;
	
}
<!-- ;
var newwindow;
var wheight = 0, wwidth = 0;
function popImage(url, title, iwidth, iheight) {
	var pwidth, pheight;
	var colour="black";
	
	if ( !newwindow || newwindow.closed ) {
		pwidth=iwidth+30;
		pheight=iheight+30;
		newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
		wheight=iheight;
		wwidth=iwidth;
	}
	
	if (wheight!=iheight || wwidth!=iwidth ) {
		pwidth=iwidth+30;
		pheight=iheight+60;
		newwindow.resizeTo(pwidth, pheight);
		wheight=iheight;
		wwidth=iwidth;
	}
	
	newwindow.document.clear();
	newwindow.focus();
	newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
	newwindow.document.writeln('<img src=' + url + '>');
	newwindow.document.writeln('<\/center> <\/body> <\/html>');
	newwindow.document.close();
	newwindow.focus();
}

// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy5()" in body tag
function tidy() {
	if (newwindow && !newwindow.closed) { newwindow.close(); }
}

<!-- Add Pole item to basket -->
function AddPoleToBasket(description, cost, qty, w) {

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

	itemDesc = description;
	
	wt=w*qty;

	<!-- 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=16620&quantity="+qty+"&price="+price+"&returnurl="+nextURL+"&weight="+wt;
	
}

<!-- Add Pole item to basket -->
function AddPaintToBasket(description, cost, qty, w) {

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

	wt=w*qty;
	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=16620&quantity="+qty+"&price="+price+"&returnurl="+nextURL+"&weight="+wt;
	
}