﻿ var purl="http://www.hxsport.com.cn/";
function clickHandler(_){for(var $=1;$<=4;$++)document.getElementById("details"+$).style.display="none";for($=1;$<=4;$++)if($+1==_)document.getElementById("details"+_).style.display="none";else document.getElementById("details"+_).style.display=""}function HidHandler(){for(var $=1;$<=4;$++)document.getElementById("details"+$).style.display="none"}var Dtimer=null,Dtimer2=null,IsGetCart=true,Mdisplay=false,hideDiv,Container,button,jqShowObj,offset,height,width,btnHeight,btnWidth;function initDMenu(A,B,C,_){hideDiv=$("<div style='z-index:10000;'></div>");Container=$("<div id=\"Container\"></div>");hideDiv.append(Container);button=$(A);jqShowObj=$(B);offset=button.offset();height=jqShowObj.height();width=jqShowObj.width();btnHeight=button.height();btnWidth=button.width();$(document.body).prepend(hideDiv)}function showDMenu(){if(Mdisplay==true)return false;else{Mdisplay=true;Container.css({margin:"0 auto",width:btnWidth+"px",height:btnHeight+"px"});hideDiv.css({position:"absolute",top:offset.top+16+"px",left:button.offset().left-35+"px",height:height+"px",width:width+"px"}).show();Container.css({border:"1px solid #666666"});Container.animate({marginTop:10,height:height+4,width:width+4,opacity:"100"},100,function(){jqShowObj.show();Container.append(jqShowObj);Container.css({border:"0px"});jqShowObj.mouseover(function(){clearTimeout(Dtimer);clearTimeout(Dtimer2)}).mouseout(function(){hideDMenu()})})}}function hideDMenu(){clearTimeout(Dtimer);clearTimeout(Dtimer2);Dtimer=setTimeout(function(){Container.css({border:"1px solid #666666"});$(document.body).prepend(jqShowObj);jqShowObj.hide();Container.empty();Container.animate({width:btnWidth,height:btnHeight,marginTop:"0",opacity:"0"},100,function(){Container.hide();hideDiv.hide();Mdisplay=false})},100)}$(document).ready(function(){if(IsGetCart){initDMenu("#CartSwitch_wrap","#MiniCartDiv");$("#CartSwitch_wrap").mouseover(function(){clearTimeout(Dtimer);height=$("#MiniCartDiv").height();Dtimer=setTimeout("showDMenu()",100)}).bind("mouseleave",function(){clearTimeout(Dtimer);if(Mdisplay==true)Dtimer2=setTimeout("hideDMenu()",100)});ShowMiniCart()}$("#textfield").keydown(function(_){if(_.keyCode==13){$("#imgSearch").click();return false}}).mousemove(function(){if($("#textfield").val()=="\u8f93\u5165\u4ea7\u54c1\u7f16\u7801\u67e5\u8be2")$("#textfield").val("");$("#textfield").focus()}).mouseout(function(){if($.trim($("#textfield").val()).length<=0)$("#textfield").val("\u8f93\u5165\u4ea7\u54c1\u7f16\u7801\u67e5\u8be2");$("#textfield").blur()});$("#imgSearch").click(function(){if($("#textfield").val()!="\u8f93\u5165\u4ea7\u54c1\u7f16\u7801\u67e5\u8be2"&&$.trim($("#textfield").val()).length>0)location.href=purl+"Customer/CustomerSearchProduct.aspx?productcode="+escape($("#textfield").val());else alert("\u8bf7\u8f93\u5165\u4ea7\u54c1\u7f16\u53f7\uff01")});$("#logout").click(function(){if(confirm("\u786e\u8ba4\u8981\u9000\u51fa\u4e48\uff1f"))$.ajax({type:"GET",url:purl+"ajaxServer/ajaxCommon.aspx",data:"action=logout&Id=0",dataType:"text",cache:false,success:function($){location.href=purl+"index.shtml"}})})});function ShowMiniCart(){$.ajax({type:"GET",url:purl+"ajaxServer/ForShoppingCart.aspx",data:"action=minicart&ID=0&productCount=0",dataType:"html",cache:false,success:function(_){$("#MiniCartDiv").html(_)}})}function removeMiniProduct(_){if(confirm("\u786e\u5b9a\u4e0d\u8d2d\u4e70\u8be5\u5546\u54c1\uff1f"))$.ajax({type:"GET",url:purl+"ajaxServer/ForShoppingCart.aspx",data:"action=remove&ID="+_+"&productCount=0",dataType:"html",cache:false,success:function($){ShowMiniCart()}})}