var obj = null;
	
$(document).ready(function(){	
	$("ul.menu li").hover(function() {		
		var image = ($(this) && $(this).find("img").length) ? true : false;
		var ul = ($(this) && $(this).find("ul").length) ? true : false;
		
		if($(this).find("a").attr("class") != "menuLink active") {
			if(image == false) return;
			$(this).find("img").attr("src", $(this).find("img").attr("src").replace(/\_i.gif$/, '_a.gif'));	
		} 
		
		if (obj) {
			obj.find('ul').fadeOut('fast');	
			obj = null;
		} 
		$(this).find('ul').fadeIn('fast');
		
		if(ul == true) {
			$(this).find('a.menuLink').click(function() {
				return false;
			});
		}
	}, 
		function() {
			var image = ($(this) && $(this).find("img").length) ? true : false;
			var ul = ($(this) && $(this).find("ul").length) ? true : false;
			
			if($(this).find("a").attr("class") != "menuLink active") {
				if(image == false) return;
				$(this).find("img").attr("src", $(this).find("img").attr("src").replace(/\_a.gif$/, '_i.gif'));
			} 	
			
			obj = $(this);
			setTimeout("checkHover()", 500);
		}
	);
	
	$(".readMore").click(function(){
		currentExtended = $(this).parent().parent().children(".newsExtended");
		if (currentExtended.is(":visible")) {			
			$(this).html('Click here to read more.');
			$(this).removeClass('selected');
			currentExtended.slideUp("fast");
		} else {
			$(this).html('Close');
			$(this).addClass('selected');
			currentExtended.slideDown("fast");
		}
		return false;
	});	
});	

function checkHover() {
	if (obj) {
		obj.find('ul').fadeOut('fast');
	} 
	obj = null;
}

function dropDownLink(option){
	//alert(option.options[option.selectedIndex].value);
	if (option.options[option.selectedIndex].value != "none") {
		window.open(option.options[option.selectedIndex].value) ;
	}
}

