window.onload=function(){document.getElementById("logo-bar-cart-tab").onselectstart=function(){return false;}
document.getElementById("logo-bar-cart-tab").onmousedown=function(){return false;}}
function cartTabResize(cartListNum){if(cartListNum==null||cartListNum==0||cartListNum==''){document.getElementById("logo-bar-cart-box").style.height="120px";document.getElementById("logo-bar-cart-box-innercontent").style.height="50px";}
else{document.getElementById("logo-bar-cart-box").style.height=String(205+80*cartListNum)+"px";document.getElementById("logo-bar-cart-box-innercontent").style.height=String(135+80*cartListNum)+"px";document.getElementById("logo-bar-cart-box-bottom").style.height=String(795-80*cartListNum)+"px";document.getElementById("logo-bar-cart-box-bottom").style.top=String(205+80*cartListNum)+"px";}}
function fadeShow(elementid){var element=document.getElementById(elementid);if(element.style.opacity!=null&&element.style.opacity!=''&&element.style.opacity!='1')
fadeShowHide(elementid);}
function fadeHide(elementid){var element=document.getElementById(elementid);if(element.style.opacity==null||element.style.opacity==''||element.style.opacity=='1')
fadeShowHide(elementid);}
function fadeShowHide(elementid){var element=document.getElementById(elementid);document.getElementById("logo-bar-cart-box").style.left=getposOffset(document.getElementById("logo-bar-cart-tab"),"left")-301+"px";if(element.FadeState==null){if(element.style.opacity==null||element.style.opacity==''||element.style.opacity=='1')
element.FadeState=2;else
element.FadeState=-2;}
if(element.FadeState==1||element.FadeState==-1){element.FadeState=element.FadeState==1?-1:1;element.FadeTimeLeft=331-element.FadeTimeLeft;}
else{element.FadeState=element.FadeState==2?-1:1;element.FadeTimeLeft=331;setTimeout("fade("+new Date().getTime()+",'"+elementid+"')",33);}}
function fade(lastTick,eid){var curTick=new Date().getTime();var elapsedTicks=curTick-lastTick;var element=document.getElementById(eid);if(element.FadeTimeLeft<=elapsedTicks){element.style.opacity=element.FadeState==1?'1':'0';element.style.filter="alpha(opacity = "+(element.FadeState==1?'100':'0')+")";element.FadeState=element.FadeState==1?2:-2;return;}
else if(eid=="logo-bar-cart-box"){if(element.FadeState=="1"){document.getElementById("logo-bar-cart-box").style.zIndex="101";document.getElementById("fullscreenCartDiv").style.display="block";}
else if(element.FadeState=="-1"){document.getElementById("logo-bar-cart-box").style.zIndex="-1";document.getElementById("fullscreenCartDiv").style.display="none";}}
element.FadeTimeLeft-=elapsedTicks;var newOpVal=element.FadeTimeLeft/331;if(element.FadeState==1)
newOpVal=1-newOpVal;element.style.opacity=newOpVal;element.style.filter="alpha(opacity = "+(newOpVal*100)+")";setTimeout("fade("+curTick+",'"+eid+"')",33);}
function soundmasterAJAX(functionName,element,variable){var xmlhttp;if(window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();else if(window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");else
alert("Your browser does not support XMLHTTP!");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)
document.getElementById(element).innerHTML=xmlhttp.responseText;}
switch(functionName){case"ajax-cart-tab-click":{var url="/includes/ajax-cart-tab.asp?randomID="+Math.random();fadeShowHide("logo-bar-cart-box");break;}
case"ajax-cart-tab-update":{var url="/includes/ajax-cart-tab.asp?randomID="+Math.random()+"&productId="+variable;fadeShow("logo-bar-cart-box");break;}
case"ajax-cart-tab-remove":{var url="/includes/ajax-cart-tab.asp?randomID="+Math.random()+"&removeId="+variable;break;}
case"ajax-cart-number-update":{var url="/includes/ajax-cart-number.asp?randomID="+Math.random();break;}
default:}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}
var leftmenu;var topmenu;function showLeftMenu(lefttab,menucontents){leftmenu=document.getElementById("leftmenu");leftmenu.innerHTML="<div style='height:0px;position:relative;top:"+(menucontents.length*10+6)+"px"+";left:-11px;'><img src='/images/bar-left-menu-notch.jpg' /></div><div id='bar-left-menu' onMouseOver='cancelHideLeftMenu();' onMouseOut='hideLeftMenu();'>"+menucontents.join("<br />")+"</div>";leftmenu.x=getposOffset(lefttab,"left");leftmenu.y=getposOffset(lefttab,"top");leftmenu.style.left=leftmenu.x+122+"px";leftmenu.style.top=leftmenu.y-10-(menucontents.length*10)+"px";leftmenu.style.display="inline";}
function showTopMenu(toptab,menucontents){topmenu=document.getElementById("topmenu");topmenu.innerHTML="<div id='bar-top-menu' onMouseOver='cancelHideTopMenu();' onMouseOut='hideTopMenu();'>"+menucontents.join("<br />")+"</div>";topmenu.x=getposOffset(toptab,"left");topmenu.y=getposOffset(toptab,"top");topmenu.style.left=topmenu.x+(toptab.style.width.replace("px","")-96)*0.5+"px";topmenu.style.top=topmenu.y+28+"px";topmenu.style.display="inline";}
function getposOffset(what,offsettype){var totaloffset=(offsettype=="left")?what.offsetLeft:what.offsetTop;var parentEl=what.offsetParent;while(parentEl!=null){totaloffset=(offsettype=="left")?totaloffset+parentEl.offsetLeft:totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}
return totaloffset;}
function hideLeftMenu(){leftmenu=document.getElementById("leftmenu");delayHideLeftMenu=setTimeout("leftmenu.style.display='none'",250);}
function hideTopMenu(){topmenu=document.getElementById("topmenu");delayHideTopMenu=setTimeout("topmenu.style.display='none'",250);}
function cancelHideLeftMenu(){if(typeof delayHideLeftMenu!="undefined")
clearTimeout(delayHideLeftMenu);}
function cancelHideTopMenu(){if(typeof delayHideTopMenu!="undefined")
clearTimeout(delayHideTopMenu);}
function changeYellow(element){element.style.color="#F5A11E";}
function changeWhite(element){element.style.color="#FFFFFF";}
function changeDarkGrey(element){element.style.color="#363636";}
function changeMidGrey(element){element.style.color="#666666";}
function changeLightGrey(element){element.style.color="#97999C";}
function changeBlack(element){element.style.color="#000000";}
function changeBold(element){element.style.fontWeight="bold";}
function changeNormal(element){element.style.fontWeight="normal";}
function getQuote(productid){window.open("/get-a-quote.asp?productid="+productid,"quotewindow","status=0,toolbar=0,height=400,width=400");}
