﻿function cartMiniListViewInstance()
{this.callBack=null;this.visible=false;}
var __cartMiniListView=new cartMiniListViewInstance();function cartMiniListViewClear()
{var ctrlView=document.getElementById("ctrlcartminilist");while(ctrlView.firstChild)
ctrlView.removeChild(ctrlView.firstChild);}
function cartMiniListViewDrawBody()
{var table=document.createElement("table");table.className="ctrlcartminilist";var tBody=document.createElement("tbody");{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;var img=new Image();img.src="/images/cart.gif";td.appendChild(img);td.appendChild(document.createTextNode(" Contents"));tr.appendChild(td);tBody.appendChild(tr);}
if(__cartMiniListInfo.products.length==0)
{var tr=document.createElement("tr");var td=document.createElement("td");td.className="header";td.colSpan=2;td.appendChild(document.createTextNode("Your shopping cart is empty"));tr.appendChild(td);tBody.appendChild(tr);}
else
{{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;td.appendChild(document.createElement("br"));tr.appendChild(td);tBody.appendChild(tr);}
for(var i=0;i<__cartMiniListInfo.products.length;i++)
{{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;var a=document.createElement("a");a.href="/Product.aspx?t=1&i="+__cartMiniListInfo.products[i].id;a.appendChild(document.createTextNode(__cartMiniListInfo.products[i].name));td.appendChild(a);tr.appendChild(td);tBody.appendChild(tr);}
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="50%";td.appendChild(document.createElement("b").appendChild(document.createTextNode("Quantity:")));tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="50%";var a=document.createElement("a");a.href="/Cart.aspx";a.appendChild(document.createTextNode(__cartMiniListInfo.products[i].quantity));td.appendChild(a);tr.appendChild(td);}
tr.appendChild(td);tBody.appendChild(tr);}
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="50%";td.appendChild(document.createElement("b").appendChild(document.createTextNode("Price:")));tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="50%";td.appendChild(document.createTextNode("$"+__cartMiniListInfo.products[i].price));tr.appendChild(td);}
tr.appendChild(td);tBody.appendChild(tr);}
{var tr=document.createElement("tr");{var td=document.createElement("td");td.style.width="50%";var span=document.createElement("span");span.className="mscclubprice";span.appendChild(document.createElement("b").appendChild(document.createTextNode("Club Price:")));td.appendChild(span);tr.appendChild(td);}
{var td=document.createElement("td");td.style.width="50%";var span=document.createElement("span");span.className="mscclubprice";span.appendChild(document.createTextNode("$"+__cartMiniListInfo.products[i].priceclub));td.appendChild(span);tr.appendChild(td);}
tr.appendChild(td);tBody.appendChild(tr);}
{var tr=document.createElement("tr");var td=document.createElement("td");td.colSpan=2;td.appendChild(document.createElement("br"));tr.appendChild(td);tBody.appendChild(tr);}}}
table.appendChild(tBody);cartMiniListViewClear();var ctrlView=document.getElementById("ctrlcartminilist");ctrlView.appendChild(table);}
function cartMiniListViewDrawLoading()
{var ctrlView=document.getElementById("ctrlcartminilist");var center=document.createElement("center");var table=document.createElement("table");var tBody=document.createElement("tbody");table.style.width=ctrlView.style.width;table.style.height=ctrlView.style.height;table.cellPadding=0;table.cellSpacing=0;var tr=document.createElement("tr");var td=document.createElement("td");td.className="loading";td.style.width="100%";td.style.height="100%";td.style.textAlign="center";td.style.verticalAlign="middle";var img=new Image();img.src="/images/loading.gif";td.appendChild(img);tr.appendChild(td);tBody.appendChild(tr);table.appendChild(tBody);center.appendChild(table);cartMiniListViewClear();ctrlView.appendChild(center);}
function cartMiniListViewInit(callerContext)
{cartMiniListViewDrawBody();}
function cartMiniListViewCreate()
{__cartMiniListView.callBack=cartMiniListViewInit;__cartMiniListView.visible=false;}
function cartMiniListViewLoad()
{cartMiniListViewDrawLoading();cartMiniListInfoGet(__cartMiniListView);}
function cartMiniListViewCallBack()
{__cartMiniListInfo.callerContext.callBack(__cartMiniListInfo.callerContext);}
function cartMiniListViewShow()
{if(__cartMiniListView.visible==true)
return;var ctrlView=document.getElementById("ctrlcartminilist");ctrlView.style.height="200px";ctrlView.style.visibility="visible";var link=document.getElementById("ctrlcartminishowhidelink");while(link.firstChild)
link.removeChild(link.firstChild);link.appendChild(document.createTextNode("Hide contents"));__cartMiniListView.visible=true;cartMiniListViewLoad();}
function cartMiniListViewHide()
{if(__cartMiniListView.visible==false)
return;var ctrlView=document.getElementById("ctrlcartminilist");ctrlView.style.height="1px";ctrlView.style.visibility="hidden";var link=document.getElementById("ctrlcartminishowhidelink");while(link.firstChild)
link.removeChild(link.firstChild);link.appendChild(document.createTextNode("Show contents"));__cartMiniListView.visible=false;cartMiniListViewClear();}
function cartMiniListViewVisible()
{return __cartMiniListView.visible;}
function cartMiniListViewVisibilityToggle()
{if(__cartMiniListView.visible==true)
cartMiniListViewHide();else
cartMiniListViewShow();}
