﻿function copyToClipBoard(){var a=document.location;a+="\r\n";window.clipboardData.setData("Text",a);alert("Copy success!");}function DealWeekItemPrice(b){var a=new Date();$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?productid="+b+"&Type=10&time="+a.getTime(),dataType:"html",data:"",beforeSend:function(){},success:function(c){$("#deal"+b).html(c);}});}function LoadLoginInfo(){var a=new Date();$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=11&time="+a.getTime(),dataType:"html",data:"",beforeSend:function(){},success:function(b){$("#logindiv").html(b);}});}function KeywordSearch(a){if(a!=""){location.href="/SearchList.aspx?keyword="+escape(a);}else{alert("please input keywords");}}function changeCurrencies(b,a){if($("#CanCurrentCurrencies").val()=="false"){alert("Sorry! you can change currencies this time!");$("#"+a)[0].selectedIndex=0;}else{$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=3&currency="+b,dataType:"html",data:"",success:function(c){window.location.reload();}});}}function Subscribe(){$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=2&email="+$("#TextBoxSubscribe").val(),dataType:"html",data:"",success:function(a){alert(a);}});}function GoHelpPage(){window.location.href="/Help/";}function checkinputbuy(b,a){if(/^[-+]?\d+(\.\d+)?$/.test(b.value)){$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=5&productid="+$("#"+a).val()+"&qty="+$("#Qty").val(),dataType:"html",data:"",success:function(c){if(c=="false"){alert("Sorry, the quality of the product does not exist,Please try another quality");b.value="";b.focus();return false;}else{return true;}}});}else{alert("Please input Qty value!");b.value="";b.focus();return false;}}function AddToFavorite(a){window.location.href="/Member/MyFavorites.aspx?id="+a;}function ItemAddToCart(f,d,b,e){if(b=="00000000-0000-0000-0000-000000000000"){alert("please select the 'Custom size' checkbox first and fill in the Detail Custom size information!");}else{if(/^[-+]?\d+(\.\d+)?$/.test($("#Qty").val())){var c="/ShoppingCart/ShoppingCart.aspx?qty="+f+"&proId="+d+"&sizeId="+b+"&colorId="+e;var a=window.open(c,"shoppingcarts");a.focus();}else{alert("Please the correct input Qty value!");}}}function OutputPriceHTML(a){$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=4&productid="+$("#"+a).val(),dataType:"html",data:"",beforeSend:function(){},success:function(b){$("#divprices").html(b);},complete:function(){$("#divpriceloading").html("");}});}function shopcartcheckinputbuy(e,c,a,d,f,b){if($("#"+e).val()!=a){if(/^[-+]?\d+(\.\d+)?$/.test($("#"+e).val())){$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=6&productid="+c+"&qty="+$("#"+e).val()+"&cartid="+f,dataType:"html",data:"",success:function(g){if(g=="true"){alert("updated");window.location.reload();}else{alert(g);$("#"+e).val(a);}}});}else{alert("Please input Qty value!");$("#"+e).val(a);return false;}}}function ItemAddToCartViaCustomSize(m,j,e,l,f,d){var h=e.split(",");var g=j.split(",");var c="";var k="";for(i=0;i<=g.length;i++){if(g[i]!=null){if($.trim($("#"+g[i]).val()).length>0){c+="br"+h[i]+"rp"+$("#"+g[i]).val();k+=$("#"+g[i]).val();}else{alert("please fill in the value for:"+h[i]);return false;}}}if(/^[-+]?\d+(\.\d+)?$/.test($("#Qty").val())&&$.trim(k).length>0){var b="/ShoppingCart/ShoppingCart.aspx?qty="+m+"&proId="+l+"&sizeId="+f+"&colorId="+d+"&customsizes="+c;var a=window.open(b,"shoppingcarts");a.focus();}else{alert("Please the correct input Qty value and the size information!");}}function UpdatedAmount(){var a=$("input[@type=checkbox][@checked]");var b="0";a.each(function(c){b=b+","+a[c].value;});$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=7&cartIds="+b,dataType:"html",data:"",success:function(c){$("#AmountDiv").html(c);}});}function postcategories(a){$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=13&editcates="+a,dataType:"html",data:"",success:function(b){if(b=="false"){return false;}else{return true;}}});}function GetRecommandItemsAtProductViewpage(a){$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=8&productid="+$("#"+a).val(),dataType:"html",data:"",success:function(b){$("#recommandDiv").html(b);},complete:function(){$("#divFeaturedloading").html("");}});}function DisplayBigPic(b,a){$("#"+b).attr({src:a});}function CheckProductFileName(a){$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?Type=9&filename="+$("#"+a).val(),dataType:"html",data:"",success:function(b){alert(b);}});}function LoadProductPrice(b){var a=new Date();$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?productid="+b+"&Type=10&time="+a.getTime(),dataType:"html",data:"",beforeSend:function(){},success:function(c){$("#div"+b).html(c);}});}function LoadItemPrice(b){var a=new Date();$.ajax({type:"POST",url:"/Ajax/DataUpdate.aspx?productid="+b+"&Type=12&time="+a.getTime(),dataType:"html",data:"",beforeSend:function(){},success:function(c){$("#div"+b).html(c);}});}function SelectAll(c,b){var e=c.form;var d=b;if(c.tagName=="INPUT"){if(c.type.toUpperCase()!="CHECKBOX"){if(c.checked==true){c.checked=false;}else{c.checked=true;}}}if(e){for(var a=0;a<e.elements.length;a++){if((e.elements[a].name.indexOf(d)+d.length)==e.elements[a].name.length){if(e.elements[a].tagName=="INPUT"){if(e.elements[a].type.toUpperCase()=="CHECKBOX"){e.elements[a].checked=c.checked;}}}}}}