/**
 * @author adam
 */

$(document).ready(function() {
	
	var isIE = ($.browser.msie && parseInt($.browser.version.substr(0,1)) < 8);
	
	$('#explore_link').click(function() {
		
		$('#home_banner').css('zIndex', '40');
		
		$('#wrapper').append("<div id=\"home_overlay\"></div>");
		if (isIE) {
			$('embed, object, select').hide();
			$('#home_banner').css('background', 'url(images/banner.jpg) no-repeat top #fff');
		}
		$('#home_overlay').css('opacity', '0.7').fadeIn(500, function() {
			$('#home_banner').css('zIndex', '100').animate({
				"height" : "555px"
			}, 500);
			
			$('#home_banner_content').css('top', '250px');
			
			$.scrollTo('#main_menu', 800);
			
			$('#home_banner a#close').fadeIn(1000);
			$('#explore_link').hide();
		});
	});
	
	$('#home_banner a#close').click(function() {
		
		$('#home_banner_content').css('top', '280px');
		
		$('#home_banner').animate({
			"height" : "287px"
		}, 500, function() {
			if (isIE) {
				$('embed, object, select').show();
				$('#home_banner').css('background', '#fff');
			}
			
			$('#home_overlay').fadeOut(500, function() {
				$('#home_overlay').remove();
				
			});
			
			$('#explore_link').fadeIn(1000);
			$('#home_banner a#close').hide();
			
			$('#home_banner').css('zIndex', '1');
		});
		
		
	});
	
});
