var Carturl="go180w.pgm";var Bulkurl="gb100w.pgm";var Timerpopup,Timer;var Pageurl="";var TimeToLive;if(typeof jQuery!=="undefined"){jQuery(document).ready(loadcartbulk);}
function loadcartbulk(){getlang();jQuery.ajaxSetup({type:"GET",cache:false});setupminis();}
function getlang(){Carturl="/"+ulang+"/"+Carturl;Bulkurl="/"+ulang+"/"+Bulkurl;}
function closepopup(){if(typeof Timerpopup!=="undefined"){window.clearTimeout(Timerpopup);}
jQuery("#pop_up_content").html("");jQuery("#pop_up").slideUp("slow");jQuery("#tooltip").hide(1);if($.browser.msie&&$.browser.version.substr(0,1)<7){jQuery('#searchtype').css('display','');}}
function setupminis(){getcartitems();getbulkitems();cartbulkhover();jQuery(".closediv").click(function(){window.clearTimeout(Timerpopup);TimeToLive=10;jQuery("#quotetab").mouseout();jQuery("#carttab").mouseout();jQuery("#pop_up").mouseout();});}
function cartbulkhover(){jQuery("#pop_up").hover(function(){window.clearTimeout(Timerpopup);TimeToLive=1500;},function(e){window.clearTimeout(Timerpopup);Timerpopup=window.setTimeout("closepopup()",TimeToLive);});jQuery("#carttab").hover(function(){jQuery.ajax({url:Carturl,data:"task=getminicart"+Pageurl,success:function(carthtml){window.clearTimeout(Timerpopup);jQuery('#headerbulk').css('display','none');jQuery('#headercart').css('display','');showpopup(carthtml,"cart_style");TimeToLive=1500;}});},function(){window.clearTimeout(Timerpopup);Timerpopup=window.setTimeout("closepopup()",TimeToLive);});jQuery("#quotetab").hover(function(){jQuery.ajax({url:Bulkurl,data:"task=getminibulk",success:function(bulkhtml){window.clearTimeout(Timerpopup);jQuery('#headerbulk').css('display','');jQuery('#headercart').css('display','none');showpopup(bulkhtml,"bulkq_style");if($.browser.msie&&$.browser.version.substr(0,1)<7){jQuery('#searchtype').css('display','none');}
TimeToLive=1500;}});},function(){window.clearTimeout(Timerpopup);Timerpopup=window.setTimeout("closepopup()",TimeToLive);});}
function getcartitems(){jQuery.ajax({url:Carturl,data:"task=getcartitems"+Pageurl,success:function(items){if(items=="0"){jQuery("#carttab").html("");jQuery("#cartlist").css('display','none');}else{var carthtml="";carthtml="<div class=\"carttabdiv\">"+"<div class=\"carttabtext\">"+"<span lang=\"Y\" key=\"cart\">Cart</span><br/>"+items;if(items>1){carthtml=carthtml+" <span lang=\"Y\" key=\"items\">items</span>";}else{carthtml=carthtml+" <span lang=\"Y\" key=\"item\">item</span>";}
carthtml=carthtml+"</div></div>";jQuery("#carttab").html(carthtml);tran_SwitchLang(curLang,"#carttab");jQuery("#cartlist").css('display','');}}});}
function getminicart(){window.clearTimeout(Timerpopup);closepopup();jQuery.ajax({url:Carturl,data:"task=getminicart"+Pageurl,success:function(carthtml){jQuery('#headerbulk').css('display','none');jQuery('#headercart').css('display','');showpopup(carthtml,"cart_style");Timerpopup=window.setTimeout("closepopup()",2000);}});}
function getbulkitems(){jQuery.ajax({url:Bulkurl,data:"task=getbulkitems",success:function(items){if(items=="0"){jQuery("#quotetab").html("");jQuery("#quotelist").css('display','none');}else{var quotehtml;quotehtml="<div class=\"carttabdiv\">"+"<div class=\"carttabtext\">"+"<span lang=\"Y\" key=\"quote\">Quote</span><br/>"+items;if(items>1){quotehtml=quotehtml+" <span lang=\"Y\" key=\"items\">items</span>";}else{quotehtml=quotehtml+" <span lang=\"Y\" key=\"item\">item</span>";}
quotehtml=quotehtml+"</div></div>";jQuery("#quotetab").html(quotehtml);tran_SwitchLang(curLang,"#quotetab");jQuery("#quotelist").css('display','');}}});}
function getminibulk(){window.clearTimeout(Timerpopup);closepopup();jQuery.ajax({url:Bulkurl,data:"task=getminibulk",success:function(bulkhtml){jQuery('#headerbulk').css('display','');jQuery('#headercart').css('display','none');showpopup(bulkhtml,"bulkq_style");if($.browser.msie&&$.browser.version.substr(0,1)<7){jQuery('#searchtype').css('display','none');}
Timerpopup=window.setTimeout("closepopup()",2000);}});}
function showpopup(divhtml,style){jQuery("#pop_up").removeClass();jQuery("#pop_up").addClass(style);jQuery("#pop_up_content").html(divhtml);tran_SwitchLang(curLang,"#pop_up_content");jQuery("#pop_up").slideDown("slow");Timerpopup=window.setTimeout("closepopup()",9000);minicartfnc();}
function minicartfnc(){var closedivtitle=jQuery("#closedivtitle").html();jQuery(".closediv img").attr("title",closedivtitle);jQuery(".closediv img").attr("alt",closedivtitle);jQuery('input[name="checkout"]').click(function(){window.location.href=Carturl;});jQuery(".productdesc").hover(function(e){var desc=jQuery(this).parents("tr").find(".proddesc").html();if(desc!=""){jQuery("#tooltip").css({"position":"absolute","left":e.pageX+10,"top":e.pageY,"background-color":"rgb(255, 255, 225)","border":"1px solid #000000","z-index":"99"});jQuery("#tooltip").html(desc).show(1);}else{jQuery("#tooltip").hide(1);}},function(e){hidetooltip();});}
function hidetooltip()
{jQuery("#tooltip").hide(1);}
