// --------------------------------------------------------------------------------- // サブウインドウ処理 // 注文フォームへ進む。 // カゴ呼び出しもとwindowが開いていればそこに注文フォームを表示し、カゴを閉じる // 呼び出しもとwindowが閉じていれば、新規windowを開き、そこに表示、カゴを閉じる。 function chumon1(fn) { if ( opener.closed ) { newWin = window.open( fn+"?conf=1&payment=card", "" ); this.close(); } else { opener.parent.location = fn+"?conf=1&payment=card"; this.close(); } } function chumon2(fn) { if ( opener.closed ) { newWin = window.open( fn+"?conf=1&payment=COD", "" ); this.close(); } else { opener.parent.location = fn+"?conf=1&payment=COD"; this.close(); } } function chumon3(fn) { if ( opener.closed ) { newWin = window.open( fn+"?conf=1&payment=card", "" ); this.close(); } else { opener.opener.parent.location = fn+"?conf=1&payment=card"; opener.close(); this.close(); } } function chumon4(fn) { if ( opener.closed ) { newWin = window.open( fn+"?conf=1&payment=COD", "" ); this.close(); } else { opener.parent.location = fn+"?conf=1&payment=COD"; this.close(); } } // 呼び出し元が閉じられていないかのチェックを行う。 function close_window() { if ( opener.closed ) { newWin = window.open( "../", "" ); this.close(); } else { this.close(); } } // --------------------------------------------------------------------------------- // サブウインドウ表示 function subwindow(wurl,w,h) { window.open(wurl, "","resizable=yes,toolbar=no,scrollbars=yes,location=no,width="+w+",height="+h); } // --------------------------------------------------------------------------------- // 拡大表示 function sub_window(num,w,h) { window.open( "zoom.cgi?num="+num, "", "resizable=yes,toolbar=no,scrollbars=no,location=no,width="+w+",height="+h); } // --------------------------------------------------------------------------------- // カゴの内容表示 function Cart() { kago = window.open( "cgi/cargo.cgi", "kago", "resizable=yes,toolbar=no,scrollbars,location=no,width=550,height=550" ); } // --------------------------------------------------------------------------------- // カゴの内容表示 function Cart2() { kago = window.open( "./cargo.cgi", "kago", "resizable=yes,toolbar=no,scrollbars,location=no,width=550,height=550" ); } // --------------------------------------------------------------------------------- // 品物単品表示 function shina_window() { kago = window.open( "./cargo.cgi", "kago", "resizable=yes,toolbar=no,scrollbars,location=no,width=550,height=450" ); } // --------------------------------------------------------------------------------- // 割引価格の自動計算 function waribiki() { if(document.form1.kakaku1.value == "未定"){ document.form1.kakaku2.value = document.form1.kakaku1.value; }else{ var discount = (document.form1.discount.value / 100);//値引率 var genka = (document.form1.kakaku1.value / 1.05);//税抜き価格 var genka_tmp = genka - (genka * discount); var kakaku_tmp = (genka_tmp * 1.05); document.form1.kakaku2.value = Math.ceil(kakaku_tmp); } } // --------------------------------------------------------------------------------- // 送料についての説明 function souryou() { kago = window.open( "souryou.html", "kago", "resizable=yes,toolbar=no,scrollbars,location=no,width=500,height=300" ); } // --------------------------------------------------------------------------------- // 郵便番号検索 function zipSearch(){ var target = './postal_search.cgi?postalcode=' + document.form1.zip.value; var SWA; SWA = window.open(target,"zipresult","WIDTH=500,HEIGHT=350,toolbar=no,location=no,status=no,menubar=no,directories=no,scrollbars=auto"); SWA.focus(); } function zipSearch2(){ var target = './postal_search2.cgi?postalcode=' + document.form1.trans_zip.value; var SWA; SWA = window.open(target,"zipresult","WIDTH=500,HEIGHT=350,toolbar=no,location=no,status=no,menubar=no,directories=no,scrollbars=auto"); SWA.focus(); } // --------------------------------------------------------------------------------- // お届け先指定によるフラグ変更 function changeReFlg( ReFlg ) { document.form1.re_flg.value = ReFlg; soryo_cal(); } // --------------------------------------------------------------------------------- // 未入力欄チェック1 function kuran() { if(document.form1.name01.value == ""){ alert("お名前を入力してください");document.form1.name01.focus();document.form1.name01.select();return false; } if(document.form1.name02.value == ""){ alert("ふりがなを入力してください");document.form1.name02.focus();document.form1.name02.select();return false; } if(document.form1.zip.value == ""){ alert("郵便番号を入力してください");document.form1.zip.focus();document.form1.zip.select();return false; } if(document.form1.kenmei.value == ""){ alert("県名を選択してください");document.form1.kenmei.focus();return false; } if(document.form1.address.value == ""){ alert("市区町村を入力してください");document.form1.address.focus();document.form1.address.select();return false; } if(document.form1.address2.value == ""){ alert("番地を入力してください");document.form1.address2.focus();document.form1.address2.select();return false; } if(document.form1.telno.value == ""){ alert("電話番号を入力してください");document.form1.telno.focus();document.form1.telno.select();return false; } if(document.form1.email.value == ""){ alert("確認メールを返信いたしますので\nメールアドレスを入力してください");document.form1.email.focus();document.form1.email.select();return false; } if((document.form1.saki[0].checked == false)&&(document.form1.saki[1].checked == false)&&(document.form1.saki[2].checked == false)){ alert("お届け先を選択してください");document.form1.saki[0].focus();return false; } if(document.form1.re_flg.value != "same"){ if(document.form1.trans_name1.value == ""){ alert("お届け先のお名前を入力してください");document.form1.trans_name1.focus();document.form1.trans_name1.select();return false; } if(document.form1.trans_name2.value == ""){ alert("お届け先のふりがなを入力してください");document.form1.trans_name2.focus();document.form1.trans_name2.select();return false; } if(document.form1.trans_zip.value == ""){ alert("お届け先の郵便番号を入力してください");document.form1.trans_zip.focus();document.form1.trans_zip.select();return false; } if(document.form1.trans_kenmei.value == ""){ alert("お届け先の県名を選択してください");document.form1.trans_kenmei.focus();return false; } if(document.form1.trans_address.value == ""){ alert("お届け先の市区町村を入力してください");document.form1.trans_address.focus();document.form1.trans_address.select();return false; } if(document.form1.trans_address2.value == ""){ alert("お届け先の番地を入力してください");document.form1.trans_address2.focus();document.form1.trans_address2.select();return false; } if(document.form1.trans_telno.value == ""){ alert("お届け先の電話番号を入力してください");document.form1.trans_telno.focus();document.form1.trans_telno.select();return false; } // if(document.form1.pay[0].checked == true){ alert("お届け先が違う場合は『代金引換』でのお取扱はできません。\n恐れ入りますが、お支払方法を変更してください。");document.form1.saki[0].focus();return false; } } return true; } // --------------------------------------------------------------------------------- // 未入力欄チェック2 function kuran2() { if(document.form1.name01.value == ""){ alert("お名前を入力してください");document.form1.name01.focus();document.form1.name01.select();return false; } if(document.form1.name02.value == ""){ alert("ふりがなを入力してください");document.form1.name02.focus();document.form1.name02.select();return false; } if(document.form1.zip.value == ""){ alert("郵便番号を入力してください");document.form1.zip.focus();document.form1.zip.select();return false; } if(document.form1.kenmei.value == ""){ alert("県名を選択してください");document.form1.kenmei.focus();return false; } if(document.form1.address.value == ""){ alert("市区町村を入力してください");document.form1.address.focus();document.form1.address.select();return false; } if(document.form1.address2.value == ""){ alert("番地を入力してください");document.form1.address2.focus();document.form1.address2.select();return false; } if(document.form1.telno.value == ""){ alert("電話番号を入力してください");document.form1.telno.focus();document.form1.telno.select();return false; } if(document.form1.email.value == ""){ alert("確認メールを返信いたしますので\nメールアドレスを入力してください");document.form1.email.focus();document.form1.email.select();return false; } return true; } // --------------------------------------------------------------------------------- // ■送料計算 function soryo_cal(){ // ●送料の初期値 var soryo_k = "0"; // ●代引手数料の計算 if (document.form1.fee.value != "card"){ if (eval(document.form1.zeikomi.value) < 10000 ) { document.form1.fee.value = 315; document.form1.codfee.value = 315; }else if((eval(document.form1.zeikomi.value) >= 10000 )&& (eval(document.form1.zeikomi.value) < 30000 )){ document.form1.fee.value = 525; document.form1.codfee.value = 525; }else if((eval(document.form1.zeikomi.value) >= 30000 )&& (eval(document.form1.zeikomi.value) < 100000 )){ document.form1.fee.value = 840; document.form1.codfee.value = 840; }else if((eval(document.form1.zeikomi.value) >= 100000 )&& (eval(document.form1.zeikomi.value) < 300000 )){ document.form1.fee.value = "1,050"; document.form1.codfee.value = 1050; }else{ document.form1.fee.value = "0"; document.form1.codfee.value = 0; } }else{ codfee = 0; } // ●合計金額からの送料割り出し if (eval(document.form1.zeikomi.value) > 10000 ) { w_sel = 0; // }else if(eval(document.form1.zeikomi.value) < 10000 ) { // w_sel = 2; }else{ w_sel = 1; } // ●最大出荷個数超過時の処理(予備) // if( document.form1.weight.value >= 5000 ) { // w_cal = Math.ceil(( document.form1.weight.value - 5000 ) / 1000 ); // w_cal = ( Math.floor((w_cal + 1) / 2 ) * 2 ); // }else{ // w_cal = 0; // } if ( document.form1.re_flg.value != 'same' ) { sele_no = document.form1.trans_kenmei.selectedIndex; destination = document.form1.trans_kenmei[sele_no].value; sf = document.form1.trans_address.value; }else{ sele_no = document.form1.kenmei.selectedIndex; destination = document.form1.kenmei[sele_no].value; sf = document.form1.address.value; } // --------------------------------------------------------------------------------- // ●地帯未選択 if(destination == ""){ document.form1.postage.value = ""; // --------------------------------------------------------------------------------- // ●道内 }else if(destination == "北海道"){ pacrate = new Array(0,450,450,450,450,450); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); //document.form1.postage.value = Commas(pacrate[w_sel]+(w_cal*100)); // --------------------------------------------------------------------------------- // ●東北 }else if((destination == "青森県") || (destination == "岩手県") || (destination == "秋田県") || (destination == "山形県") || (destination == "宮城県") || (destination == "福島県")) { pacrate = new Array(0,650,650,650,650,650); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // --------------------------------------------------------------------------------- // ●関東信越 }else if((destination == "茨城県") || (destination == "栃木県") || (destination == "群馬県") || (destination == "埼玉県") || (destination == "千葉県") || (destination == "東京都") || (destination == "神奈川県") || (destination == "山梨県") || (destination == "長野県") || (destination == "新潟県")) { pacrate = new Array(0,750,750,750,750,750); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // --------------------------------------------------------------------------------- // ●中部北陸 }else if((destination == "富山県") || (destination == "石川県") || (destination == "福井県") || (destination == "静岡県") || (destination == "愛知県") || (destination == "岐阜県") || (destination == "三重県")) { pacrate = new Array(0,950,950,950,950,950); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // --------------------------------------------------------------------------------- // ●関西 }else if((destination == "京都府") || (destination == "滋賀県") || (destination == "奈良県") || (destination == "福井県") || (destination == "和歌山県") || (destination == "大阪府") || (destination == "兵庫県")) { pacrate = new Array(0,1050,1050,1050,1050,1050); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // --------------------------------------------------------------------------------- // ●中国 }else if((destination == "岡山県") || (destination == "広島県") || (destination == "山口県") || (destination == "鳥取県") || (destination == "島根県")) { pacrate = new Array(0,1250,1250,1250,1250,1250); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // --------------------------------------------------------------------------------- // ●四国 }else if((destination == "香川県") || (destination == "高知県") || (destination == "徳島県") || (destination == "愛媛県")) { pacrate = new Array(0,1350,1350,1350,1350,1350); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // --------------------------------------------------------------------------------- // ●九州 }else if((destination == "福岡県") || (destination == "佐賀県") || (destination == "長崎県") || (destination == "熊本県") || (destination == "大分県") || (destination == "宮崎県") || (destination == "鹿児島県")) { pacrate = new Array(0,1550,1550,1550,1550,1550); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // --------------------------------------------------------------------------------- // ●沖縄 }else if(destination == "沖縄県"){ pacrate = new Array(0,1750,1750,1750,1750,1750); soryo_k = pacrate[w_sel]; document.form1.postage.value = Commas(pacrate[w_sel]); // alert("沖縄、離島は別途運賃申し受けます。"); } // --------------------------------------------------------------------------------- // ●市内・同一区域 str1 = "札幌"; sr1 = sf.match(str1); var shi = ""; str = document.form1.address.value; sr = sf.match(str); var shi = ""; if (w_sel != 0){ if ( sr1 == "札幌" ){ soryo_k = 350; document.form1.postage.value = "350"; } } kessan(soryo_k); } // --------------------------------------------------------------------------------- // ●総合計算 function kessan(soryo_k){ // 金額計算 if( document.form1.postage.value != "" ){ ValueA = soryo_k + eval(document.form1.codfee.value) + eval(document.form1.zeikomi.value); // ValueA = soryo_k + eval(document.form1.zeikomi.value) + eval(document.form1.taxkei.value); // ValueA = eval(document.form1.postage.value) + eval(document.form1.zeikomi.value) + eval(document.form1.taxkei.value); kekka = Commas(ValueA); document.form1.sogokei.value = kekka; }else{ document.form1.postage.value = ""; document.form1.sogokei.value = ""; } // ポイント計算 if((eval(document.form1.zeikomi.value) + eval(soryo_k)) < eval(document.form1.point.value)) { document.form1.usepoint.value = eval(document.form1.zeikomi.value) + eval(soryo_k); document.form1.restpoint.value = eval(document.form1.point.value) - eval(document.form1.zeikomi.value) - eval(soryo_k); document.form1.kangen_gokei.value = 0; }else{ document.form1.usepoint.value = document.form1.point.value; document.form1.restpoint.value = 0; document.form1.kangen_gokei.value = Commas(Math.floor((eval(soryo_k) + (eval(document.form1.zeikomi.value))) - eval(document.form1.point.value))); } if(document.form1.takepoint.value == "yes"){ document.form1.getpoint.value = Math.floor((eval(document.form1.zeikomi.value) - eval(document.form1.point.value)) * (eval(document.form1.pointrate.value) / 105)); if(eval(document.form1.getpoint.value) < 1){ document.form1.getpoint.value = 0; } }else{ document.form1.getpoint.value = Math.floor(eval(document.form1.zeikomi.value) * (eval(document.form1.pointrate.value) / 105)); } } // --------------------------------------------------------------------------------- // ●左クリック禁止 function filebackup(){ if(event.button==1){ alert('右クリックで保存して下さい。');} } // --------------------------------------------------------------------------------- // ●3桁カンマ処理 function Commas(ValueA){ ValueA=new String(ValueA); Leng=ValueA.length; if(Leng%3 == 0)Atai=Leng/3-1; else Atai=Math.floor(Leng/3); i=3; for(j=0; j cnt){ ichi = document.form1.class2.value.indexOf(chtx.slice(cnt,cnt+1),0); if(ichi >= 0){ alert("無効な文字列があります。\nジャンルの欄をチェックして下さい。\n\n無効な文字【"+chtx.slice(cnt,cnt+1)+"】");document.form1.class2.focus();document.form1.class2.select();return false; } cnt++; } cnt = 0; while(ctxs > cnt){ ichi = document.form1.goods.value.indexOf(chtx.slice(cnt,cnt+1),0); if(ichi >= 0){ alert("無効な文字列があります。\n商品名の欄をチェックして下さい。\n\n無効な文字【"+chtx.slice(cnt,cnt+1)+"】");document.form1.goods.focus();document.form1.goods.select();return false; } cnt++; } cnt = 0; while(ctxs > cnt){ ichi = document.form1.maker.value.indexOf(chtx.slice(cnt,cnt+1),0); if(ichi >= 0){ alert("無効な文字列があります。\nメーカーの欄をチェックして下さい。\n\n無効な文字【"+chtx.slice(cnt,cnt+1)+"】");document.form1.maker.focus();document.form1.maker.select();return false; } cnt++; } cnt = 0; while(ctxs > cnt){ ichi = document.form1.kakaku1.value.indexOf(chtx.slice(cnt,cnt+1),0); if(ichi >= 0){ alert("無効な文字列があります。\n価格の欄をチェックして下さい。\n\n無効な文字【"+chtx.slice(cnt,cnt+1)+"】");document.form1.kakaku1.focus();document.form1.kakaku1.select();return false; } cnt++; } cnt = 0; while(ctxs > cnt){ ichi = document.form1.kakaku2.value.indexOf(chtx.slice(cnt,cnt+1),0); if(ichi >= 0){ alert("無効な文字列があります。\n価格の欄をチェックして下さい。\n\n無効な文字【"+chtx.slice(cnt,cnt+1)+"】");document.form1.kakaku2.focus();document.form1.kakaku2.select();return false; } cnt++; } cnt = 0; while(ctxs > cnt){ ichi = document.form1.comment.value.indexOf(chtx.slice(cnt,cnt+1),0); if(ichi >= 0){ alert("無効な文字列があります。\n商品説明の欄をチェックして下さい。\n\n無効な文字【"+chtx.slice(cnt,cnt+1)+"】");document.form1.comment.focus();document.form1.comment.select();return false; } cnt++; } if(document.form1.mode2.value != "del"){ if((document.form1.class1.value == "")&&(document.form1.class2.value == "")){ alert("ジャンルを選んでください。");document.form1.class1.focus();return false; } if(document.form1.goods.value == ""){ alert("商品名を入力してください。");document.form1.goods.focus();document.form1.goods.select();return false; } if(document.form1.maker.value == ""){ alert("メーカー名を入力してください。");document.form1.maker.focus();document.form1.maker.select();return false; } if(document.form1.kakaku1.value == ""){ alert("価格を入力してください。");document.form1.kakaku1.focus();document.form1.kakaku1.select();return false; } if(document.form1.kakaku2.value == ""){ alert("特価を入力してください。");document.form1.kakaku2.focus();document.form1.kakaku2.select();return false; } if(document.form1.kakaku1.value == "未定"){ ; }else{ if(isNaN(document.form1.kakaku1.value) == true){ alert("数値もしくは未定を入力してください。");document.form1.kakaku1.focus();document.form1.kakaku1.select();return false;} } if(document.form1.kakaku2.value == "未定"){ ; }else{ if(isNaN(document.form1.kakaku2.value) == true){ alert("数値もしくは未定を入力してください。");document.form1.kakaku2.focus();document.form1.kakaku2.select();return false;} } } return true; } //-->