


/* ---------- Image Preload Function ---------- */

jQuery.preloadImages = function()
{
	for (var i = 0; i < arguments.length; i++)
	{
		jQuery("<img>").attr("src", arguments[i]);
	}
}



/* ---------- Portal ---------- */

$(document).ready(
	function()
	{
		
		
		// Preload Images
		jQuery.preloadImages("home-images/portal-button-background-1-o.png", "home-images/portal-button-background-2-o.png", "home-images/portal-button-background-3-o.png");
		
		
		// Portal Panel
		jQuery("#portal .portal-panel").each(
			function(i)
			{
				
				jQuery(this).css('display', 'none');
				
			}
		);
		
		
		// Portal Button
		jQuery("#portal .portal-button").hover(
			function(){
				jQuery("#portal .portal-panel").each(
					function(i)
					{
						
						jQuery(this).css('display', 'none');
						
					}
				);
				jQuery("#portal .portal-button").each(
					function(i)
					{
						
						jQuery(this).removeClass('portal-button-selected');
						jQuery(this).animate({ "width": "210px" }, { duration:"fast", easing:"easeOutSine", queue:false } );
						
					}
				);
				jQuery(this).addClass('portal-button-selected');
				jQuery(this).stop();
				jQuery(this).animate({ "width": "345px" }, { duration:"fast", easing:"easeInSine", queue:false });
				jQuery(this).parent().children(".portal-panel").css('display', 'block');
			},
			function(){
			}
		);
		
		
		// Logo Button
		jQuery("#branding-logo").hover(
			function(){
				jQuery("#portal .portal-panel").each(
					function(i)
					{
						
						jQuery(this).css('display', 'none');
						
					}
				);
				jQuery("#portal .portal-button").each(
					function(i)
					{
						
						jQuery(this).removeClass('portal-button-selected');
						jQuery(this).animate({ "width": "210px" }, { duration:"fast", easing:"easeOutSine", queue:false } );
						
					}
				);
			},
			function(){
			}
		);
	}
);

