/*-------------------------------------------------------------

	function.js
	include jquery

-------------------------------------------------------------*/
/*---------------------------------------------------
	mousOver
---------------------------------------------------*/
$(function(){
	$("#baner ul li img,.jCarouselLite ul li img,#img010").hover(
		function(){
			$(this).fadeTo(120, 0.7);
		},
		function(){
			$(this).fadeTo(200, 1);
		}
	);
});

$(function() {
	//$("#news #menu01 img").addClass("current");
});
$(function() {
	//$("ul.tabMenu li:first-child a img").addClass("current");
});
$(function() {
	$("#sumi #globalNavi ul li:eq(0) img").addClass("current");
	$("#company #globalNavi ul li:eq(1) img").addClass("current");
	$("#access #globalNavi ul li:eq(2) img").addClass("current");
	$("#clipmail #globalNavi ul li:eq(3) img").addClass("current");
	$("#index #globalNavi ul li:eq(4) img").addClass("current");
	$("#sale #bukkenNavi ul li:eq(1) img").addClass("current");
	$("#rent #bukkenNavi ul li:eq(2) img").addClass("current");
});

$(function(){
	$(".current").each(function(){
		var newSrc = $(this).attr('src').replace("_off.", "_on.");
		$(this).attr("src", newSrc);
	});
});
$(document).ready(function(){
	$("img,input").mouseover(function(){
		if ($(this).attr("src")){
			$(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
		}
	});
	$("img[class!='current'],input").mouseout(function(){
		if ($(this).attr("src")){
			$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
		}
	});
});



var ZINDEX=10;

$(function(){
	$(".tabMenu li a").click(function (){
		//$(this).removeClass("tabCurrent");
		//$(this).addClass("tabCurrent");
		//$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
		
		ZINDEX++;
		$(this).css("z-index",ZINDEX);
		
		var CLASS = $(this).attr("class");
		var ID = $(this).parent().parent().parent().attr("id");
		
		for(i=1; i<7; i++){
			hideBox = "Box0"+i;
			$("div[id="+ID+"] div[class="+hideBox+"]").css("display","none");
		}
		
		tagetBox = "Box0"+CLASS.substr(4,1)
		$("div[id="+ID+"] div[class="+tagetBox+"]").css("display","block");
		
		
		var HEIGHT = $("div[id="+ID+"] div[class="+tagetBox+"]").height();
		
		var boxHEIGHT=HEIGHT+50;
		var saleboxHEIGHT=HEIGHT+40;
		
		$(this).parent().parent().parent().css("height",boxHEIGHT);//子の高さ
		$(this).parent().parent().parent().css("height",saleboxHEIGHT);//親の高さ
		
	});
});

$(function(){
	$(".inBox01").each(function(){
		var HEIGHT = $(this).height();
		var boxHEIGHT=HEIGHT+50;
		var saleboxHEIGHT=HEIGHT+95;
		$(this).parent().css("height",boxHEIGHT);
		$(this).parent().parent().css("height",saleboxHEIGHT);
	});
});


/*-------------------------------------------------------------
	mainV
-------------------------------------------------------------*/
$(function(){
	$("#SPcontents ul li a img.icon").hover(
		function(){
			var popUp = $(this).next();
			$(popUp).animate({width:'103px',height:'103px',left:"60px",top:"0px"},{queue:false,duration:200});
		},
		function(){
			var popUp = $(this).next();
			$(popUp).animate({width:'0px',height:'0px',left:"60px",top:"103px"},{queue:false,duration:200});
		}
	);
	$("#SPcontents ul li a img.icon2").hover(
		function(){
			var popUp = $(this).next();
			$(popUp).animate({width:'103px',height:'103px',left:"-20px",top:"-30px"},{queue:false,duration:200});
		},
		function(){
			var popUp = $(this).next();
			$(popUp).animate({width:'0px',height:'0px',left:"60px",top:"30px"},{queue:false,duration:200});
		}
	);
	$("#SPcontents ul li a img.pop").hover(
		function(){
			$(this).animate({width:'103px',height:'103px',left:"60px",top:"0px"},{queue:false,duration:200});
		},
		function(){
			$(this).animate({width:'0px',height:'0px',left:"60px",top:"103px"},{queue:false,duration:200});
		}
	);
	$("#SPcontents ul li a img.pop2").hover(
		function(){
			$(this).animate({width:'103px',height:'103px',left:"-20px",top:"-30px"},{queue:false,duration:200});
		},
		function(){
			$(this).animate({width:'0px',height:'0px',left:"-20px",top:"30px"},{queue:false,duration:200});
		}
	);
});

/*---------------------------------------------------
	kirikae
---------------------------------------------------*/
$(function(){
	$("#backimg ul li").hover(
		function(){
			var number=$(this).attr("class");
			$("#imgLeft ul li img" ).css("display","none");
			$("#imgLeft ul li." + number + " img" ).css("display","block");
		}
	);
});
