// ShopMastery 1.2 Copyright 1999-2005 Andrew Eordogh

var secure = 'http://www.cubbyhouse.com.au';

//////////////////////////////////////////////////////////////////////////////
function basketAdd (ID,QTY) {
//////////////////////////////////////////////////////////////////////////////

file = 'shopmastery_basket.php?go=alert&id=' +ID+ '&qty=' +QTY;

mywindow=open(file,"alert","width=500,height=150,top=150,left=275,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no");

}

//////////////////////////////////////////////////////////////////////////////
function basketShow() {
//////////////////////////////////////////////////////////////////////////////

file = 'shopmastery_basket.php?go=showbasket';
w = 650;
h = 500;


mywindow=open(file,"basket","width=650,height=400,top=50,left=220,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no");

}

//////////////////////////////////////////////////////////////////////////////
function delItem (ITEMNO) {
//////////////////////////////////////////////////////////////////////////////

location.href="shopmastery_basket.php?go=delitem&itemno=" + ITEMNO;

}

//////////////////////////////////////////////////////////////////////////////
function changeItem (ITEMNO,NEWQTY) {
//////////////////////////////////////////////////////////////////////////////


location.href='shopmastery_basket.php?go=changeitem&itemno=' + ITEMNO+ '&newqty=' + NEWQTY;

}

//////////////////////////////////////////////////////////////////////////////	
function cent(amount) {
//////////////////////////////////////////////////////////////////////////////

     amount -= 0;
     amount = (Math.round(amount*100))/100;
     return (amount == Math.floor(amount)) ? amount + '.00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
 }

//////////////////////////////////////////////////////////////////////////////	
function goCheckout2() {
//////////////////////////////////////////////////////////////////////////////

parent.opener.location.href = 'shopmastery_checkout1.php';
self.close();

}

//////////////////////////////////////////////////////////////////////////////	
function clearBasket() {
//////////////////////////////////////////////////////////////////////////////	

		if (confirm('Are you sure you wish to delete all your ordered items?')) {
			index = document.cookie.indexOf("myBasket");
			location.href='shopmastery_basket.php?go=delbasket';
		}
}


function addCubby(ID,QTY,NAME,PRICE) {

NAME = escape(NAME);

file = 'shopmastery_basket.php?go=alert&id=' +ID+ '&qty=' +QTY+ '&name=' +NAME+  '&price=' +PRICE;

mywindow=open(file,"alert","width=500,height=150,top=150,left=275,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no");

}


function addOption(ID,QTY,OPTION,PRICE) {

file = 'shopmastery_basket.php?go=alert&id=' +ID+ '&qty=' +QTY+ '&option=' +OPTION+  '&price=' +PRICE;

mywindow=open(file,"alert","width=500,height=150,top=150,left=275,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no");
}