// JavaScript Document

(function($) {
$(document).ready(function() { 
	
	$('.childList').hide();
	
	$('.parentList li').each(function(index) {
		var xw = $(this).find('.topLevel').width();
		xw = xw+25;
		w = $(this).width();
		
		if(w>200) {
			w = 150;
		}
		
		$(this).children('div').css('width',xw); 
	});
	
	
	$('.parentList > li').bind('mouseover', openSubMenu);
	$('.parentList > li').bind('mouseout', closeSubMenu);
	
	function openSubMenu() { 
		$(this).find('.childList').show(); 
		$(this).find('.topLevel').addClass('visible'); 
	};
	
	function closeSubMenu() { 
		$(this).find('.childList').hide();
		$(this).find('.topLevel').removeClass('visible'); 
	}; 
	
	
	
	$('.newsRight p').hide(); 
	
	$('.newsRight').delay(500).vTicker({
	   speed: 600,
	   pause: 4500,
	   showItems: 1,
	   animation: 'fade',
	   mousePause: false,
	   height: 0,
	   direction: 'up'
	});
	
	$('.tile > #promo').bind('mouseover', imageSwapF);
	$('.tile > #promo').bind('mouseout', imageSwapB);
	
	function imageSwapF() { 
		$(this).find('#og').hide();
		$(this).find('#ho').show();
	};
	
	function imageSwapB() { 
		$(this).find('#ho').hide();
		$(this).find('#og').show();
	};
	
})
})(jQuery);
