﻿var app = Sys.Application;
$(document).ready(function() {
    //TOP PAGE INFRMATION ACTION
    $("#banner1").hover(
        function() {
            $("#BannerMsgBox").slideDown();
            var msg = "<ul>" +
            "<li>年内の配送は、<span style='font-size:14px;font-weight:bold;'>12月29日(月)迄</span>となります。</li>" +
            "<li>29日午後1時までのご注文で、ご入金確認できたご注文につきましては、年内発送させていただきます。</li>" +
            "<li>年始は<span style='font-size:14px;font-weight:bold;'>1月6日(火)</span>より発送業務開始となります。</li>" +
            "<li>年末・年始休暇期間もネット及びFAXでのご注文は承っておりますが、お電話及びご質問への返答は出来ませんのでご了承下さい。</li>" +
            "<li>何卒、よろしくお願い申し上げます。</li>" +
            "</ul>";

            $("#BannerMsgBox > .text").html(msg);
        },
        function() {
            $("#BannerMsgBox").slideUp();
        }
		
    );

    $(".language_ja").click(function() {
        if ($.cookie('lang').indexOf('ja') == -1) {
            $.cookie('lang_def', $.cookie('lang'));
            $.cookie('lang', 'ja-JP');
        }
    });
    $(".language_en").click(function() {
        if ($.cookie('lang').indexOf('ja') != -1)
            $.cookie('lang', 'en-US');
        else
            $.cookie('lang', $.cookie('lang_def'));
    });
    $(".language_test").click(function() {
        alert($.cookie('lang'));
    });

    if ($.cookie('lang') != null) {
        if ($.cookie('lang').indexOf('ja') != -1) {
            $(".language_ja").css("color", "#FFF");
            $(".language_ja").css("font-weight", "bold");
            $(".langmask_en").hide();
        } else {
            $(".language_en").css("color", "#FFF");
            $(".language_en").css("font-weight", "bold");
            $(".langmask_ja").hide();
            //REGISTRATION LINKを非表示
            //$("#hmenu1 > ul > li:eq(2)").css("display", "none");
        }
    }

    var url = document.URL;
    if (url.indexOf("registration") != -1 || url.indexOf("confirmation") != -1) {
        $(".langmask_ja").show();
        $(".langmask_en").show();
    }
    /*
    if($.cookie('lang').indexOf('ja')!=-1){
    $(".hframe").append("<div id='CampaignLink'><a href='#' onclick='modalshow()'></a></div>");
    }else{
    $(".hframe").append("<div id='CampaignLink_en'><a href='#' onclick='modalshow()'></a></div>");
    }
    */
});
function pageLoad(){
    
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function modalshow(){
    $.blockUI({message:CampText(),
                css:{
                top:  ($(window).height() - 500) /2 + 'px',
                left: ($(window).width() - 640) /2 + 'px', 
                border:'solid 5px #eee',
                width: '640px',
                height:'480px',
                backgroundImage: 'url(../images/campaign/2009_51Top_BG.jpg)',
                backgroundRepeat:'no-repeat',
                cursor:'default',
                '-webkit-border-radius': '10px', 
                '-moz-border-radius': '10px'
                /*, 
                opacity: '.8',
                filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=80)'
                */
              }
    });
}
function CampText(){
    var msg = "<div id='modal'><div class='camptext'>";
    if($.cookie('lang').indexOf('ja')!=-1){
        msg += "キャンペーン期間中に5枚以上お買い上げの方に、キャンペーンビキニ1枚をもれなくプレゼントしています。" +
        "<ul>" +
        "<li>キャンペーンビキニは、TXMオリジナルTバック又はユニセックスタイプビキニのいずれかでサイズはMサイズのみとなります。</li>" +
        "<li>ご注文商品の内容により、こちらでいずれかを選ばせていただきます。（お客様からのご指定はできません。また不売品のため返品、交換はお受けいたしかねます。）</li>" +
        "<li>1回のご注文時5枚以上は何枚ご購入いただいてもプレゼント点数は1枚となります。</li>" +
        "<li>不要の場合は、備考欄にプレゼント不要とご記入下さい。</li>" +
        "</ul>" +
        "尚、用意した商品枚数がなくなり次第、キャンペーン終了となります。";
    } else {
    msg += "All customers who purchase more than 5 pieces will receive an extra piece of brief during the campaign. <br/>" +
        "<ul>" +
        "<li>Gift items will be either men's or unisex, T-back or bikini brief, the size M only.</li>" +
        "<li>Please note that the item will be choosen by us and we are not able to accept your request or exchange.</li>" +
        "<li>If you do not need a gift, please include 'No gift' to the Notes upon order.</li>" +
        "</ul>" +
        "When we run out of the stocks, the campaign will be closed.";
    }
    msg += "<div class='close'><a href='#' onclick='$.unblockUI()'><img src='../images/campaign/modalclose_btn.png' width='40' height='12' /></a></div>"+
    "</div></div>";
    return msg;
}
if(typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
