function find_link_hover_in(jq_obj) {
	jq_obj.find('a').css('color','#cc0000').animate({'color': '#000000'}, {duration: 400, queue: false});
}
function find_link_hover_out(jq_obj) {
	jq_obj.find('a').animate({'color': '#cc0000'}, {duration: 400, queue: false});
}

$(document).ready(function(){
	// stadspromotie banners
	$('.hStadspromotieBanner').css({'cursor': 'pointer'});
	
	$('.hStadspromotieBanner').hover( 
		function() {
			find_link_hover_in($(this));
			////$(this).find('a').addClass('hStadspromotieBannerJqHover');
		},
		function() {
			 find_link_hover_out($(this));
			////$(this).find('a').removeClass('hStadspromotieBannerJqHover');
		}
	);
	
	if(1==2) {
		$('.hStadspromotieBanner').live('mouseover', function(event) {
			$(this).find('a').addClass('hStadspromotieBannerJqHover');
		});
		$('.hStadspromotieBanner').live('mouseout', function(event) {
			$(this).find('a').removeClass('hStadspromotieBannerJqHover');
		});
	}
	$('.hStadspromotieBanner').live('click', function(event) {
		window.open($(this).find('a').attr("href"), $(this).find('a').attr("target"));return false;
		//window.location = $(this).find('a').attr("href");return false;
	});
	// nieuwsitems in uitgelicht
	$('.hNieuwsItem').css({'cursor': 'pointer'});
	$('.hNieuwsItem').live('click', function(event) {
		window.open($(this).find('a').attr("href"), $(this).find('a').attr("target"));return false;
		//window.location = $(this).find('a').attr("href");return false;
	});
	$('.hNieuwsItem').live('mouseover', function(event) {
		//$(this).find('a').addClass('hStadspromotieBannerJqHover');

	});
	$('.hNieuwsItem').live('mouseout', function(event) {
		//$(this).find('a').removeClass('hStadspromotieBannerJqHover');

	});
	// Descendant Selector
	$('.hNieuwsItem').hover( 
		function() {
			$(this).css('background-color', '#FFF2BC').animate({'background-color': '#feeeab'}, {duration: 400, queue: false});
			//$(this).find('a').css('color','#cc0000').animate({'color': '#000000'}, {duration: 400, queue: false});
			find_link_hover_in($(this));
			//$(this).css('color','#000000').animate({'color': '#cc0000'}, {duration: 400, queue: false});
		},
		function() {
			$(this).animate({'background-color': '#FFF2BC'}, {duration: 400, queue: false});
			//$(this).find('a').animate({'color': '#cc0000'}, {duration: 400, queue: false});
			find_link_hover_out($(this));
			
			//$(this).animate({'color': '#000000'}, {duration: 400, queue: false});
		}
	);
	// Banners
	$('.hBannerItem').hover( 
		function() {
			$(this).css('background-color', '#FFF2BC').animate({'background-color': '#feeeab'}, {duration: 400, queue: false});
			find_link_hover_in($(this));
		},
		function() {
			$(this).animate({'background-color': '#FFF2BC'}, {duration: 400, queue: false});
			find_link_hover_out($(this));
		}
	);
	// links in li's
	$('li > a').hover(
		function() {
			$(this).css('color','#cc0000').animate({'color': '#000000'}, {duration: 400, queue: false});
		}, 
		function() {
			$(this).animate({'color': '#cc0000'}, {duration: 400, queue: false});
		}
	);
});
