// JavaScript Document

function sendPayment(description, cost) {

	var price;
	var itemDesc;
	var nextURL;

	if (cost <= 0) {
		alert ("Please enter an amount");
		return;
	}	

	itemDesc = description

	<!-- Replace all spaces with a + -->
	itemDesc=itemDesc.replace(/ /g,"+");
	itemDesc=itemDesc.replace(/&/g,"and");

	price=cost;
			
	nextURL="www.reefgliders.co.uk";
	
	<!-- Add to and display basket -->
	window.location.href = "http://www.romancart.com/cart.asp?itemname="+itemDesc+"&storeid=16543&quantity=1&price="+price+"&returnurl="+nextURL;
	
}
<!-- Add item to basket -->
function AddToBasket(description, cost, qty) {

	var price;
	var itemDesc;
	var nextURL;

	
	<!-- validate qty  -->
	if (qty < 1) {
		alert ("No quantity entered");
		return;
	}
	
	if (cost <= 0) {
		alert ("Please contact us for details");
		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=16543&quantity="+qty+"&price="+price+"&returnurl="+nextURL;
	
}

function open_course_window(t,d,p) 
{
new_window = open("","Dive","width=500,height=500,left=10,top=10,scrollbars=yes,resizable=yes");

// open new document 
new_window.document.open();

// Text of the new document
// Replace your " with ' or \" or your document.write statements will fail
new_window.document.write("<html><title>"+t+"</title>");
new_window.document.write("<body bgcolor=\"#000046\">");
new_window.document.write("<center>");
  new_window.document.write("<table width=\"80%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"5\" bgcolor=\"#B3BCFF\">");
    new_window.document.write("<tr>");
      new_window.document.write("<td><center><font face=\"Arial, Helvetica, sans-serif\" size=\"+1\">");
        new_window.document.write(t);
      new_window.document.write("</font></center></td>");
    new_window.document.write("</tr>");
    new_window.document.write("<tr>");
      new_window.document.write("<td><font face=\"Arial, Helvetica, sans-serif\" size=\"2\"><div align=\"justify\">"+d+"</div></font></td>");
    new_window.document.write("</tr>");
	new_window.document.write("<tr>");
      new_window.document.write("<td><center>");
	  if(p!="") {
	  	new_window.document.write("<img width=\"180\" src="+p+">");
	  }		
      new_window.document.write("</center></td>");
    new_window.document.write("</tr>");
  new_window.document.write("</table>");
new_window.document.write("</center>");
new_window.document.write("</body></html>");

// close the document
//new_window.document.close(); 
}

