function openGuide(path,winNm) { var newWindow = window.open(path,winNm); return false; } function openDoc(fileName){ var contextPath = document.getElementById("contextPathProductDetail").value; var strHtml = ""; if (fileName.substr(0,7).toLowerCase() != "http://" && fileName.substr(0,6).toLowerCase() != "ftp://" && fileName.substr(0,8).toLowerCase() != "https://"){ strHtml += contextPath + "/" + fileName + "uriconv_no"; }else { strHtml += fileName; } var newWindow = window.open(strHtml,"","location=no,left=100,width=880,scrollbars=yes"); return false; } function csLink(colorCd,sizeCd,shopId,promotionCd,productCd){ var contextPath = document.getElementById("contextPathProductDetail").value; if(!checkSubmit()) { return false; } var url = contextPath + "/srDispProductDetailCsLink/doColorSizeLink"; url += "/" + shopId + "/" + promotionCd + "/" + productCd + "/" + colorCd + "/" + sizeCd + "/" + getScreenId(); url += "/" + document.getElementsByName("subShopId").item(0).value; document.location.href = encodeURI(url); return false; } function addFusen(shopId,promotionCd,productCd,colorCd,sizeCd,fusenNoFl){ var contextPath = document.getElementById("contextPathProductDetail").value; if(!checkSubmit()) { return false; } var url = contextPath + "/srDispProductDetailAddFusen/doAddFusen"; url += "/" + shopId + "/" + promotionCd + "/" + productCd + "/" + colorCd + "/" + sizeCd + "/" + getScreenId(); url += "/" + document.getElementsByName("subShopId").item(0).value; var srvCheck = getSrvCheck(); if (srvCheck != ''){ url += "/" + srvCheck; } document.location.href = encodeURI(url); return false; } //関連キーワード検索 function tagKeywordLink(word,subShopId){ var contextPath = document.getElementById("contextPathProductDetail").value; var url = contextPath + "/cmHeaderSearchProduct/doSearchProduct/cmHeader"; url += "/" + " " + "/" + " " + "/" + "1" + "?syohinnNm=" + word; document.location.href = encodeURI(url); return false; } function getSrvCheck(){ var srvCheckObj = document.getElementsByName("srvCheck"); var srvCheck = ''; for(var i=0;i < srvCheckObj.length;i++){ if (srvCheckObj[i].checked){ srvCheck += ',' + srvCheckObj[i].value; } } if (srvCheck != ''){ srvCheck = srvCheck.substr(1); } return srvCheck; } function getScreenId(){ var screenId = "srDispProductDetail"; return screenId; } function convSign(tempStr){ return encodeURIComponent(tempStr); } function imgError(imgObject){ imgObject.src="images_common/noimage_m.jpg"; } function imgErrorS(imgObject){ imgObject.src="images_common/noimage_s.jpg"; } function imgErrorSS(imgObject){ imgObject.src="images_common/noimage_ss.jpg"; } //ズーム機能 function showLargeImage(imagePath, existFlg){ var contextPath = document.getElementById("contextPathProductDetail").value; var productCd = document.getElementById("productCdProductDetail").value; if (existFlg == 1) { var url = contextPath + "/srDispZoomifyPic.html?imagePath=" + imagePath + "&productCd=" + productCd; var prop = "width=700,height=600,menubar=no,toolbar=no,location=no,scrollbars=no,resizable=no,status=no,modal=yes"; var win = window.open(url, "PopupPage", prop); win.focus(); } } function windowOpen(imagePath) { var contextPath = document.getElementById("contextPathProductDetail").value; if(imagePath == null || imagePath == "") { return false; } var url = contextPath + "/" + imagePath; var prop = "width=700,menubar=no,toolbar=no,scrollbars=yes"; //var prop = "width=300,height=300,menubar=no,toolbar=no,scrollbars=no"; var win = window.open(url,"", prop); win.focus(); win.document.open(); htm=""; htm+="" + document.getElementsByName("productName").item(0).value + ""; htm+=""; //htm+="
"; htm+="
"; htm+="

"; htm+=""; //htm+="
"; htm+=""; htm+=""; htm+=""; win.document.write(htm); win.document.close(); } function reviewWindow() { var contextPath = document.getElementById("contextPathProductDetail").value; var shopId = document.getElementsByName("shopId").item(0).value; var promotionCd = document.getElementsByName("promotionCd").item(0).value; var productCd = document.getElementsByName("productCd").item(0).value; var colorCd = "00000"; var sizeCd = "00000"; var sellingPrice = document.getElementsByName("sellingPrice").item(0).value; var taxPrice = document.getElementsByName("taxPrice").item(0).value; var screenId = "srDispProductDetail"; var url = contextPath + "/srDispProductDetailReview/doReviewDetail"; url += "/" + shopId + "/" + promotionCd + "/" + productCd + "/" + colorCd + "/" + sizeCd + "/" + sellingPrice + "/" + taxPrice + "/" + screenId; var prop = "left=70,width=880,height=800,menubar=yes,toolbar=yes,scrollbars=yes"; var win = window.open(url,"", prop); win.focus(); return false; } //白鳩 ADD START function forwardRelated(){ var contextPath = document.getElementById("contextPathProductDetail").value; var shopId = document.getElementsByName("shopId").item(0).value; var promotionCd = document.getElementsByName("promotionCd").item(0).value; var productCd = document.getElementsByName("productCd").item(0).value; var colorCd = document.getElementsByName("colorCd").item(0).value; var sizeCd = document.getElementsByName("sizeCd").item(0).value; var screenId = "srDispProductDetail"; var url = contextPath + "/srDispProductDetailRelated/doRelatedProduct"; url += "/" + shopId + "/" + promotionCd + "/" + productCd + "/" + colorCd + "/" + sizeCd + "/" + getScreenId(); document.location.href = encodeURI(url); return false; } //カラーラジオボタン押下 //サイズ一覧を表示する function selectSize(colorCd){ if(selectValueArray[0].mode != undefined){ if(document.getElementsByName("colorCd").item(0).value == colorCd){return null;} } if(document.getElementsByName("sizecount").item(0).value == 0){ //カートボタンの切り替え selectValueArray[0].mode="defon"; changeCart(); }else{ //画面の切り替え DIV表示・非表示 document.getElementById("def1_s").style.display= "none"; //サイズ表チェック checkSizeList(colorCd); for(var i = 0;i < document.getElementsByName("colorcount").item(0).value ;i++){ var setColor = document.getElementsByName("setColorCd_h_" + i).item(0).value; document.getElementsByName("colorCd").item(0).value = colorCd; if(setColor == colorCd){ setColor += "_s"; document.getElementById(setColor).style.display= "block"; nm = i + 1;//カラー名称取得用 document.getElementsByName("colorCdName").item(0).value = document.getElementsByName("setColorNm_h_" + nm).item(0).value; //カートボタン上部に表示 document.getElementsByName("colorName1").item(0).value = "カラー:" + document.getElementsByName("setColorNm_h_" + nm).item(0).value; //表示しているサイズをクリア document.getElementsByName("sizeCd").item(0).value = ""; document.getElementsByName("sizeName").item(0).value = ""; document.getElementsByName("sizeName1").item(0).value = ""; }else{ document.getElementById(setColor + "_s").style.display= "none"; } } } } //送信情報を蓄える配列 selectValueArray=Array({color:undefined,size:undefined,amount:1,mode:undefined}); labelIdHistory=""; colorID_history=""; selectableHistory = ""; overHistory=""; //サイズ表のチェック処理 function checkSizeList(colorCd){ //現在表示しているサイズ表の項目がチェック済の場合は、なにもしない colorCd += "_s"; if(document.getElementById(colorCd).style.display != "block"){ for(var checkNm = 0;checkNm < document.getElementsByName("colorcount").item(0).value ;checkNm++){ for(var i = 0;i < document.getElementsByName("sizecount").item(0).value;i++){ //サイズ項目のIDを設定する var sizeId = "size_"; sizeId += i + "_" + checkNm; //チェック済項目をクリア if(document.getElementById(sizeId) != null){ if(document.getElementById(sizeId).className == "selected"){ selectableHistory = ""; if(historyWaitFrag == '1'){ document.getElementById(sizeId).className = "wait"; }else{ document.getElementById(sizeId).className = "defon"; } } } } } //カートボタンの切り替え selectValueArray[0].mode="off"; changeCart(); //数量クリア if(document.getElementById("cartOn").style.display == "none"){ document.getElementsByName("quantity").item(0).value = "1"; } } if(document.getElementById("def1_s").style.display == "block"){ for(var i = 0;i < document.getElementsByName("sizecount").item(0).value;i++){ if(document.getElementById("size_" + i) != null){ if(document.getElementsByName("noFlg").item(0).value == 1){ document.getElementById("size_" + i).className = "none"; }else{ document.getElementById("size_" + i).className = "def"; } } } //カートボタンの切り替え selectValueArray[0].mode="off"; changeCart(); //数量クリア if(document.getElementById("cartOn").style.display == "none"){ document.getElementsByName("quantity").item(0).value = "1"; } } } //カートボタンを切り替え //args= "on" or "off" //changeCart("on"); function changeCart(){ if(selectValueArray[0].mode == "defon"){ document.getElementById("cartOn").style.display = "block"; document.getElementById("cartNowOn").style.display = "none"; document.getElementById("cartOff").style.display = "none"; document.getElementById("cartWait").style.display = "none"; }else if(selectValueArray[0].mode == "off"){ document.getElementById("cartOff").style.display = "block"; document.getElementById("cartNowOn").style.display = "none"; document.getElementById("cartOn").style.display = "none"; document.getElementById("cartWait").style.display = "none"; }else{ document.getElementById("cartWait").style.display = "block"; document.getElementById("cartNowOn").style.display = "none"; document.getElementById("cartOn").style.display = "none"; document.getElementById("cartOff").style.display = "none"; } } //全色・各色画像の切り替え処理 function changeColor(number_of_container,colorID,theMode){ //フォントスタイルを変更 if(colorID != undefined && colorID != colorID_history){ document.getElementById("label_"+colorID).style.fontWeight='bolder'; //カラー名称を画像下に表示 document.getElementsByName("colorName").item(0).value = document.getElementsByName("setColorNm_h_" + number_of_container).item(0).value; if(colorID_history != ""){ document.getElementById("label_"+ colorID_history).style.fontWeight='normal'; } colorID_history = colorID; selectValueArray[0].color = colorID; } //商品画像の切り替え var colorFlg=0; for(i=1;i <= document.getElementsByName("colorcount").item(0).value;i++){ //全色画像 if(colorID == undefined){ if(document.getElementsByName("zoomImg_h").length != 0){ //大画像をzoomへ設定 document.getElementsByName("zoomImg_h").item(0).value = document.getElementsByName("colorImg_largeurl_0").item(0).value; //zoomフラグを設定 document.getElementsByName("zoomImg_hFlg").item(0).value = document.getElementsByName("flgAllColorImgUrl3").item(0).value; //zoomアイコン切替 if(document.getElementsByName("zoomImg_hFlg").item(0).value == 1){ document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "block"; document.getElementById("zoomDivZoomify").style.display= "none"; } else { document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "block"; document.getElementById("zoomDivZoomify").style.display= "none"; } } //カラー名称を画像下に表示 document.getElementsByName("colorName").item(0).value = "全色"; //画像表示 //全色画像が存在しない時、noimageを設定する if("noZoomFlg" in window){ //なにもしない。 }else{ if(document.getElementsByName("colorImg_url_0").item(0).value == ""){ document.getElementsByName("colorImg_url_0").item(0).value = "images_common/noimage_m.jpg"; if(document.getElementById("zoomDiv") != undefined){ document.getElementById("zoomDiv").style.display = "none"; document.getElementById("zoomDivImg").style.display = "none"; document.getElementById("zoomDivZoomify").style.display = "none"; } noZoomFlg=1; }else{ noZoomFlg=0; } } document.getElementById("allProductImg").src = document.getElementsByName("colorImg_url_0").item(0).value; //cartWin imageWin = document.getElementById("allProductImg").src; document.getElementById("def1_s").style.display = "block"; document.getElementsByName("colorCd").item(0).value = ""; document.getElementsByName("colorCdName").item(0).value = ""; document.getElementsByName("colorName1").item(0).value = ""; document.getElementsByName("sizeCd").item(0).value = ""; document.getElementsByName("sizeName").item(0).value = ""; document.getElementsByName("sizeName1").item(0).value = ""; //***サイズ選択・サイズ表をクリア***/ //サイズ表チェック checkSizeList("def1"); for(var z = 0;z < document.getElementsByName("colorcount").item(0).value ;z++){ var setColor = document.getElementsByName("setColorCd_h_" + z).item(0).value; setColor += "_s"; document.getElementById(setColor).style.display= "none"; //***カラー選択をクリア***/ //ラジオボタンクリア document.getElementsByName("setColorCd").item(z).checked = false; //フォントスタイル変更 document.getElementById("label_setColorCd_"+ z).style.fontWeight = 'normal'; } break; } //if(number_of_container == i && document.getElementsByName("colorImg_url_" + i).item(0) != null){ if(document.getElementsByName("colorImg_url_" + i).item(0) != null && number_of_container == i && document.getElementsByName("colorImg_url_" + i).item(0).value != ""){ //カラー名称を画像下に表示 document.getElementsByName("colorName").item(0).value = document.getElementsByName("setColorNm_h_" + number_of_container).item(0).value; //画像表示 document.getElementById("allProductImg").src = document.getElementsByName("colorImg_url_" + i).item(0).value; //cartWin imageWin = document.getElementById("allProductImg").src; //URLを保存 document.getElementsByName("imgUrl2").item(0).value = document.getElementsByName("colorImg_url_" + i).item(0).value; //拡大・zoom画像の設定 if(document.getElementsByName("colorImg_largeurl_" + i).item(0) != null){ //zoom画像判定 var largeImg = document.getElementsByName("colorImg_largeurl_" + i).item(0).value; var chk = largeImg.substring(largeImg.length-1); if(document.getElementsByName("zoomImg_h").length != 0){ if(chk == "/"){ //zoomアイコン表示 document.getElementsByName("zoomImg_h").item(0).value = largeImg; document.getElementsByName("zoomImg_hFlg").item(0).value = 1; document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "none"; document.getElementById("zoomDivZoomify").style.display= "block"; }else{ //zoomアイコン非表示 document.getElementsByName("zoomImg_h").item(0).value = largeImg; document.getElementsByName("zoomImg_hFlg").item(0).value = 0; document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "block"; document.getElementById("zoomDivZoomify").style.display= "none"; } } } if(theMode != "img_only"){ selectValueArray[0].color=colorID; //内容がそろっているか監査 auditValues(); } colorFlg=0; break; }else{ colorFlg=1; } } if(colorFlg == 1){ //各色画像なしは、全色画像に切り替え //カラー名称を画像下に表示 document.getElementsByName("colorName").item(0).value = "全色"; //画像表示 if(document.getElementById("allProductImg").src != document.getElementsByName("colorImg_url_0").item(0).value){ //全色画像が存在しない時、noimageを設定する if("noZoomFlg" in window){ //なにもしない。 }else{ if(document.getElementsByName("colorImg_url_0").item(0).value == ""){ document.getElementsByName("colorImg_url_0").item(0).value = "images_common/noimage_m.jpg"; if(document.getElementById("zoomDiv") != undefined){ document.getElementById("zoomDiv").style.display= "none"; } noZoomFlg=1; }else{ noZoomFlg=0; } } document.getElementById("allProductImg").src = ""; document.getElementById("allProductImg").src = document.getElementsByName("colorImg_url_0").item(0).value; //cartWin imageWin = document.getElementById("allProductImg").src; } if(noZoomFlg!=1){ //zoomアイコン表示判定 全色画像拡大 document.getElementsByName("zoomImg_h").item(0).value = document.getElementsByName("colorImg_largeurl_0").item(0).value; //zoomフラグを設定 document.getElementsByName("zoomImg_hFlg").item(0).value = document.getElementsByName("flgAllColorImgUrl3").item(0).value; if(document.getElementById("allProductImg").src != document.getElementsByName("colorImg_url_0").item(0).value){ //zoom画像判定 var largeImg = document.getElementsByName("colorImg_largeurl_0").item(0).value; var chk = largeImg.substring(largeImg.length-1); if(chk == "/"){ //zoomアイコン表示 document.getElementsByName("zoomImg_h").item(0).value = largeImg; document.getElementsByName("zoomImg_hFlg").item(0).value = 1; document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "none"; document.getElementById("zoomDivZoomify").style.display= "block"; }else{ //zoomアイコン非表示 document.getElementsByName("zoomImg_h").item(0).value = largeImg; document.getElementsByName("zoomImg_hFlg").item(0).value = 0; document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "block"; document.getElementById("zoomDivZoomify").style.display= "none"; } } } } colorFlg=0; } //詳細画像の切り替え表示 function changSumImg(imgurl,largeImgFlg,largeImgId,zFlg){ document.getElementById("allProductImg").src = imgurl; //詳細画像(大)がある時、zoom画像表示 if(zFlg == 1){ //アイコン表示 document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "none"; document.getElementById("zoomDivZoomify").style.display= "block"; var largeUrl = document.getElementsByName(largeImgId).item(0).value; document.getElementsByName("zoomImg_h").item(0).value = largeUrl; document.getElementsByName("zoomImg_hFlg").item(0).value = "1"; //onClick書き換え document.getElementsByName("zoomImg").onclick = new Function("showLargeImage(largeUrl,'1');"); //zoom機能 //showLargeImage(largeUrl,zFlg); //詳細画像(大) }else if(largeImgFlg == 1){ document.getElementById("zoomDiv").style.display= "block"; document.getElementById("zoomDivImg").style.display= "block"; document.getElementById("zoomDivZoomify").style.display= "none"; var largeUrl = document.getElementsByName(largeImgId).item(0).value; document.getElementsByName("zoomImg_h").item(0).value = largeUrl; document.getElementsByName("zoomImg_hFlg").item(0).value = "0"; //拡大画像 windowOpen(largeUrl); }else{ document.getElementsByName("zoomImg_h").item(0).value = ""; document.getElementsByName("zoomImg_hFlg").item(0).value = 0; document.getElementById("zoomDiv").style.display= "none"; document.getElementById("zoomDivImg").style.display= "none"; document.getElementById("zoomDivZoomify").style.display= "none"; } } //zoomリンクの設定 function zoomImgset(){ if(document.getElementsByName("zoomImg_hFlg").length != 0){ if(document.getElementsByName("zoomImg_hFlg").item(0).value == "1"){ document.getElementById("zoomDiv").style.display= "block"; //onClick書き換え document.getElementsByName("zoomImg").onclick = new Function("showLargeImage(imgurl,'1');"); //zoom機能 showLargeImage(document.getElementsByName("zoomImg_h").item(0).value,'1'); }else{ if(document.getElementsByName("zoomImg_h").item(0).value != ""){ document.getElementById("zoomDiv").style.display= "block"; windowOpen(document.getElementsByName("zoomImg_h").item(0).value); }else{ document.getElementById("zoomDiv").style.display= "none"; } } } } //サイズ選択時 function changeSize_click(the_ID,waitFrag,waitCd){ obj_Size = document.getElementById(the_ID); getClass = obj_Size.className; if(getClass == "defon" || getClass == "over_defon" || getClass == "over_wait" ){ //カートボタン判定フラグ if(waitFrag == '1'){ selectValueArray[0].mode="wait"; witeFrag = waitCd; }else { selectValueArray[0].mode="defon"; } obj_Size.className= "selected"; selectValueArray[0].size=obj_Size.innerHTML; //内容がそろっているか監査 if(waitFrag != "def1"){ auditValues(); } if(selectableHistory != ""){ if(historyWaitFrag == '1'){ document.getElementById(selectableHistory).className= "wait"; }else{ document.getElementById(selectableHistory).className= "defon"; } } historyWaitFrag=waitFrag; selectableHistory=the_ID; //サイズコードを設定する if(waitFrag != "def1"){ if(waitFrag == "1"){ document.getElementsByName("sizeCd").item(0).value = waitCd; document.getElementsByName("sizeName").item(0).value = document.getElementsByName(waitCd).item(0).value; document.getElementsByName("sizeName1").item(0).value = "サイズ:" + document.getElementsByName(waitCd).item(0).value; }else if(waitFrag != undefined){ document.getElementsByName("sizeCd").item(0).value = waitFrag; document.getElementsByName("sizeName").item(0).value = document.getElementsByName(waitFrag).item(0).value; document.getElementsByName("sizeName1").item(0).value = "サイズ:" + document.getElementsByName(waitFrag).item(0).value; } } } } //サイズ選択 マウスオーバー function changeSize_over(over_ID,horverWaitFrag){ obj_color_over = document.getElementById(over_ID) over_getClass=obj_color_over.className; //クラスdef on wait以外を除外 if(over_getClass == "defon" || over_getClass == "on" || over_getClass == "wait"){ obj_color_over.style.cursor="pointer"; if(over_getClass == "defon"){ obj_color_over.className= "over_defon"; }else{ obj_color_over.className= "over_wait"; } if(overHistory != "" && document.getElementById(overHistory).className != "selected"){ if(historyhorverWaitFrag == 1){ document.getElementById(overHistory).className= "wait"; }else{ document.getElementById(overHistory).className= "defon"; } } historyhorverWaitFrag=horverWaitFrag; overHistory=over_ID; } } //送信できるかチェック function auditValues(){ if(selectValueArray[0].color != undefined && selectValueArray[0].size != undefined && selectValueArray[0].amount != undefined){ changeCart(); }else{ //cartDisable(); } } function cartDisable(){ var obj_cartButton=document.getElementById('cartButton'); update_cartButton='カートに入れる'; obj_cartButton.innerHTML=obj_cartButton.innerHTML.split(obj_cartButton.innerHTML).join(update_cartButton); } tgtX=300; tgtY=-719-170; yy=-180; xx=0; historyYY=""; flg=0; //アイコンフライ function iconMove(){ flg=1; document.getElementById('flyingIcon').style.display= "block"; Xspeed=(tgtX-xx)*0.07; Yspeed=(tgtY-yy)*0.07; yy+=Yspeed; xx+=Xspeed; document.getElementById('flyingIcon').style.top=yy+"px"; document.getElementById('flyingIcon').style.left=xx+"px"; mv=window.setTimeout("iconMove()", 30); if((tgtY-yy) > -19){ //多重動作防止解除 flg=0; window.clearTimeout(mv) document.getElementById('flyingIcon').style.display= "none"; //動作完了 hidouki(); //以下初期化 tgtX=300; tgtY=-719-170; yy=-180; xx=0; historyYY=""; document.getElementById('flyingIcon').style.top=0+"px"; document.getElementById('flyingIcon').style.left=0+"px"; } } function hidouki(){ var contextPath = document.getElementById("contextPathProductDetail").value; //送信パラメータ var parameter = document.getElementsByName("shopId").item(0).value + '/' + document.getElementsByName("promotionCd").item(0).value + '/' + document.getElementsByName("productCd").item(0).value + '/' + document.getElementsByName("colorCd").item(0).value + '/' + document.getElementsByName("sizeCd").item(0).value + '/' + document.getElementsByName("doAgeLimitFlag").item(0).value + '/' + document.getElementsByName("screenId").item(0).value + '/' + document.getElementsByName("subShopId").item(0).value + '/' + document.getElementsByName("shippingfeeId").item(0).value + '/' + "0" + '/' + document.getElementsByName("quantity").item(0).value + '/' + document.getElementsByName("productPoint").item(0).value + '/' + document.getElementsByName("basePointRate").item(0).value + '/' + document.getElementsByName("reserveFlg").item(0).value; //alert(parameter); //カートへ情報を送る var url = contextPath + "/srDispProductDetailSendToBasket/doSendToBasket/" + parameter; initFlg = 1; //cartPop(initFlg,""); cartWin(initFlg,"",""); var myajax = new Ajax.Request(url,{ 'method':'post', onComplete:cartDisp }); } function cartDisp(request){ //alert(request.responseText); flg = 0; initFlg = 0; //レスポンス内容を保存 var res = request.responseText; //在庫チェックにてエラーがあった場合、エラーメッセージを取得 start = res.lastIndexOf("basketerror"); end = res.indexOf("<",start); var msg = res.substring(start+13,end); //エラーメッセージ表示 switch(msg){ case "WFSH0002": //alert("商品は販売不可となっております。"); //alert("在庫切れとなっております。"); msg = "商品は在庫切れとなっております。"; flg = 1; break; case "WFSH0003": //alert("在庫切れとなっております。"); //alert("商品の数量が購入可能な数を超えています。"); msg = "商品の数量が購入可能な数を超えています。"; flg = 1; break; case "WFSH0004": //alert("購入可能な商品は49点までとなっております。"); msg = "購入可能な商品は49点までとなっております。"; flg = 1; break; case "WFSH0005": //alert("購入可能な金額は10,000,000円までとなっております。"); msg = "購入可能な金額は10,000,000円までとなっております。"; flg = 1; break; case "WFSH0006": //alert("商品の数量が購入可能な数を超えています。"); msg = "商品の数量が購入可能な数を超えています。"; flg = 1; break; case "WFSH0009": //alert("商品の数量はカート投入制限数を超えています。"); msg = "商品の数量はカート投入制限数を超えています。"; flg = 1; break; case "WFSH00013": //alert("一度に購入できる商品の種類を超えています。"); msg = "一度に購入できる商品の種類を超えています。"; flg = 1; break; case "WFSH00016": //alert("この商品は制限されて購入できません"); msg = "この商品は制限されて購入できません"; flg = 1; break; } // 在庫不足(残りn)のためその数以上のご注文はできません。 if(msg.indexOf("在庫") != -1){ flg = 1; } // n個までのご注文となります。 if(msg.indexOf("個") != -1){ flg = 1; } //カート数量 var cartStart = res.lastIndexOf("cartNum"); var cartEnd = res.indexOf("<",cartStart); var cartmsg = res.substring(cartStart+9,cartEnd); if(flg == 1){ //cartPop(initFlg,msg); cartWin(initFlg,msg,cartmsg); document.getElementById("cartOn").style.display = "block"; document.getElementById("cartNowOn").style.display = "none"; document.getElementById("cartOff").style.display = "none"; document.getElementById("cartWait").style.display = "none"; return false; } //Firefox対応 var browserName = navigator.userAgent; //alert(browserName); if(browserName.indexOf("Firefox") == -1){ //IE対応 var obj_totalCount_b = document.getElementById("totalQuantity_c").innerText; var total_b = document.getElementById('total_c').innerText; //var sendPrice1 = document.getElementById('freeTotal_c').innerText; var obj_freeTotal = document.getElementById("freeTotal_h").innerText; }else{ //innerText使用不可 var obj_totalCount_b = document.getElementById("totalQuantity_c").textContent; var total_b = document.getElementById('total_c').textContent; //var sendPrice1 = document.getElementById('freeTotal_c').textContent; var obj_freeTotal = document.getElementById("freeTotal_h").textContent; } //商品点数を書き換え var obj_totalCount = document.getElementById("totalQuantity"); var obj_totalCount_c = document.getElementById("totalQuantity_c"); var count = eval(obj_totalCount_b) + eval(document.getElementsByName("quantity").item(0).value); obj_totalCount_c.innerHTML = '' + count + ''; //商品代金を書き換え var obj_totalPrice = document.getElementById('total'); var obj_totalPrice_c = document.getElementById('total_c'); //購入代金を計算する var totalPrice = eval(document.getElementsByName("sellingPrice").item(0).value) * eval(document.getElementsByName("quantity").item(0).value); //カンマはずし total_b = total_b.replace(/,/g,''); //カート合計金額を計算する var price = eval(total_b) + eval(totalPrice); var price1 = price; price1 += "";//型変換 //カンマ付加 var i; for(i = 0;i < price1.length/3;i++){ price1 = price1.replace(/^([+-]?\d+)(\d\d\d)/,"$1,$2"); } obj_totalPrice_c.innerHTML = '' + price1 + ''; //送料無料金額を書き換え var obj_freeTotal_c = document.getElementById("freeTotal_c"); var obj_freeTotal_all = document.getElementById("freeTotal_all"); //カンマはずし obj_freeTotal = obj_freeTotal.replace(/,/g,''); var sendPrice2 = obj_freeTotal.replace(/,/g,''); var sendPrice3 = eval(sendPrice2) - eval(price); sendPrice3 += "";//型変換 if(sendPrice3 > 0){ //カンマ付加 var i; for(i = 0;i < sendPrice3.length/3;i++){ sendPrice3 = sendPrice3.replace(/^([+-]?\d+)(\d\d\d)/,"$1,$2"); } obj_freeTotal_c.innerHTML = '' + sendPrice3 + ''; }else{ obj_freeTotal_all.innerHTML = '送料無料!'; } if(document.getElementsByName("shippingCalcClsf").item(0).value == 0){ obj_freeTotal_all.innerHTML = '送料無料!'; } //ポップアップ表示 //window.alert("カラー:" + document.getElementsByName("colorCdName").item(0).value + " サイズ:" + document.getElementsByName("sizeName").item(0).value + " 数量:" + document.getElementsByName("quantity").item(0).value); //cartPop(initFlg,""); cartWin(initFlg,"",cartmsg); document.getElementById("cartOn").style.display = "block"; document.getElementById("cartNowOn").style.display = "none"; document.getElementById("cartOff").style.display = "none"; document.getElementById("cartWait").style.display = "none"; } //数量変更処理 function changeAmount(){ selectValueArray[0].amount=document.getElementById('amountValues').value; } //写真変更 function largeImageSwap(imageContainerID,imageURL){ document.getElementById("detail_image_"+imageContainerID).src=imageURL; } //送信項目チェック function doCheckForm(flg){ var win; if(flg != "1"){ if (document.getElementsByName("colorCd").item(0).value=="") {setMessage("MSG_G0046","カラー");} if (document.getElementsByName("sizeCd").item(0).value=="") {setMessage("MSG_G0046","サイズ");} if(!showMessage()){ return false; } } //2重送信不可 5/29解除 /*if(document.getElementsByName("cartFlg").item(0).value == 1){ return false; }else{ document.getElementsByName("cartFlg").item(0).value = 1;*/ document.getElementById("cartOn").style.display = "none"; document.getElementById("cartNowOn").style.display = "block"; document.getElementById("cartOff").style.display = "none"; document.getElementById("cartWait").style.display = "none"; //iconMove(); hidouki(); //} } function doCheckMail(){ document.forms["srDispProductDetailForm"].submit; } //カート投入ポップアップ var win = null; function cartPop(initFlg,msg){ var contextPath = document.getElementById("contextPathProductDetail").value; if (initFlg == 1) { msg = "以下の内容でカートに登録中です"; msgTitle = "

" + msg + "

"; //var url = contextPath + "/"; var url = "about:blank"; var prop = "width=500,height=400,menubar=no,toolbar=no,scrollbars=yes"; //var win = window.open(url,"", prop); //win.focus(); //win.document.open(); //var html = ""; htm=""; htm+=""; htm+="" + document.getElementsByName("productName").item(0).value + ""; htm+=" "; htm+=""; htm+="
" + msgTitle + "
"; htm+=""; htm+=""; htm+=""; htm+=""; htm+="
商品名" + document.getElementsByName("productName").item(0).value + "
カラー" + document.getElementsByName("colorCdName").item(0).value + "
サイズ" + document.getElementsByName("sizeName").item(0).value + "
数量" + document.getElementsByName("quantity").item(0).value + "
"; htm+="

"; htm+=""; htm+=""; win = window.open(url,"", prop); win.focus(); with(win.document){ open('text/html'); write(htm); close(); } win.focus(); //win.document.write(htm); //win.document.close(); } else { if (msg == "") { var m = win.document.getElementById("msg"); m.innerHTML = "

以下の内容でカートに入れました

"; } else { msgTitle = "

" + msg + "

"; var m = win.document.getElementById("msg"); m.innerHTML = msgTitle; } } } function cartWin(initFlg,msg,cartNum){ if ( initFlg == 1 ) { title = "カートに登録中です"; msg = " "; msgTitle = "" + msg + ""; var htm="\n"; htm+="\n"; htm+="\n"; htm+="\n"; htm+="\n"; htm+="\n"; htm+=msgTitle + "
\n"; htm+="\n"; htm+="\n"; htm+="\t\n"; htm+="\t\n"; htm+="\n"; htm+="\n"; htm+="\t\n"; htm+="\n"; htm+="
\n"; htm+="\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t\t\t\n"; htm+="\t\t\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t\t\t\n"; htm+="\t\t\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t\t\t\n"; htm+="\t\t\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t\t\t\n"; htm+="\t\t\t\n"; htm+="\t\t
カラー:" + document.getElementsByName("colorCdName").item(0).value + "
サイズ:" + document.getElementsByName("sizeName").item(0).value + "
数量:" + document.getElementsByName("quantity").item(0).value + "

この商品は、カートにつ入っています。
\n"; htm+="\t
\n"; htm+="\t\t

\n"; htm+="\t\t\t \n"; htm+="\t\t

\n"; htm+="\t
\n"; htm+="\n"; htm+="\n"; //alert(htm); win = new Window({className: "alphacube", closable: false, maximizable: false, minimizable: false, draggable:false, width: 320, height: 320, zIndex: 100, title: title}); win.getContent().update(htm); win.showCenter({modal:true}); } else { if (msg == "") { var m = document.getElementById("msg"); m.innerHTML = "以下の内容でカートに入れました"; var t = document.getElementById("title"); t.innerHTML = "商品を追加しました"; cartNum = parseInt(cartNum) + parseInt(document.getElementsByName("quantity").item(0).value); } else { msgTitle=""+msg+""; var m = document.getElementById("msg"); m.innerHTML = msgTitle; var t = document.getElementById("title"); t.innerHTML = "商品を追加できませんでした"; } //win.updateWidth(); //win.updateHeight(); var c = document.getElementById("cartN"); c.innerHTML = cartNum; } } getContentScreenId(); function getContentScreenId(){ document.forms["cmHeaderForm"].elements["contentScreenId"].value= "srDispProductDetail"; } //「https」で始まっていなければ、プロトコル部分をhttpsに書き換える var url = location.href; if(url.indexOf("https") != -1){ url = url.replace(/^[^:]+:/,"http:"); if(url.match(/\?/)){ url += "&historyBack=1"; } else { url += "?historyBack=1"; } location.href = url; } /*window:onload = function load(){ showLoadMessage(); //zoomアイコン表示 if(document.getElementsByName("zoomImg_hFlg").item(0).value == 1){ document.getElementById("zoomDiv").style.display= "block"; } }*/ function showLoadMessage(){ var dupFusenFlg = document.getElementsByName("dupFusenFlg").value; var addFusenFlg = document.getElementsByName("addFusenFlg").value; var loginFusenNoFlg = document.getElementsByName("loginFusenNoFlg").value; if (dupFusenFlg == 1){ alert("お気に入りに登録済みです。"); } else if (addFusenFlg == 1){ alert("お気に入りに追加しました。"); // ログイン画面から遷移してきて最大件数を超えていた場合 } else if (loginFusenNoFlg == 1){ alert("お気に入り最大件数を超えています。"); } document.getElementsByName("dupFusenFlg").value = 0; document.getElementsByName("addFusenFlg").value = 0; document.getElementsByName("loginFusenNoFlg").value = 0; } function fusenMessage(){ var fusenNoFlg = document.getElementsByName("fusenNoFlg").value; if (fusenNoFlg == 1){ alert("お気に入り最大件数を超えています。"); return false; } } function toFriendRequest(){ var contextPath = document.getElementById("contextPathProductDetail").value; var shopId = document.getElementById("shopIdProductDetail").value; var promotionCd = document.getElementById("promotionCdProductDetail").value; var productCd = document.getElementById("productCdProductDetail").value; var sizeCd = document.getElementById("sizeCdProductDetail").value; var subShopId = document.getElementById("subShopIdProductDetail").value; var url = contextPath + "/sendFriendLink/sendToFriend/"; url += shopId + "/" + promotionCd + "/" + productCd + "/" + colorCd + "/" + sizeCd; url += "/srDispProductDetail/" + subShopId; var strUrl = "http://" + location.hostname; location = strUrl + encodeURI(url); }