/*
	Author: Joe Tan (joetan54@gmail.com)
*/
// rotate the 6 main feature photos on the homepage
jQuery(function($) {

	$('#banner .profile').hover(function() { //.css('opacity', 0.7)
		if ($(this).hasClass('selected')) return;
		
		$('#banner').data('timer', setTimeout('showInfo()', 500))
		$(this).addClass('hover').siblings().removeClass('hover');
		//$(this).animate({opacity:0.99})
	}, function() {
		if ($('#banner').data('timer')) {
			clearTimeout($('#banner').data('timer'))
		}
		if ($(this).hasClass('selected')) return;
		//$(this).animate({opacity:0.7})
	}).click(function() {
		window.location=$(this).find('a:first').attr('href');
		return false;
	});
	var rand = Math.floor(Math.random()*6);
	$('#banner .profile').eq(rand).mouseover();
});

function showInfo() {
	var profile = $('#banner .profile.hover');
	if ($(profile).hasClass('selected')) return;
	
	profile.addClass('selected').siblings().removeClass('selected');//.animate({opacity:0.7})
	$('#banner .info').hide().html(profile.html()).fadeIn('fast');

}