$(function(){
$newsflag = 0;
$setBase = "320";
$setHeightMin = $setBase + "px";
$minflag=0;

if($newsflag==1){
	$('.indexnewsarea2').css("display","block");
	$('.indexnewsarea').css("display","none");
}

if($('#block1').attr('scrollHeight')<= $setBase)$('a.block1').css("display","none");
if($('#block2').attr('scrollHeight')<= $setBase)$('a.block2').css("display","none");
if($('#block3').attr('scrollHeight')<= $setBase)$('a.block3').css("display","none");
if($('#block4').attr('scrollHeight')<= $setBase)$('a.block4').css("display","none");
if($('#block5').attr('scrollHeight')<= $setBase)$('a.block5').css("display","none");
if($('#block6').attr('scrollHeight')<= $setBase)$('a.block6').css("display","none");
if($('#block7').attr('scrollHeight')<= $setBase)$('a.block7').css("display","none");
if($('#block8').attr('scrollHeight')<= $setBase)$('a.block8').css("display","none");

$(".btnset a").click(function(){
  str = $(this).attr("class");
  str = "#" +str;
	$setHeightMax = $(str).attr('scrollHeight');
	if($setHeightMax <= $setBase){$setHeightMax = $setBase;$minflag=1;}else{$minflag=0;}
	$setHeight = $(str).height();
	$setHeightMax += "px";
	$setHeight += "px";
	

	switch($setHeight){
		case $setHeightMin:
  		$(str).animate({	  width: "300px", height: $setHeightMax  }, 2000, "easeOutCubic" );
			$setHeight = $setHeightMax;
			if(!$minflag)$(this).css("background-image","url(images/top/btn_zoom2.jpg)");
			break;
		case $setHeightMax:
  		$(str).animate({	  width: "300px", height: $setHeightMin  }, 2000, "easeOutCubic" );
			$setHeight = $setHeightMin;
			if(!$minflag)$(this).css("background-image","url(images/top/btn_zoom.jpg)");
			break;
	}
	
	
});
$('#newsbtn').click(function(){
	$('.indexnewsarea2').css("display","none");
	$('.indexnewsarea').css("display","block");
});
});

