$(function() {
	$('#imagemap > img').maphilight({fillColor:'000000',fillOpacity: 0.4, strokeColor: '000000',strokeWidth: 2});
		addTagsToAreas();
		$('.highlighted').cluetip({sticky: true
		,closePosition: 'title'
		,closeText: '<img src="images/cluetip/cross.png" alt="" />'
		,local: true
		,showTitle: true
		,titleAttribute: 'poptitle'
		,attribute: 'popbody'
		,hideLocal:        true
		,hoverIntent: {    
                      sensitivity:  3,
                      interval:     500,
                      timeout:      0}
		,fx: {             
							  open:       'fadeIn', // can be 'show' or 'slideDown' or 'fadeIn'
							  openSpeed:  ''
			}
		,topOffset: 50
	  });
	});

function addTagsToAreas(){
		jQuery('area').each(function(el) {
		var country = jQuery(this).attr('ALT');
		var countryFull = jQuery('#'+country+'content').attr('title');
		if (countryFull == undefined){var countryFull = jQuery('#eucontent').attr('title');
		jQuery(this).addClass('highlighted').attr('title', countryFull).attr('poptitle','<img width="40px" src="images/flags/' + country + '.gif" /> ' + countryFull).attr('popbody','#eucontent');
		}
else {
		jQuery(this).addClass('highlighted').attr('title', countryFull).attr('poptitle','<img width="40px" src="images/flags/' + country + '.gif" /> ' + countryFull).attr('popbody','#' + country + 'content');
};
		});
	}

