$(document).ready(function(){
	$("#movieListBtn,#estate").live('mouseover',function(){flip(this);});
	$("#movieListBtn,#estate").live('mouseout',function(){flip(this);});
	$("#headField").load('http://atamideasobo.com/header/header.html');
	$("#footField .main").load('http://atamideasobo.com/footer/footer.html');
	$("#menuBtn li").live("mouseover",function(){
		$(this).css("background-position","0px 80px");
		});
	$("#menuBtn li").live("mouseout",function(){
		$(this).css("background-position","0px 0px");
		});

	//ベストショット操作用
	$(".rgtArw").live("mouseover",function(){$(this).addClass("bsArwOn");});
	$(".rgtArw").live("mouseout", function(){$(this).removeClass("bsArwOn");});
	$(".rgtArw").live("click",function(){
		var lastLeft = $(".bsScreen").width()*-1 + 250;
		if($(".bsScreen").position().left > lastLeft){
			$(".bsScreen").animate({"left": "-=250px"}, "slow","swing",function(){
				if($(".bsScreen").position().left<lastLeft)$(".bsScreen").animate({"left":lastLeft},"fast");
			});
		}
	});

	$(".lftArw").live("mouseover",function(){$(this).addClass("bsArwOn");});
	$(".lftArw").live("mouseout",function(){$(this).removeClass("bsArwOn");});
	$(".lftArw").live("click",function(){
		if($(".bsScreen").position().left<0){
		$(".bsScreen").animate({"left": "+=250px"}, "slow","swing",function(){
			if($(".bsScreen").position().left>0)$(".bsScreen").animate({"left":"0px"},"fast");
			});
		}
	});

});


function readSubColumn(cList){
			$.post("http://atamideasobo.com/php/showSubContent.php",{params:cList},function(data){$("#subContent").append(data);},"html");
}

//ボタン背景切替
function flip(target){
	var pos=$(target).css("backgroundPositionY");
	pos = pos.replace('px','');
	pos = pos.replace('%','');
	var h = $(target).height();
	if(pos==0){
		$(target).css("backgroundPositionY",h);
	}else{
		$(target).css("backgroundPositionY","0px");
	}
}

