$(document).ready(function(){
	$(".corner-6px").corner("6px");
	$(".corner-top-6px").corner("top 6px");
	$(".corner-left-6px").corner("left 6px");
});
$(function(){
	$('#list-cat-show li').hover(function(){
		$('#list-cat-show li').removeClass('active');
		$(this).addClass('active');
	},function(){
		$('#list-cat-show li').removeClass('active');
	});
	$('#nav li').hover(function(){
		$(this).find('a').addClass('current');
		$(this).find('ul:first').show();
	},function(){
		$(this).find('ul:first').hide().end().find('a').removeClass('current');
	});
	$('#box-slider-home').mouseover(function(){
		$('.button-slider').fadeIn();
	});
	$('#box-slider-home').mouseleave(function(){
		$('.button-slider').fadeOut();
	});
	/*Control Tab*/
	$('#tabsItems li a').click(function(){
		var c=$(this).attr('id');
		var tmp=c.split('-');
		var n=parseInt(tmp[1]);
		$('#tabsItems li a.tab').removeClass('current');
		$(this).addClass('current');
		$('.tabContent:visible').hide();
		$('#tabitem-'+n).css('display','inline-block');
		return false;
	});
});
$(document).ready(function(){
	var size=$('#photos-slider img').size();
	var rotate=function(active){	
		var c=active.attr('id');
		var tmp=c.split('-');
		var n=parseInt(tmp[1]);
		$('#photos-slider img').removeClass('current').fadeOut(1000);
		active.addClass('current').fadeIn(1000);
		$('.notice:visible').fadeOut(500);
		$('#notice-'+n).fadeIn(1000);
	}; 
	var play=setInterval(function(){
		var active=$('#photos-slider img.current').next();
		if(active.length===0){
			active=$('#img-0');
		}
		rotate(active);
	},5000);
	$('#sl-next').click(function(){
		clearInterval(play);
		var active=$('#photos-slider img.current').next();
		if(active.length==0){
			active=$('#photos-slider img:first');
		}
		rotate(active);
		return false;
	});
	$('#sl-prev').click(function(){
		clearInterval(play);
		var active=$('#photos-slider img.current').prev();
		if(active.length===0){
			active=$('#photos-slider img:last');
		}
		rotate(active);
		return false;
	});
});
function equalHeight(group){
	tallest=0;
	group.each(function(){
		thisHeight=$(this).height();
		if(thisHeight>tallest){
			tallest=thisHeight;
		}
	});
	group.height(tallest);
}
$(document).ready(function(){
	equalHeight($(".col"));
	equalHeight($(".col2"));
	equalHeight($(".col3"));
});
