// 日本語 UTF-8N LF//-------------------------------------------------------------// JavaScript// サイト固有のイベント処理//-------------------------------------------------------------// Landwarf / Takayuki Onodera//-------------------------------------------------------------//var page = "";var newSession = 0;var screenW = 0;var screenH = 0;var cssPrint = "";var adID = "";var adTime = 0;var maskID = "";var timer = null;var effect = new Array();var maxTelopCount = 30; // 最大投稿文字数////-------------------------------------------------------------// ドキュメント読み込み完了//-------------------------------------------------------------$(document).ready(    function() {        // エラー処理        $.ajaxSetup({            timeout: 10000,     // 10秒でタイムアウト            error: errorProc    // 通信エラー時の処理        });        // 環境設定        screenW = window.screen.width;        screenH = window.screen.height;        // OKボタンにフォーカスする    //  $("input[name=ok]").focus();        // word-break を適用する        $('.wordBreak').breakWords();        // ヘルプボックス表示切替        $(".helpBoxButton").mouseover(            function() {                $(this).css("cursor", "pointer");            //  $("#dev0").text(dsp);            }        );        $(".helpBoxButton").mousedown(            function() {                var dsp = $(this).siblings(".helpBoxText").css("display");            //  $("#dev0").text(dsp);                if (dsp == "none") {                    $(this).siblings(".helpBoxText").css("display", "block");                } else {                    $(this).siblings(".helpBoxText").css("display", "none");                }            }        );        // パスワード表示切替        $(".pwa1").mouseover(            function() {                $(this).css("cursor", "pointer");            }        );        $(".pwa2").mouseover(            function() {                $(this).css("cursor", "pointer");            }        );        $(".pwa1").mousedown(            function() {                $(".pwa1").css("visibility", "hidden");                $(".pwa2").css("visibility", "visible");                $(".pws1").css("visibility", "hidden");                $(".pws2").css("visibility", "visible");            }        );        $(".pwa2").mousedown(            function() {                $(".pwa1").css("visibility", "visible");                $(".pwa2").css("visibility", "hidden");                $(".pws1").css("visibility", "visible");                $(".pws2").css("visibility", "hidden");            }        );        // マウスオーバーボタン A        $('.btnMaskA').mouseover(            function() {                $(this).children("a").children("img").css("visibility", "visible");            }        );        $('.btnMaskA').mouseout(            function() {                $(this).children("a").children("img").css("visibility", "hidden");            }        );        // マウスオーバーボタン B        $('.btnB3').mouseover(            function() {                $(this).prevAll(".btnB2").css("visibility", "visible");            }        );        $('.btnB3').mouseout(            function() {                $(this).prevAll(".btnB2").css("visibility", "hidden");            }        );        // マウスオーバーボタン C        $('.btnC0').mouseover(            function() {                $(this).css("visibility", "hidden");            }        );        $('.btnC1').mouseout(            function() {                $(this).siblings(".btnC0").css("visibility", "visible");            }        );        // 支払方法選択用        $(".paySelect").mouseover(            function() {                $(this).css("cursor", "pointer");            }        );        $("#payBANK").mousedown(            function() {                $("#payInfo").text("銀行振込");                $(this).find("input").attr("checked", "true");                var val1 = Number($("[name='PRODUCT_PRICE']")[0].value);    // 商品価格                var val2 = Number($("[name='CHARGE_YUBIN']")[0].value);     // 送料：郵便                var val3 = 0;                                               // 手数料                var val = val1 + val2 + val3;                $("[name='TOTAL_PRICE']")[0].value = val;   // 支払総額                $("#SOURYOU").text(numberFormat3(val2));                $("#TESUURYOU").text(numberFormat3(val3));                $("#GOUKEI").text(numberFormat3(val));            }        );        $("#payCONVENI").mousedown(            function() {                $("#payInfo").text("コンビニ支払");                $(this).find("input").attr("checked", "true");                var val1 = Number($("[name='PRODUCT_PRICE']")[0].value);    // 商品価格                var val2 = Number($("[name='CHARGE_YUBIN']")[0].value);     // 送料：郵便                var val3 = Number($("[name='CHARGE_CONVENI']")[0].value);   // 手数料                var val = val1 + val2 + val3;                $("[name='TOTAL_PRICE']")[0].value = val;   // 支払総額                $("#SOURYOU").text(numberFormat3(val2));                $("#TESUURYOU").text(numberFormat3(val3));                $("#GOUKEI").text(numberFormat3(val));            }        );        $("#payCARD").mousedown(            function() {                $("#payInfo").text("クレジットカード");                $(this).find("input").attr("checked", "true");                var val1 = Number($("[name='PRODUCT_PRICE']")[0].value);    // 商品価格                var val2 = Number($("[name='CHARGE_YUBIN']")[0].value);     // 送料：郵便                var val3 = Number($("[name='CHARGE_CARD']")[0].value);      // 手数料                var val = val1 + val2 + val3;                $("[name='TOTAL_PRICE']")[0].value = val;   // 支払総額                $("#SOURYOU").text(numberFormat3(val2));                $("#TESUURYOU").text(numberFormat3(val3));                $("#GOUKEI").text(numberFormat3(val));            }        );        $("#payDAIBIKI").mousedown(            function() {                $("#payInfo").text("代金引換便");                $(this).find("input").attr("checked", "true");                var val1 = Number($("[name='PRODUCT_PRICE']")[0].value);    // 商品価格                var val2 = Number($("[name='CHARGE_TAKUHAI']")[0].value);   // 送料：宅配                var val3 = Number($("[name='CHARGE_DAIBIKI']")[0].value);   // 手数料                var val = val1 + val2 + val3;                $("[name='TOTAL_PRICE']")[0].value = val;   // 支払総額                $("#SOURYOU").text(numberFormat3(val2));                $("#TESUURYOU").text(numberFormat3(val3));                $("#GOUKEI").text(numberFormat3(val));            }        );        // アンケート調査用        $(".selectBOX").mouseover(            function() {                $(this).css("cursor", "hand");            }        );        $(".ken").mousedown(            function() {                $(".ken").removeClass("selected");                $(".ken").addClass("selectable");                $(this).removeClass("selectable");                $(this).addClass("selected");                $("#ken").val($(this).text());            }        );        $(".nen").mousedown(            function() {                $(".nen").removeClass("selected");                $(".nen").addClass("selectable");                $(this).removeClass("selectable");                $(this).addClass("selected");                $("#nen").val($(this).text());            }        );        $(".sei").mousedown(            function() {                $(".sei").removeClass("selected");                $(".sei").addClass("selectable");                $(this).removeClass("selectable");                $(this).addClass("selected");                $("#sei").val($(this).text());            }        );        // アニメーション処理        setTimeout(animateTitleLogo, 300);        // 左右中央ページDIVの高さを揃える        $('#pageLeft, #pageCenter, #pageRight').setHeight();        $("#page").css("visibility", "visible");    });//-------------------------------------------------------------// ウィンドウ ロード//-------------------------------------------------------------$(window).load(    function() {    });//-------------------------------------------------------------// ウィンドウ アンロード//-------------------------------------------------------------$(window).unload(    function() {        if (newSession == 1 && (0 < screenW + screenH)) {            $.post("/command/countScreenSize.php", { w:screenW, h:screenH });        }        if (adID != "") {            $.post("/command/countClickAds.php", { p:page, a:adID });        //  alert("JUMP:" + adID);        }    });//-------------------------------------------------------------// ウィンドウ リサイズ//-------------------------------------------------------------$(window).resize(    function() {    //  if ($.browser.msie) {    //  //  location.reload(true);    //      $('#pageLeft, #pageCenter, #pageRight').setHeight();    //  } else {    //      $('#pageLeft, #pageCenter, #pageRight').setHeight();    //  }    });//---------------------------------------------------------// タイトルロゴアニメーション//---------------------------------------------------------function animateTitleLogo() {    $(".tbox").css("top", 64);    $(".tbox").css("left", 64);    effect.Time = 800;  // アニメーション時間（速度）    effect.BW = 64;     // 移動するボックスの幅    effect.BH = 64;     // 移動するボックスの高    $("#th10").animate({ left: (effect.BW *  0) + "px" }, effect.Time);    $("#th11").animate({ left: (effect.BW *  1) + "px" }, effect.Time);    $("#th12").animate({ left: (effect.BW *  2) + "px" }, effect.Time);    $("#th13").animate({ left: (effect.BW *  3) + "px" }, effect.Time);    $("#th14").animate({ left: (effect.BW *  4) + "px" }, effect.Time);    $("#th15").animate({ left: (effect.BW *  5) + "px" }, effect.Time);    $("#th16").animate({ left: (effect.BW *  6) + "px" }, effect.Time);    $("#th17").animate({ left: (effect.BW *  7) + "px" }, effect.Time);    $("#th18").animate({ left: (effect.BW *  8) + "px" }, effect.Time);    $("#th19").animate({ left: (effect.BW *  9) + "px" }, effect.Time);    $("#th20").animate({ left: (effect.BW * 10) + "px" }, effect.Time);    $("#th21").animate({ left: (effect.BW * 11) + "px" }, effect.Time);    $("#tv10").animate({ top:  (effect.BH *  0) + "px" }, effect.Time);    $("#tv11").animate({ top:  (effect.BH *  1) + "px" }, effect.Time);    $("#tv12").animate({ top:  (effect.BH *  2) + "px" }, effect.Time);    $("#tv13").animate({ top:  (effect.BH *  3) + "px" }, effect.Time);    $("#tv14").animate({ top:  (effect.BH *  4) + "px" }, effect.Time);    $("#tv15").animate({ top:  (effect.BH *  5) + "px" }, effect.Time);    $("#tv16").animate({ top:  (effect.BH *  6) + "px" }, effect.Time);    $("#tv17").animate({ top:  (effect.BH *  7) + "px" }, effect.Time);    $("#tv18").animate({ top:  (effect.BH *  8) + "px" }, effect.Time);}//---------------------------------------------------------// URLバック処理//---------------------------------------------------------function urlBack() {    location.replace("/command/pageJump.php");}//---------------------------------------------------------// エラー処理//---------------------------------------------------------function errorProc() {    var dt = new Date();    var dt1 = dt.getTime();    while (true) {        dt = new Date();        dt2 = dt.getTime();        if (5000 < dt2 - dt1) break;    // 5秒ループ    }    location.reload(true);}//---------------------------------------------------------// カンマ区切り数値文字列//---------------------------------------------------------function numberFormat3x(val) {    var to = String(val);    var tmp = "";    while (to != (tmp = to.replace(/^([+-]?d+)(ddd)/,"$1,$2"))) {        to = tmp;    }    return to;}function numberFormat3(val) {    var r = "";    var s = val.toString().split("").reverse();    for (var i = 0; i < s.length; i++) {        if (i % 3 == 0 && i != 0 && s[i] != "-") {            r = s[i] + "," + r        } else {            r = s[i] + r;        }    }    return r;}//-------------------------------------------------------------// Copyright(C)Landwarf All right reserved.//-------------------------------------------------------------
