//order now function
//01.07.2004: Originally changed the parent window location too quickly for the shopping basket iframe to be updated.
//20.04.2005: Now add a cheeky pause inbetween changing the iframe, so that the basket should have been notified in the background.
//21.04.2005: Try a setTimeout to do the parent window load later rather than pausing because pausing seems to delay updating of the iframe.
//27.04.2005: Remove all the above changes and put the bloody alert shit back, as the CONTINUE SHOPPING link wasn't working.
function order_now (href_url)
{
	if (window.frames.length > 0) { 
		window.frames["shopping_basket_iframe"].location = href_url;
		alert ("Contacting recordstore to add this item to your basket");
		//pause(2000);
		parent.window.location = "http://www.truelove.co.uk/shopping_basket_frame.asp";
		//setTimeout("parent.window.location = 'http://www.truelove.co.uk/shopping_basket_frame.asp';",2000);
	} 
	else 
	{ 
    	var shopping_basket_window = window.open (href_url, "shopping_basket_iframe", "dependent=yes,left=100,top=60,resizable=no,status=no,toolbar=no,location=no,menu=no,scrollbars=yes,width=150,height=110");
		shopping_basket_window.focus();
		//alert ("Contacting recordstore to add this item to your basket");
	}
}

//pre_order function
function pre_order (href_url)
{
    alert ("This item has not yet been released, however you can add it to your basket, pay for it during checkout and it will be sent to you on the day of release");
	if (window.frames.length > 0) { 
		window.frames["shopping_basket_iframe"].location = href_url;
		alert ("Contacting recordstore to add this item to your basket");
		//pause(2000);
		parent.window.location = "http://www.truelove.co.uk/shopping_basket_frame.asp";
		//setTimeout("parent.window.location = 'http://www.truelove.co.uk/shopping_basket_frame.asp';",2000);
	} 
	else 
	{ 
    	var shopping_basket_window = window.open (href_url, "shopping_basket_iframe", "dependent=yes,left=100,top=60,resizable=no,status=no,toolbar=no,location=no,menu=no,scrollbars=yes,width=150,height=110");
		shopping_basket_window.focus();
		//alert ("Contacting recordstore to add this item to your basket");
	}
}

//catalogue detail display
function catalog_detail_display (cat_number)
{
    var catalog_detail_window = window.open ("http://www.truelove.co.uk/blank.htm", "truelove_catalog_detail_display", "dependent=yes,left=100,top=60,resizable=yes,status=no,toolbar=no,location=no,menu=no,scrollbars=yes,width=650,height=600");
	cat_link = "http://www.truelove.co.uk/catalog_detail_display.asp?tnumber=" + cat_number;
	catalog_detail_window.location = cat_link;
	catalog_detail_window.focus();
}

//open popup window
function open_popup_window (url)
{
    var popup_window = window.open (url, "truelove_popup", "dependent=yes,left=100,top=60,resizable=no,status=no,toolbar=no,location=no,menu=no,scrollbars=yes,width=400,height=500");
	popup_window.focus();
}

// script (C) 2003 Sean McManus
// www.sean.co.uk
function pause(Amount)
{
d = new Date() //today's date
while (1)
{
mill=new Date() // Date Now
diff = mill-d //difference in milliseconds
if( diff > Amount ) {break;}
}
}
