$(document).ready(function(){$("#cartdialog").dialog({draggable:true,resizable:true,bgiframe:true,height:350,width:700,autoOpen:false})});var xmlHttp;function createXMLHttpRequest(){if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest()}}}function cart(b){var a=document.getElementById("cartdialog");a.innerHTML="\u6570\u636e\u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u540e.....";$("#cartdialog").dialog("option","title","\u6211\u7684\u8d2d\u7269\u8f66\uff0d\u5e7f\u96c5\u4e66\u82d1");$("#cartdialog").dialog("open");showCart(b)}function backClose(){$("#cartdialog").dialog("close")}function showCart(c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mycart_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showCartChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=add&SKU="+c)}function showCartChange(){var a=document.getElementById("cartdialog");if(xmlHttp.readyState==4&&xmlHttp.status==200){a.innerHTML=xmlHttp.responseText}}function delItem(c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mycart_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showCartChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=del&SKU="+c)}function delItem1(c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mycart_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showCartChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=del1&SKU="+c)}function clearCart(){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mycart_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showCartChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=clear")}function addFavItem(c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mycart_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showRelChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=fav&SKU="+c)}function showRelChange(){var a=document.getElementById("relMessageCart");if(xmlHttp.readyState==4&&xmlHttp.status==200){a.innerHTML=xmlHttp.responseText}}function showCartUpdate(){var c=document.getElementsByName("book");var e=document.getElementById("relMessageCart");var h="",f="";for(var d=0;d<c.length;d++){var g=document.getElementById(c[d].title);if(g.value==null||g.value==""){e.innerHTML="\u60a8\u8f93\u5165\u7684\u6570\u91cf\u503c\u4e0d\u80fd\u4e3a\u7a7a\uff0c\u8bf7\u586b\u5199\uff01";return}else{if(!/^\d+$/.test(g.value)){e.innerHTML="\u60a8\u8f93\u5165\u7684\u6570\u91cf\u503c\u5fc5\u987b\u4e3a\u6570\u5b57\uff0c\u8bf7\u786e\u5b9a\u91cd\u65b0\u8f93\u5165\uff01";return}}c[d].value=g.value;h=h+c[d].title+"|";f=f+c[d].value+"|"}e.innerHTML="";createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mycart_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showCartChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=update&SKUS="+h+"&q="+f)}function changPageNo(d,c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mygyabooks_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showFavRelChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=page&readerEmail="+d+"&pageNo="+c)}function changPageNo(c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mygyabooks_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showFavRelChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=page&pageNo="+c)}function delFav(d,a){createXMLHttpRequest();var c=";jsessionid="+document.getElementById("jsessionid").value;var b="/mygyabooks_.jsp"+c;xmlHttp.open("POST",b);xmlHttp.onreadystatechange=showFavRelChange;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=del&id="+d+"&pageNo="+a)}function showFavRelChange(){var a=document.getElementById("favDiv");if(xmlHttp.readyState==4&&xmlHttp.status==200){a.innerHTML=xmlHttp.responseText}}function showBODetail(c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/mygyabooks_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=showRelBODetail;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("action=bo&boid="+c)}function showRelBODetail(){var a=document.getElementById("cartdialog");if(xmlHttp.readyState==4&&xmlHttp.status==200){$("#cartdialog").dialog("option","title","\u6211\u7684\u8ba2\u5355\uff0d\u5e7f\u96c5\u4e66\u82d1");$("#cartdialog").dialog("open");a.innerHTML=xmlHttp.responseText}}function addFav(c){createXMLHttpRequest();var b=";jsessionid="+document.getElementById("jsessionid").value;var a="/fav_.jsp"+b;xmlHttp.open("POST",a);xmlHttp.onreadystatechange=addFavRel;xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlHttp.send("SKU="+c)}function addFavRel(){var a=document.getElementById("cartdialog");if(xmlHttp.readyState==4&&xmlHttp.status==200){$("#cartdialog").dialog("option","title","\u6dfb\u52a0\u6536\u85cf\uff0d\u5e7f\u96c5\u4e66\u82d1");$("#cartdialog").dialog("open");a.innerHTML=xmlHttp.responseText}};

