// JavaScript Document

//レジへ行く
function cash_regi(wshop_cart_dt){
    if ( GetCookie( wshop_cart_dt ) == null ) {
         alert( "かごの中身がありません" );
         return;
    }
        window.open("http://www.mekketown.com/cgi-bin/wshop/tpshop/tpshop_chkcook.pl?SVC%3D"+wshop_cart_dt,"win_wshop",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=680,height=480,alwaysRaised=yes');
}

// クッキーデータ取得
function GetCookie( p_name ) {
   var v_index;
   var v_start;
   var v_end;
   if ( document.cookie ) {
       v_index = document.cookie.indexOf( p_name, 0 );
       if ( v_index != -1 ) {
           v_start = ( document.cookie.indexOf( "=", v_index ) + 1 );
           v_end   = document.cookie.indexOf( ";", v_index );
           if ( v_end == -1 ) {
               v_end = document.cookie.length;
           }
           return( unescape( document.cookie.substring( v_start, v_end ) ) );
       }
   }
   return( null );
}

//かごの中身ボタン
function front_kago(wshop_cart_dt) {
    if ( GetCookie( wshop_cart_dt ) == null ) {
        alert( "買い物かごに商品が登録されていません" );
        return;
        }
    window.open("http://www.mekketown.com/cgi-bin/wshop/tpshop/tpshop_cart.pl?SVC%3D" + wshop_cart_dt,"win_wshop",'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=640,height=480,alwaysRaised=yes');
}

//ご利用ガイド表示
function goriyo() {
    window.open("./goriyo.html","wshop_guide",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=512,height=512,alwaysRaised=yes');
}


//お問い合わせ
function inquiry(tpshop_code) {
window.open("http://www.mekketown.com/cgi-bin/wshop/tpshop/tpshop_mailform.pl?tpshop_code=" + tpshop_code,"inquery",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=512,alwaysRaised=yes');
}