var html = "", img = "http://www.yabook.com.tw/main/modules/MySpace/images";
html = "\
\
\
 | \
\
 | \
\
\
 | \
\
\
\
\
| \
 | \
\
\
\
\
\
";
var id = "id_PrdListHome";
if (!id) id = "div_msg_PrdListHome2_js_";
var div = document.getElementById(id);
if (div) div.innerHTML = html;
var dataSellOut = "";
var PrdListIdx = 0;
var PrdListMode = "p";
var dataPrdList1t = "";
var dataPrdList2t = "";
var dataPrdList3t = "";
setTimeout("PrdListHomeOver_(1)", 100);
window.clickAddCart_ = function () { // function begin
var inpAy = document.getElementsByTagName("input"), pcAy = new Array();
for (var i=0; i";
for (var j=0; j<4; j++) {
html += "";
if (idx >= prdcodelist.length)
html += " ";
else
html += document.getElementById("BookCell_s02_"+prdcodelist[idx]).innerHTML;
html += " | ";
idx++;
}
html += "";
}
html += "";
document.getElementById('divPrdListHomeContent1p').innerHTML = html;
} // function end
window.PrdListShow1t_ = function () { // function begin
if (document.getElementById('divPrdListHomeContent1t').innerHTML != "") return;
if (!document.getElementById('SellOut_prdcodelist')) {
setTimeout('PrdListShow_()', 1000); return;
}
var BookCell_prdcodelist = document.getElementById("BookCell_s02_prdcodelist");
if (!BookCell_prdcodelist) {
PrdList1pLoad_();
return;
}
if (dataSellOut == "")
dataSellOut = document.getElementById('SellOut_prdcodelist').innerHTML;
var SellOut_prdcodelistAy = ","+dataSellOut+",";
var html = new Array();
html[html.length] = "";
html = html.join("");
document.getElementById('divPrdListHomeContent1t').innerHTML = html;
} // function end
function PrdList2pLoad_() {
iAJAX.divLoading_('divPrdListHomeContent2'+PrdListMode, 1);
iAJAX.iGet_("http://www.yabook.com.tw/main/uploads/yabook/s03.html", PrdList2pLoadProc_);
}
function PrdList2pLoadProc_(json) {
document.getElementById('dataPrdList2p').innerHTML = json;
iAJAX.iGet_("http://www.yabook.com.tw/main/uploads/yabook/s03.json", PrdList2pLoadProc2_);
}
function PrdList2pLoadProc2_(json) {
json = iAJAX.evalJson_(json);
if (json && json.result==1)
dataPrdList2t = json;
document.getElementById('divPrdListHomeContent2p').innerHTML = "";
document.getElementById('divPrdListHomeContent2t').innerHTML = "";
PrdListShow_();
}
window.PrdListShow2p_ = function () { // function begin
if (document.getElementById('divPrdListHomeContent2p').innerHTML != "") return;
if (!document.getElementById('SellOut_prdcodelist')) {
setTimeout('PrdListShow_()', 1000); return;
}
var BookCell_prdcodelist = document.getElementById("BookCell_s03_prdcodelist");
if (!BookCell_prdcodelist) {
PrdList2pLoad_();
return;
}
if (dataSellOut == "")
dataSellOut = document.getElementById('SellOut_prdcodelist').innerHTML;
var SellOut_prdcodelistAy = dataSellOut.split(",");
BookCell_prdcodelist = BookCell_prdcodelist.innerHTML; BookCell_prdcodelist = BookCell_prdcodelist.split(",");
var prdcodelist = new Array(), isOut;
for (var i=0; i";
for (var j=0; j<4; j++) {
html += "";
if (idx >= prdcodelist.length)
html += " ";
else
html += document.getElementById("BookCell_s03_"+prdcodelist[idx]).innerHTML;
html += " | ";
idx++;
}
html += "";
}
html += "";
document.getElementById('divPrdListHomeContent2p').innerHTML = html;
} // function end
window.PrdListShow2t_ = function () { // function begin
if (document.getElementById('divPrdListHomeContent2t').innerHTML != "") return;
if (!document.getElementById('SellOut_prdcodelist')) {
setTimeout('PrdListShow_()', 1000); return;
}
var BookCell_prdcodelist = document.getElementById("BookCell_s03_prdcodelist");
if (!BookCell_prdcodelist) {
PrdList2pLoad_();
return;
}
if (dataSellOut == "")
dataSellOut = document.getElementById('SellOut_prdcodelist').innerHTML;
var SellOut_prdcodelistAy = ","+dataSellOut+",";
var html = new Array();
html[html.length] = "";
html = html.join("");
document.getElementById('divPrdListHomeContent2t').innerHTML = html;
} // function end
function PrdList3pLoad_() {
iAJAX.divLoading_('divPrdListHomeContent3'+PrdListMode, 1);
iAJAX.iGet_("http://www.yabook.com.tw/main/uploads/yabook/s04.html", PrdList3pLoadProc_);
}
function PrdList3pLoadProc_(json) {
document.getElementById('dataPrdList3p').innerHTML = json;
iAJAX.iGet_("http://www.yabook.com.tw/main/uploads/yabook/s04.json", PrdList3pLoadProc2_);
}
function PrdList3pLoadProc2_(json) {
json = iAJAX.evalJson_(json);
if (json && json.result==1)
dataPrdList3t = json;
document.getElementById('divPrdListHomeContent3p').innerHTML = "";
document.getElementById('divPrdListHomeContent3t').innerHTML = "";
PrdListShow_();
}
window.PrdListShow3p_ = function () { // function begin
if (document.getElementById('divPrdListHomeContent3p').innerHTML != "") return;
if (!document.getElementById('SellOut_prdcodelist')) {
setTimeout('PrdListShow_()', 1000); return;
}
var BookCell_prdcodelist = document.getElementById("BookCell_s04_prdcodelist");
if (!BookCell_prdcodelist) {
PrdList3pLoad_();
return;
}
if (dataSellOut == "")
dataSellOut = document.getElementById('SellOut_prdcodelist').innerHTML;
var SellOut_prdcodelistAy = dataSellOut.split(",");
BookCell_prdcodelist = BookCell_prdcodelist.innerHTML; BookCell_prdcodelist = BookCell_prdcodelist.split(",");
var prdcodelist = new Array(), isOut;
for (var i=0; i";
for (var j=0; j<4; j++) {
html += "";
if (idx >= prdcodelist.length)
html += " ";
else
html += document.getElementById("BookCell_s04_"+prdcodelist[idx]).innerHTML;
html += " | ";
idx++;
}
html += "";
}
html += "";
document.getElementById('divPrdListHomeContent3p').innerHTML = html;
} // function end
window.PrdListShow3t_ = function () { // function begin
if (document.getElementById('divPrdListHomeContent3t').innerHTML != "") return;
if (!document.getElementById('SellOut_prdcodelist')) {
setTimeout('PrdListShow_()', 1000); return;
}
var BookCell_prdcodelist = document.getElementById("BookCell_s04_prdcodelist");
if (!BookCell_prdcodelist) {
PrdList3pLoad_();
return;
}
if (dataSellOut == "")
dataSellOut = document.getElementById('SellOut_prdcodelist').innerHTML;
var SellOut_prdcodelistAy = ","+dataSellOut+",";
var html = new Array();
html[html.length] = "";
html = html.join("");
document.getElementById('divPrdListHomeContent3t').innerHTML = html;
} // function end