this.tooltip = function(){	
	/* CONFIG */		
		xOffset = -20;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */
	


	$("span.tooltip").hover(function(e){
		this.id = $(this).children("span").attr('id');

		this.t = $("span.tooltip span#" + this.id).html();									  
		$("body").append("<div id='tooltip'>"+ this.t +"</div>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		$("#tooltip").remove();
    });	
	$("span.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function() {

	$("a.fancy").fancybox({
		'padding'               : 6,                //Space between FancyBox wrapper and content
		'margin'                : 0,                //Space between viewport and FancyBox wrapper
		'autoScale'             : false,              //If true, FancyBox is scaled to fit in viewport
		'autoDimensions'        : false,              //For inline and ajax views, resizes the view to the element recieves. Make sure it has dimensions otherwise this will give unexpected results
		'overlayOpacity'        : 0.9,               //Opacity of the overlay (from 0 to 1; default - 0.3)
		'overlayColor'          : '#fbfaf5',            //Color of the overlay
		'titlePosition'         : 'inside',            //The position of title. Can be set to 'outside', 'inside' or 'over'
		'transitionIn'          : 'fade',         //The transition type. Can be set to 'elastic', 'fade' or 'none'
		'transitionOut'         : 'fade',         //The transition type. Can be set to 'elastic', 'fade' or 'none'
		'speedIn'               : 200,               //Speed of the fade and elastic transitions, in milliseconds
		'speedOut'              : 200,               //Speed of the fade and elastic transitions, in milliseconds
		'changeSpeed'           : 200               //Speed of resizing when changing gallery items, in milliseconds
	});

	$(".fancy_map").fancybox({
		'padding'               : 6,                //Space between FancyBox wrapper and content
		'margin'                : 0,                //Space between viewport and FancyBox wrapper
		'centerOnScroll'        : false,             //When true, FancyBox is centered while scrolling page
		'overlayShow'           : true,              //Toggle overlay
		'overlayOpacity'        : 0.2,               //Opacity of the overlay (from 0 to 1; default - 0.3)
		'overlayColor'          : '#000',            //Color of the overlay
		'titleShow'             : false,              //Toggle title
		'titlePosition'         : 'over',            //The position of title. Can be set to 'outside', 'inside' or 'over'
		'titleFormat'           : null,              //Callback to customize title
		'transitionIn'          : 'fade',         //The transition type. Can be set to 'elastic', 'fade' or 'none'
		'transitionOut'         : 'fade',         //The transition type. Can be set to 'elastic', 'fade' or 'none'
		'speedIn'               : 200,               //Speed of the fade and elastic transitions, in milliseconds
		'speedOut'              : 200,               //Speed of the fade and elastic transitions, in milliseconds
		'changeSpeed'           : 200,               //Speed of resizing when changing gallery items, in milliseconds
		'showCloseButton'       : true,              //Toggle close button
		'showNavArrows'         : true,              //Toggle navigation arrows
		'enableEscapeButton'    : true              //Toggle if pressing Esc button closes FancyBox
	});

	$(".select").selectbox();

	tooltip();

});



function langalert(lang) {
	if ( lang == 'en') {
		alert('This website is under construction!\nPlease visit later!');
	}
	if ( lang == 'de') {
		alert('Unser Site ist gerade in Entwicklung!\nBitte besuchen Sie uns später wieder.');
	}
}

