$(document).ready(function(){

	// alter the attribute on all external links
	$('a.external').attr("target","_blank");
	$('a.external:not(:has(*))').addClass("marked");





	// regions map
	$('select[name=regions]').change(function () {
		var region = $(this).attr('value');
		$('ul.regions li#'+region+' a').focus();
		$('ul.regions li a').removeClass('ie_active');
		$('ul.regions li#'+region+' a').addClass('ie_active');
	});
	$('ul.regions li a').hover(function() {
		$('ul.regions li a').removeClass('ie_active');
		$('ul.regions li a').blur();
		var region = $(this).parent('li').attr('id');
		$('select[name=regions] option[value='+region+']').attr('selected','selected');
	});	
	
	
	// initialise cycling logos
	// hide static
	$('#single_sponsor_logo').css({ display: 'none'});
	   
	$('#sponsor_logos').css({ display: 'block',overflow:'hidden'});
	
	$('#sponsor_logos img').each(function() {
	
	                if (($(this).width())!=0)
	                	$(this).css({marginLeft: ((300-$(this).width())/2)});

	                if (($(this).height())!=0)
				$(this).css({marginTop: ((200-$(this).height())/2)});

	        }); 
	 
	  
	
	$('#sponsor_logos').cycle({ 
	    fx:    'fade', 
	    speed:  2500,
	    random: 1
	 });
	
	
});