/*  ================================================================================
 *
 *   
 *  2011.11
 *  jQuery使用
 *
================================================================================ */


/*---ウィンドウのポップアップ（スクロールバーあり）---*/
function subWindow(url,w,h,winName){
    var subWin = window.open(url, winName, 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h+'');
	subWin.focus();
}

/* ======================================================================
 faciliteies用
====================================================================== */

$(function(){
	$('#panel01').css('display','block');
	$('#panel02').css('display','none');
	$('#panel03').css('display','none');
	$('#panel04').css('display','none');
	$('#tab1').addClass("select"); 
});

$(function() {
    $("#tab1").click(function(event){
		$("div[id^=panel0]").hide();
		$("#panel01").fadeIn();
		
		$("[id^=tab]").removeClass("select");
		$(this).addClass("select"); 
	})
    $("#tab2").click(function(event){
		$("div[id^=panel0]").hide(); 
		$("#panel02").fadeIn(); 
		
		$("[id^=tab]").removeClass("select");
		$(this).addClass("select"); 
	})
    $("#tab3").click(function(event){
		$("div[id^=panel0]").hide(); 
		$("#panel03").fadeIn(); 
		
		$("[id^=tab]").removeClass("select");
		$(this).addClass("select"); 
	})
    $("#tab4").click(function(event){
		$("div[id^=panel0]").hide(); 
		$("#panel04").fadeIn(); 
		
		$("[id^=tab]").removeClass("select");
		$(this).addClass("select"); 
	})
})

/* ======================================================================
 room plan用
====================================================================== */

$(function(){
	$('#type01').css('display','block');
	$('#type02').css('display','none');
	$('#type03').css('display','none');
	$('#type04').css('display','none');
	$('#type05').css('display','none');
	$('#type06').css('display','none');
	$('#tab1').addClass("crt"); 
});

$(function() {
    $("#tab1").click(function(event){
		$("div[id^=type0]").hide();
		$("#type01").fadeIn();
		
		$("[id^=tab]").removeClass("crt");
		$(this).addClass("crt"); 
	})
    $("#tab2").click(function(event){
		$("div[id^=type0]").hide(); 
		$("#type02").fadeIn(); 
		
		$("[id^=tab]").removeClass("crt");
		$(this).addClass("crt"); 
	})
    $("#tab3").click(function(event){
		$("div[id^=type0]").hide(); 
		$("#type03").fadeIn(); 
		
		$("[id^=tab]").removeClass("crt");
		$(this).addClass("crt"); 
	})
    $("#tab4").click(function(event){
		$("div[id^=type0]").hide(); 
		$("#type04").fadeIn(); 
		
		$("[id^=tab]").removeClass("crt");
		$(this).addClass("crt"); 
	})
    $("#tab5").click(function(event){
		$("div[id^=type0]").hide(); 
		$("#type05").fadeIn(); 
		
		$("[id^=tab]").removeClass("crt");
		$(this).addClass("crt"); 
	})
    $("#tab6").click(function(event){
		$("div[id^=type0]").hide(); 
		$("#type06").fadeIn(); 
		
		$("[id^=tab]").removeClass("crt");
		$(this).addClass("crt"); 
	})
})



/* ======================================================================
 Rollover用
====================================================================== */

function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_def."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_def.", "_over."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_over.", "_def."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}




