
$(document).ready(function(){
  $("#homePickup li:odd").addClass("right");
  $("#homePickup li:nth-child(2n+2)").after("<br clear='all'>");
  $("#pickupList").css("width","521px");
  $("#pickupList li:odd").addClass("right");
  $("#recomlist dl:nth-child(3n+3)").after("<br clear='all'>");
  $("#recomlist2 dl:odd").addClass("right");
  $("#recomlist2 dl:nth-child(2n+2)").after("<br clear='all'>");
	$("ul.secondNews > li:first").css("background","none")
	$("#areaList li:even").addClass("even");
	//$("#styleList dl:nth-child(3n+1)").css("margin-left","0");
	$(".serviceBlock:odd").addClass("odd");
});

$(function() {
	//$('#tabBlock').tabs({ fxFade: true, fxSpeed: 'fast' });
	//$('#tabMapDM').tabs({ fxFade: true, fxSpeed: 'fast' });
	//$('#tabMapAB').tabs({ fxFade: true, fxSpeed: 'fast' });
});


function initRollOverImages() {
  var image_cache = new Object();
  $("img.swap,input.swap").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_on;
    $(this).hover(
      function() { this.src = imgsrc_on; },
      function() { this.src = imgsrc; });
  });
}

$(document).ready(initRollOverImages);


// popup
function openwin (url,name,w,h) {
w = window.open(url,name,"width="+w+",height="+h+",left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,favorites=no,resizable=yes");w.focus();
}

// pagescroll
function jumpToPageTop(e) {
	UAGENT = navigator.userAgent.toUpperCase();
	if (UAGENT.indexOf("MSIE") >=0) {
		pos = event.y;
	} else {
		pos = e.pageY;
	}
	pageScroll(pos);
}
function pageScroll(posi) {
	dist = posi / 6;
	nPos = parseInt(posi - dist);
	scrollTo(0,nPos);
	if (nPos > 0) {
		setTimeout("pageScroll(nPos)",10);
	}
}

// sideTab
jQuery(function($){
	$("#tnavi-dm").click(function () { 
		$("#abSrc").fadeOut();
		$("#dmSrc").fadeIn();
		$("#tabBlock").addClass("dmSelected");
		$("#tabBlock").removeClass("abSelected");
	})
	
	$("#tnavi-ab").click(function () { 
		$("#dmSrc").fadeOut();
		$("#abSrc").fadeIn();
		$("#tabBlock").addClass("abSelected");
		$("#tabBlock").removeClass("dmSelected");
	})
});

// sideMapDM
jQuery(function($){
	$("#tabMapDM li.mapSrcOsaka").click(function () { 
		$("#mapDMtokyo").fadeOut();
		$("#mapDMkyusyu").fadeOut();
		$("#mapDMosaka").fadeIn();
		$("#tabMapDM").addClass("osakaSelected");
		$("#tabMapDM").removeClass("tokyoSelected");
		$("#tabMapDM").removeClass("kyusyuSelected");
	})
	
	$("#tabMapDM li.mapSrcTokyo").click(function () { 
		$("#mapDMosaka").fadeOut();
		$("#mapDMkyusyu").fadeOut();
		$("#mapDMtokyo").fadeIn();
		$("#tabMapDM").removeClass("osakaSelected");
		$("#tabMapDM").addClass("tokyoSelected");
		$("#tabMapDM").removeClass("kyusyuSelected");
	})

	$("#tabMapDM li.mapSrcKyusyu").click(function () { 
		$("#mapDMosaka").fadeOut();
		$("#mapDMtokyo").fadeOut();
		$("#mapDMkyusyu").fadeIn();
		$("#tabMapDM").removeClass("osakaSelected");
		$("#tabMapDM").removeClass("tokyoSelected");
		$("#tabMapDM").addClass("kyusyuSelected");
	})
});


// sideMapAB 5.28 inclover 追加
jQuery(function($){
	$("#tabMapAB li.mapSrcOsaka").click(function () { 
		$("#mapABosaka").fadeIn();
		$("#mapABtokyo").fadeOut();
		$("#mapABother").fadeOut();
		$("#tabMapAB").addClass("osakaSelected");
		$("#tabMapAB").removeClass("tokyoSelected");
		$("#tabMapAB").removeClass("otherSelected");
		$(".euMapside").fadeOut();
		$(".afMapside").fadeOut();
		$(".asiaMapside").fadeOut();
		$(".worldMapside").fadeIn();
	})
	
	$("#tabMapAB li.mapSrcTokyo").click(function () { 
		$("#mapABosaka").fadeOut();
		$("#mapABtokyo").fadeIn();
		$("#mapABother").fadeOut();
		$("#tabMapAB").removeClass("osakaSelected");
		$("#tabMapAB").addClass("tokyoSelected");
		$("#tabMapAB").removeClass("otherSelected");
		$(".euMapside").fadeOut();
		$(".afMapside").fadeOut();
		$(".asiaMapside").fadeOut();
		$(".worldMapside").fadeIn();
	})

	$("#tabMapAB li.mapSrcOther").click(function () { 
		$("#mapABosaka").fadeOut();
		$("#mapABtokyo").fadeOut();
		$("#mapABother").fadeIn();
		$("#tabMapAB").removeClass("osakaSelected");
		$("#tabMapAB").removeClass("tokyoSelected");
		$("#tabMapAB").addClass("otherSelected");
		$(".euMapside").fadeOut();
		$(".afMapside").fadeOut();
		$(".asiaMapside").fadeOut();
		$(".worldMapside").fadeIn();
	})
});



// mainmap

jQuery(function($){
   $(".gotoEU").click(function () { 
     $("#worldMap").fadeOut();
     $("#euMap").fadeIn();
   })
   $(".returnMap").click(function () { 
     $("#worldMap").fadeIn();
     $("#euMap").fadeOut();
   })
 });


// mainmap0421追加

jQuery(function($){
   $(".gotoAF").click(function () { 
     $("#worldMap").fadeOut();
     $("#afMap").fadeIn();
   })
   $(".returnMap").click(function () { 
     $("#worldMap").fadeIn();
     $("#afMap").fadeOut();
   })
 });




// sidemap

jQuery(function($){
   $(".gotoEUside").click(function () { 
     $(".worldMapside").fadeOut();
		 $(".euMapside").fadeIn();
   })
   $(".returnMapside").click(function () { 
     $(".worldMapside").fadeIn();
		 $(".euMapside").fadeOut();
   })
 });


// sidemap0421追加

jQuery(function($){
   $(".gotoAFside").click(function () { 
     $(".worldMapside").fadeOut();
		 $(".afMapside").fadeIn();
   })
   $(".returnMapside").click(function () { 
     $(".worldMapside").fadeIn();
		 $(".afMapside").fadeOut();
   })
 });



// sidemap

jQuery(function($){
   $(".gotoAFside").click(function () { 
     $(".worldMapside").fadeOut();
		 $(".afMapside").fadeIn();
   })
   $(".returnMapside").click(function () { 
     $(".worldMapside").fadeIn();
		 $(".afMapside").fadeOut();
   })
 });



jQuery(function($){
   $(".gotoAsiaside").click(function () { 
     $(".worldMapside").fadeOut();
		 $(".asiaMapside").fadeIn();
   })
  $(".returnMapside").click(function () { 
     $(".worldMapside").fadeIn();
		 $(".asiaMapside").fadeOut();
   })
 });


// gnavi 5.20 inclover 追加
$(document).ready(function() {
  var toggle = function(direction, display) {
    return function() {
      var self = this;
      var box = $(".areaBox", this);
      if( box.css("display") == display && !self["block" + direction] ) {
        self["block" + direction] = true;
        box["slide" + direction]("fast", function() {
          self["block" + direction] = false;
        });
      }
    };
  }
  $("#gnavi li").hover(toggle("Down", "none"), toggle("Up", "block"));
  $("#gnavi li .areaBox").hide();
	
/*	$(".areaBox").mouseover(function(){
			$(this).prev().css("background-position","0px -36px")
	});
	$(".areaBox").mouseout(function(){
			$(this).prev().css("background-position","0px 0px")
	});

	$("#gnavi li a").mouseover(function(){
			$(this).css("background-position","0px -36px")
	});
	$("#gnavi li a").mouseout(function(){
			$(this).css("background-position","0px 0px")
	});
*/
});


