
jQuery.noConflict();

jQuery(document).ready(function() {
	//Google maps
	initialize();
}); 


jQuery(window).load(function(){
    
    /* Opacity bars height fix */
    jQuery(window).resize( function()
    {
		bodyHeightFix();
    });

    // trigger onLoad
    bodyHeightFix();

    // Fancybox
    jQuery('.fancy').fancybox();
    
    // and fancybox on images marked as lytebox by the CMS
    jQuery('a[rel*="group"]').fancybox();
});

/**
 * Google Maps
 */
var map = null;
var markers = [];

function initialize() {
	//Check if map_canvas exist else dont show map
	if (document.getElementById("map_canvas") != null) {

		// Creating a LatLng object containing the coordinate for the center of the map  
		var latlng = new google.maps.LatLng(52.078284, 4.621846);  
		// Creating an object literal containing the properties we want to pass to the map  
		var options = {  
		  	zoom: 15,  
		    center: latlng,  
		    mapTypeControl: false,
		    mapTypeId: google.maps.MapTypeId.ROADMAP,  
		    navigationControl: false,
		    streetViewControl: false 
		};  
		// Calling the constructor, thereby initializing the map  
		var map = new google.maps.Map(document.getElementById('map_canvas'), options);  

		var marker = new google.maps.Marker({  
			position: new google.maps.LatLng(52.077834,4.624407),  
			map: map
		});

	}
}


/**
 * Fix body height
 */
var bodyHeightFix = function ()
{
    var bodyHeight = jQuery('body').height();
    var windowHeight = jQuery(window).height();
    if(bodyHeight > windowHeight) // if viewport is too small
    {

	//jQuery('body').css({overflow: 'hidden'});
	jQuery('div#barcontainer, div#background').height((bodyHeight+4));

    }
    else
    {
	jQuery('body').css({overflow: 'normal'});
	jQuery('div#barcontainer, div#background').height((windowHeight));
	jQuery('body').height((windowHeight));

    }

}
