// JavaScript Document

$(document).ready(function(){
	$("#toppics div a").hover(function(){
		$("img", this).stop().animate({top:"-130px"},{queue:false,duration:200});
	}, function() {
		$("img", this).stop().animate({top:"0px"},{queue:false,duration:200});
	});
});


//$(document).ready(function(){
//						   
//	$(".housecontent a").click(function(){
//    	window.open(this.href);
//		return false;
//	});
//
//});

$(document).ready(function(){

	$(".icons a").hover(function() {
		$(this).next("em").animate({opacity: "show", top: "-45"}, "slow");
	}, function() {
		$(this).next("em").animate({opacity: "hide", top: "-65"}, "fast");
	});


});

var activeTab = 1;
var activeHouse = 11; //11=

function openTab(tabId) {
// reset old tab and content
document.getElementById("tabLink"+activeTab).className = "tabLink";
document.getElementById("tabContent"+activeTab).className = "tabContent";
// set new tab and content
document.getElementById("tabLink"+tabId).className = "tabLinkActive";
document.getElementById("tabContent"+tabId).className = "aboutinfo";
activeTab = tabId;
}

function openHouse(tabId) {
// reset old tab and content
document.getElementById("tabLink"+activeHouse).className = "tabLink";
document.getElementById("tabContent"+activeHouse).className = "tabContent";
// set new tab and content
document.getElementById("tabLink"+tabId).className = "tabLinkActive";
document.getElementById("tabContent"+tabId).className = "houseinfo";
activeHouse = tabId;
}

function onloadHouse(){
	var STR = location.search;
	if(STR == "?todoroki")openHouse(1);
	else if(STR == "?sumiyoshi")openHouse(2);
	else if(STR == "?yukigaya")openHouse(3);
	else if(STR == "?eifukucho")openHouse(4);
	else if(STR == "?ogikubo")openHouse(5);
	else if(STR == "?minamidai")openHouse(6);
	else if(STR == "?narimasu")openHouse(7);
	else if(STR == "?kichijoji")openHouse(8);
	else if(STR == "?ebisu")openHouse(9);
	else if(STR == "?yaguchi")openHouse(10);
	else if(STR == "?seijo")openHouse(11);
	else if(STR == "?newhouse1")openHouse(12);
	else if(STR == "?newhouse2")openHouse(13);
}

function onloadTab(){
	var STR = location.search;
	if(STR == "?philosophy")openTab(1);
	else if(STR == "?info")openTab(2);
	else if(STR == "?history")openTab(3);
	else if(STR == "?careers")openTab(4);
	else if(STR == "?IR")openTab(5);
	else if(STR == "?QnA")openTab(6);
}
