<!--

  var d = document;

  // window.event取得スクリプト（Firefox, IE, Opera）対応 (NN?スルーしてやんよ)
  function windowEvent()
  {
      if(window.event){
          return window.event;
      }

      var caller = arguments.callee.caller;
      var ob;
      while(caller){
          ob = caller.arguments[0];
          if(ob && ob.constructor == MouseEvent){
              return ob;
          }
          caller = caller.caller;
      }

      return null;
  }

  //Ｘ座標取得スクリプト（Firefox, IE, Opera）対応 (NN?スルーしてやんよ)
  function getEventPageX()
  {
      var e = windowEvent();
      if(e.pageX){
          return e.clientX;
      } else if(e.clientX){
          if(d.documentElement && typeof d.documentElement.scrollLeft != "undefined"){
              return d.documentElement.scrollLeft + e.clientX;
          } else if(d.body && typeof d.body.scrollLeft != "undefined"){
              return d.body.scrollLeft + e.clientX;
          }
      }
      return 0;
  }

  //Ｙ座標取得スクリプト（Firefox, IE, Opera）対応 (NN?スルーしてやんよ)
  function getEventPageY()
  {
      var e = windowEvent();
      if(e.pageY){
          return e.clientY;
      } else if(e.clientY){
          if(d.documentElement && typeof d.documentElement.scrollLeft != "undefined"){
            return d.documentElement.scrollLeft + e.clientY;
          } else if(d.body && typeof d.body.scrollLeft != "undefined"){
            return d.body.scrollLeft + e.clientY;
          }
      }

      return 0;
  }

  function getElementPosition()
  {
      var _x = _y = 0;
      var ob = windowEvent().target || windowEvent().srcElement;
      if(ob.offsetParent){
          while (ob.offsetParent){
              _x += ob.offsetLeft; _y += ob.offsetTop;
              ob = ob.offsetParent;
          }
      }
      return [_x, _y];
  }



  // aboutページでの画面表示非表示用スクリプト
  function view_window(name)
  {
      document.getElementById("about_access").style.display = "none";
      if( name == "about_buy" ){
          document.getElementById("about_buy").style.display = "block";
      }else{
	      document.getElementById("about_buy").style.display = "none";
      }

      if( name == "about_sale" ){
          document.getElementById("about_sale").style.display = "block";
	  }else{
	      document.getElementById("about_sale").style.display = "none";
      }

      if( name == "about_affiliate" ){
          document.getElementById("about_affiliate").style.display = "block";
	  }else{
	      document.getElementById("about_affiliate").style.display = "none";
      }
  }

  //ヒントメッセージ表示On
  function ChipON(id_no,x,y)
  {
      var offX = offY = 0;
//      if (document.layers) chip= document.layers[id_no];
      if (document.getElementById(id_no).style){
        chip = document.getElementById(id_no).style;
      }
      if (chip.visibility.charAt(0) == "v") return;
      if(document.getElementById(id_no)){
          offX = document.body.scrollLeft;
          offY = document.body.scrollTop;
      }
      chip.visibility = "visible";
      chip.left = x + offX;
      chip.top = y + offY;
  }

  //ヒントメッセージ表示off
  function ChipOFF(id_no)
  {
      if(document.getElementById(id_no)) document.getElementById(id_no).style.visibility = "hidden";
      if (document.layers)               document.layers[id_no].visibility = "hidden";
  }

  //チュートリアルポップアップオープン
  function openTutorial(thema, item, number)
  {
      var page = 'http://' + document.domain + '/tutorial/?thema=' + thema + '&item=' + item;
      if (number != null) {
          page = page + '#' + number;
      }
      var tutorial_window = window.open(page, 'tutorial', 'toolbar=no, location=no, status=no, scrollbars=no, width=640, height=480');
  }

  //インフォメーションポップアップオープン
  function openInformation(controller)
  {
      var page = 'http://' + document.domain + '/information/' + controller + '/';
      var information_window = window.open(page, 'information', 'toolbar=no, location=no, status=no, scrollbars=no, width=640, height=650');
  }

  //メルマガサンプルポップアップオープン
  function openSample(magazine_id) 
  {
      var page = 'http://' + document.domain + '/m/sample/?magazine=' + magazine_id;
      var tutorial_window = window.open(page, 'magazine_sample', 'toolbar=no, location=no, status=no, scrollbars=yes, width=640, height=480');
  }

  //bookプレビューポップアップオープン
  function openPreview(book_id)
  {
      var page = 'http://' + document.domain + '/s/book_preview/?book_id=' + book_id;
      var preview_window = window.open(page, 'book_preview', 'toolbar=no, location=no, status=no, scrollbars=yes, width=400, height=750');
  }

  //book紹介文ﾍﾟｰｼﾞプレビューポップアップオープン
  function openPreviewIntroduction(book_id)
  {
      var page = 'http://' + document.domain + '/s/book_preview/introduction/?book=' + book_id;
      var preview_window = window.open(page, 'introduction', 'toolbar=no, location=no, status=no, scrollbars=yes, width=400, height=750');
  }

  //bookアフィリエイトﾍﾟｰｼﾞプレビューポップアップオープン
  function openPreviewinvitation(book_id)
  {
      var page = 'http://' + document.domain + '/s/book_preview/invitation/?book=' + book_id;
      var preview_window = window.open(page, 'invitation', 'toolbar=no, location=no, status=no, scrollbars=yes, width=400, height=750');
  }

  //ナビゲーション画像の切り替えスクリプト
  function view_window(name)
  {
      document.getElementById("about_access").style.display = "none";
      if( name == "about_buy" ){
          document.getElementById("about_buy").style.display = "block";
  	  }else{
        document.getElementById("about_buy").style.display = "none";
	  }

      if( name == "about_sale" ){
          document.getElementById("about_sale").style.display = "block";
	  }else{
          document.getElementById("about_sale").style.display = "none";
      }

      if( name == "about_affiliate" ){
          document.getElementById("about_affiliate").style.display = "block";
      }else{
	      document.getElementById("about_affiliate").style.display = "none";
      }
  }

  //旧レジまぐ　トグルボタン
  function cnChange(toggle,list)
  {
      pathname = "http://"+document.domain;
      if( document.getElementById(toggle).src == pathname+"/img/toggle_plus.gif" ){
          document.getElementById(toggle).src = pathname+"/img/toggle_minus.gif";
          document.getElementById(toggle).alt = "詳細クローズ";
          document.getElementById(list).style.display = "block";
      } else {
          document.getElementById(toggle).src = pathname+"/img/toggle_plus.gif";
          document.getElementById(toggle).alt = "詳細オープン";
          document.getElementById(list).style.display = "none";
      }
  }

  // tutorialページでの画面表示非表示用スクリプト
  function viewTutorial(number)
  {
    if (number == "") {
        number = "10";
    }
    for (i = 0; i < document.getElementsByTagName("div").length; i++) {
        obj = document.getElementsByTagName("div")[i];
        if (obj.id.match(/^tutorial_/)) {
            if (obj.id == "tutorial_" + number) {
                obj.style.display = "block";
            } else {
                 obj.style.display = "none";
            }
        }
    }
  }

  // navigationページでの画面表示非表示用スクリプト
  function viewNavigation(number)
  {
    if (number == "") {
        number = "1";
    }
    for (i = 0; i < document.getElementsByTagName("div").length; i++) {
        obj = document.getElementsByTagName("div")[i];
        if (obj.id.match(/^step/)) {
            if (obj.id == "step" + number) {
                obj.style.display = "block";
            } else {
                 obj.style.display = "none";
            }
        }
    }
  }

  // informationページでの画面表示非表示用スクリプト
  function viewInformation(number)
  {
    if (number == "") {
        number = "10";
    }
    for (i = 0; i < document.getElementsByTagName("div").length; i++) {
        obj = document.getElementsByTagName("div")[i];
        if (obj.id.match(/^information_/)) {
            if (obj.id == "information_" + number) {
                obj.style.display = "block";
            } else {
                 obj.style.display = "none";
            }
        }
    }
  }

  function BoxChecked(check, formName, paramName)
  {
    var count;
    for(count = 0; count < document.forms[formName].elements[paramName].length; count++){
      document.forms[formName].elements[paramName][count].checked = check;	//チェックボックスをON/OFFにする
    }
  }

    //カラーパレットの表示
    function colorDialog(nm,cl){

        var a;
        var b;

        if(frm.elements[nm].value != ""){
            if(frm.elements[nm].value.charAt(0) == "#"){
                a = 1;
                b = 7;
            }
            else{
                a = 0;
                b = 6;
            }
            cl = frm.elements[nm].value.substring(a,b);
        }
        else{
            cl = cl.substring(1,7);
        }
        col = Dialog.ChooseColorDlg(cl);		//　カラーダイアログを表示する
        col = "00000" + col.toString(16);		//　16進数に変換
        col = col.substring(col.length-6,col.length);	//　右端から6桁のみ取得
        frm.elements[nm].value = col.toUpperCase();

    }

    //カラーパレット呼び出しから値を返す一連の処理
    function ChooseCol(h, color){
        var browse=navigator.appName;
        var browse_version=navigator.appVersion;
        var $obj = getId2Obj("base");
        $isdo = true;

        //ブラウザによって呼び出すものを変える
        if (
            ((browse_version.indexOf("MSIE 6",0) != -1 || browse_version.indexOf("MSIE 7",0) != -1) && browse=="Microsoft Internet Explorer")
        //     || (navigator.userAgent.indexOf("Opera") != -1)
           ) {//IEなど

            //呼び出し
            ChooseCol_Dig(color);

            switch(h){
                case 0:
                    frmFORM.bgcolor.value=COL;  //カラーの16進数表示
                break;
                case 1:
                    frmFORM.textcolor.value=COL;
                break;
                case 2:
                    frmFORM.linkcolor.value=COL;
                break;
                case 3:
                    frmFORM.vlinkcolor.value=COL;
                break;
                default:
                break;
            }

        }else{
            //ポップアップのホスト名を決める
            $hostname = window.location.hostname;
            if (!$hostname){
                $hostname = 'regimag.jp';//保険
            }

            //ポップアップオープン
            $win = window.open("https://" + $hostname + "/colordialog.html", "dialog", "width:35px,height:10px,dependent,modal");
            window.onfocus=function() {
                if ($win && !$win.closed) {
                    $win.focus();
                } else if($win.closed && $isdo) {

                    $isdo = false;
                    var $color = $win.returnValue;

                    //呼び出し元に値を返す
                    switch(h){
                        case 0:
                            if ($color == 'undefined' || !$color){
                                $color = document.getElementById('bgcolor').value
                            }
                            window.document.frmFORM.bgcolor.value = $color;
                        break;
                        case 1:
                            if ($color == 'undefined' || !$color){
                                $color = document.getElementById('textcolor').value
                            }
                            window.document.frmFORM.textcolor.value = $color;
                        break;
                        case 2:
                            if ($color == 'undefined' || !$color){
                                $color = document.getElementById('linkcolor').value
                            }
                            window.document.frmFORM.linkcolor.value = $color;
                        break;
                        case 3:
                            if ($color == 'undefined' || !$color){
                                $color = document.getElementById('vlinkcolor').value
                            }
                            window.document.frmFORM.vlinkcolor.value = $color;
                        break;
                        default:
                        break;
                    }
                }
            }
        }
    }

    function ChooseCol_Dig(color){
        COL=Dialog.ChooseColorDlg();  //戻り値は10進数のカラーコード
        if (COL==false) {             //キャンセルが選択された場合 
            COL = color
            return COL;
        }

        COL="000000"+COL.toString(16);   //16進数カラーコードに変換
        COL=COL.substring(COL.length-6,COL.length);  //16進数カラーコード右端6桁のみを取得
        COL="#"+COL  //#記号を付加
    }

    function getId2Obj($Id)
    {
        // ブラウザ情報の取得
        var myOP = window.opera;
        var myN6 = document.getElementById;
        var myIE = document.all;
        var myN4 = document.layers;
        var myBR;

        if (myBR == "N6") {
            return document.getElementById($Id);
        } else if (myBR == "IE") {
            return document.all($Id);
        } else if (myBR == "N4") {
            return document[$Id];
        } else {
            return 0;
        }
    }

    // ［送信］ボタンをクリック時の処理を定義
    function send() {
        // 非同期通信を行うためのXMLHttpRequestオブジェクトを生成
        try {
            xmlReq = new ActiveXObject("Microsoft.XMLHTTP");
        } catch(e) {
            xmlReq = new XMLHttpRequest();
        }
        // サーバーからの応答時の処理を定義（結果のページへの反映）
        xmlReq.onreadystatechange = function() {
            var msg = document.getElementById("result");
            if (xmlReq.readyState == 4) {
                if (xmlReq.status == 200) {
                    msg.innerHTML = xmlReq.responseText;
                } else {
                    msg.innerHTML = "通信に失敗しました。";
                }
            }
        }
        
        // サーバーとの通信を開始
        xmlReq.open("GET","/sys/index/demand/?demand="
                          + encodeURI(document.fm.demand.value),true);
        xmlReq.send(null);
    }

// -->