// Create the tooltips only when document ready
$(document).ready(function()
{
	//Gestion de la traduction du message lorsqu'il n'y a aucun camping dans une
	// zone de la Map.
	var langue = $('img.imageMap').attr('id');
	var tab = {
			'fre-FR':'Le site n\'a trouvé aucun camping en', 
			'eng-US': 'The site did not find any campsites in'
	};
	var message_defaut = tab['eng-US'];
	var message = "";
	if(tab[langue] == null){
		message = message_defaut;
	}
	else{
		message = tab[langue];
	};
	
	// Use the each() method to gain access to each elements attributes
	$('area.zero_camping').each(function()
	{
		$(this).qtip(
		{
			// Use the ALT attribute of the area map
			content: {
				text: message + ' ' + $(this).attr('alt'),
				title: {
					button: 'Close'
				}
			},
			position: {
				corner: {
					target: 'center',
					tooltip: 'bottomLeft'
				},
				adjust: {
					screen: true
				}
			},
			show: {
				delay: 0,
				when: 'click',
				solo: true
			},
			hide: {
				delay: 0,
				when: {
					event: 'inactive'
				},
				delay: 2000
			},
			style: {
				name: 'light', // dark style or : cream, green, light, red, blue
				border: {
					width: 0,
					radius: 4
				},
				tip: true // Apply a tip at the default tooltip corner
			}
		});
	});
});

