//SBDrawCart
//creates the inside of the table cart with the current cart items
var cartAni;
var SBDrawCart = {
	row : "sc_odd",
	op : "",
	init : function(){
		cartAni = new fx.Combo(
			'cartWrapper', {
				duration: 300, height: false, onComplete: function(){
					if(this.el.style.opacity == 0){
						$('cartWrapper').style.display = "none";
					}
				}
			}
		);
		cartAni.hide();
		if($("SBJSCart")){
			this.op += '<form name="cartForm" action="" method="post">';
			this.op += '<input type="hidden" name="workingReferer" value="" />';
			this.op += '<table class="shopTable" width="230" cellspacing="0" cellpadding="0" border="0">';
			this.op += '<tr class="cartHead"><td colspan="3" style="border:1px solid black;"><a href="#" onClick="expandCart();return false"><img src="/graphics/StoreBox/h_shop.gif" width="400" height="25" alt="Shopping Cart"></a></td></tr>';
			if(arrayName.length > 0){
				for(var x = 0; x < arrayName.length; x++){
					if(this.row == "sc_even"){
						this.op += '<tr class=\"sc_even\">';
						this.row = "sc_odd";
					}
					else{
						this.op += '<tr class=\"sc_odd\">';
						this.row = "sc_even";
					}
					this.op += '<td class="cartQty">'+ arrayQuantity[x] +'</td>';
					this.op += '<td class="cartName">'+ arrayName[x] +'</td>';				
					this.op += '<td class="cartPrice">'+ asCurrency(arrayPrice[x]) +'</td>';
					this.op += '</tr>';
				}
				this.op += '<tr class="subTotalRow ' + this.row +'"><td colspan="2" style="text-align: right;">sub-total:</td><td class="cartPrice"><strong>'+ asCurrency(subtotal) +'</strong></td></tr>';
			} else {
				this.op += '<tr><td colspan="3" class="cartEmpty">No Items In Cart</td></tr>';
			}
			this.op += '<tr class="submitRow sc_btns">';
			this.op += '<td colspan="3"><div id="cartButtons">';
			this.op += '<a href="#" onclick="SBEditCart();return false"><img src="/graphics/StoreBox/b_edit_cart2.gif" width="61" height="27" alt="Edit Cart" /></a>'
			this.op += '<a href="#" onclick="SBCheckout();return false"><img src="/graphics/StoreBox/b_checkout2.gif" width="90" height="27" alt="Checkout" /></a></div></td>';
			this.op += '</tr></table>';
			 $("SBJSCart").innerHTML = this.op;
		 }
		runFromUrl.init();
	}
}