
	
		jQuery(document).ready(function() {
			
			jQuery("#kartta AREA").mouseover(function(){
				var regionMap = '.'+$(this).attr('id')+'-map';
				var regionList = '.'+$(this).attr('id')+'-nimi';
				
				jQuery(regionMap).css('display', 'inline');

				// Check if a click event has occured and only change the Region hover state accodringly
				if (! jQuery('#tiedot ul').hasClass('selected')) {
					jQuery(regionList).css('display', 'inline');
				}
			}).mouseout(function(){
				var regionMap = '.'+$(this).attr('id')+'-map';
				var regionList = '.'+$(this).attr('id')+'-nimi';

				// Check if a click event has occured and only change the Region hover state accodringly
				if (! jQuery(regionMap).hasClass('selected')) {
					jQuery(regionMap).css('display', 'none');
				}

				// Check if a click event has occured and only change the Region hover state accodringly
				if (! jQuery('#tiedot ul').hasClass('selected')) {
					jQuery(regionList).css('display', 'none');
				}
			});
			
			

			jQuery("#kartta AREA").click(function(){
				jQuery('#kartta img.region').removeClass('selected').css('display', 'none');
				jQuery('#tiedot ul').removeClass('selected').css('display', 'none');
				jQuery('#tiedot1 ul').removeClass('selected').css('display', 'none');
				
				var regionMap = '.'+$(this).attr('id')+'-map';
				var regionList = '.'+$(this).attr('id')+'-list';
				
				jQuery(regionMap).addClass('selected').css('display', 'inline');
				jQuery(regionList).addClass('selected').css('display', 'inline');
				
			});

		});
		
	$(document).ready(function()
{
   // Use the each() method to gain access to each elements attributes
   $('area').each(function()
   {
      $(this).qtip(
      {
         content: $(this).attr('name'), // Use the ALT attribute of the area map
         style: {
            name: 'light', // Give it the preset dark style
            border: {
               width: 0, 
               radius: 2 
			   
            }, 
            tip: true // Apply a tip at the default tooltip corner
         }
      });
   });
});

