function GetQueryString(a){var c=new RegExp("(^|&)"+a+"=([^&]*)(&|$)");var b=window.location.search.substr(1).match(c);if(b!=null){return unescape(b[2])}return null}$(document).ready(function(){var a=document.cookie.match(new RegExp("(^| )help=([^;]*)(;|$)"));if(a!=null&&a[0].indexOf("help=true")>=0){goToObj("divHelp",70)}});function selectPeople(b,a){$(b).parent().find(".red").removeClass("red");$(b).addClass("red");$("#divPeople dl").css("display","none");$("#divPeople dl[id='"+a+"']").css("display","block")}$(function(){$(".overtimes").timer();$.ajax({url:"/JqAjax/GetPromoUrlHandler.ashx",success:function(e){$("#txtUrl").val(e);var d=new ZeroClipboard.Client();d.setHandCursor(true);d.setText(e);d.addEventListener("complete",function(){alert("复制成功")});d.glue("lnkCopy","spUrl")}});var a=document.location.href;var c=a.split("/");var b=c[c.length-2];$.ajax({url:"/JqAjax/UpdateSaleProductAttentionHandler.ashx?num="+b,success:function(d){}})});$(".jdtip").poshytip({className:"tip-yellow",content:function(){return $($(this).attr("href")).html()},showTimeout:1,alignTo:"target",alignX:"center",alignY:"bottom",offsetY:5,allowTipHover:false});$(document).ready(function(){ajaxSubmitForPostAndText("/JqAjax/GetLoginHandler.ashx","",Login_Success)});function Login_Success(a){if(a!="null"){$(".login-error").css("display","none")}}var $button;function saleProduct_Ajax_StartBuying(a){$button=$(a);if($button.attr("state")=="1"){alert("请勿重复提交");return}$button.attr("state","1");ajaxSubmitForPostAndText("/JqAjax/GetLoginHandler.ashx","",saleProduct_Ajax_StartBuying_Success,function(){$button.attr("state","0")})}function saleProduct_Ajax_StartBuying_Success(o){var h=o;var n=window.location.href;var k=n.split("/");var j=k[k.length-2];if(h=="null"){alert("请登录网站");window.location.href="/login/?ReturnUrl="+encodeURIComponent("/qianggou/"+j+"/")}else{var c=$("#div"+j);var l=c.find("select[name='teamDate']").val();var b=c.find("select[name='quoteObject']");var m=0;var g="";for(var f=0;f<b.length;f++){var a=$(b[f]);var e=parseInt(a.val(),10);var i=a.attr("detail");m+=e;if(f>0){g+=";"}g+=i+","+e}if(m==0){alert("请选择数量");return}ajaxSubmitForPostAndJson("/JqAjax/InsertSaleProductOrder.ashx","num="+j+"&count="+m+"&detail="+g+"&teamDateId="+l,StartBuying_Success,function(){$button.attr("state","0")})}}var salNum="";function StartBuying_Success(a){$button.attr("state","0");if(a.isSuccess){alert("抢购成功！");document.location="/paymentmethod/"+a.message+"/"}else{alert(a.message)}}function saleProduct_Ajax_Error(a){if(a.responseText!=null&&a.responseText.indexOf("超过了限购数量")>-1){alert("超过了限购数量");return}if(a.responseText!=null&&a.responseText.indexOf("会员不存在")>-1){alert("会员不存在");return}if(a.responseText!=null&&a.responseText.indexOf("抢购产品不存在")>-1){alert("抢购产品不存在");return}if(a.responseText!=null&&a.responseText.indexOf("抢购产品尚未开始或已经结束")>-1){alert("抢购产品尚未开始或已经结束");return}if(a.responseText!=null&&a.responseText.indexOf("剩余数量不足")>-1){alert("剩余数量不足");return}if(a.responseText!=null){alert(a.responseText)}}$(document).ready(function(){$(".i-mail").click(function(){$("#mengban").show()});$(".cover_layer_close").click(function(){$("#mengban").hide()})});