$(document).ready(function(){


$(".grouped_elements").fancybox({'titleShow' : false});

$(".iframe").fancybox({
        'autoScale'     	: true,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow' 		: false
	});


function formatText(index, panel) {
		  return index + "";
	    }
    
$(function () {

    $('.anythingSlider').anythingSlider({
        easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
        delay: 5000,                    // How long between slide transitions in AutoPlay mode
        startStopped: false,            // If autoPlay is on, this can force it to start stopped
        animationTime: 1600,             // How long the slide transition takes
        hashTags: true,                 // Should links change the hashtag in the URL?
        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
        stopText: "Stop",               // Stop text
        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
    });
    
    $("#slide-jump").click(function(){
        $('.anythingSlider').anythingSlider(6);
    });
    
});


//functie voor opensliden van submenu
$('.sidebar ul li:has("ul")').find('ul').hide();
$('.sidebar ul li:has("ul")').find('a:first').attr('href','javascript:void()');
$('.sidebar ul li:has("ul")').find('a:first').click (function (){ 
			$(this).parent('li').find('ul:first').slideToggle();		 
		 });


$('.sidebar ul li:has("ul")').each(function(){
	
	if($(this).hasClass('has_current'))
	{
		$(this).find('ul:first').slideToggle();
	}
	
});



});


	
	


$(document).ready(function(){

if(jQuery("#map_canvas").length != 0)
{
		var geocoder;
  		var map;
  		
  		function initialize() {
	    	geocoder = new google.maps.Geocoder();
	    	var latlng = new google.maps.LatLng(-34.397, 150.644);
	    	var myOptions = {
	      		zoom: 12,
	      		center: latlng,
	      		mapTypeId: google.maps.MapTypeId.ROADMAP
	    		}
	    	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  		} 		

		initialize();			
   		codeAddress();  
   		
   		
}

function codeAddress() 
{
    var address = 'Brugstraat 44, Nederweert';
    var image = new google.maps.MarkerImage('http://restaurantdiverso.getnoticed.nl/system/gncms/themes/default/img/beachflag.png',
      // This marker is 20 pixels wide by 32 pixels tall.
      new google.maps.Size(30, 55),
      // The origin for this image is 0,0.
      new google.maps.Point(0,0),
      // The anchor for this image is the base of the flagpole at 0,32.
      new google.maps.Point(25, 36));
  	var shadow = new google.maps.MarkerImage('http://restaurantdiverso.getnoticed.nl/system/gncms/themes/default/img/beachflag_shadow.png',
      // The shadow image is larger in the horizontal dimension
      // while the position and offset are the same as for the main image.
      new google.maps.Size(34, 25),
      new google.maps.Point(0,0),
      new google.maps.Point(0, 25));

    
    if (geocoder) 
    {
      	geocoder.geocode( { 'address': address}, function(results, status) 
      	{
        	if (status == google.maps.GeocoderStatus.OK) 
        	{
          		map.setCenter(results[0].geometry.location);
          		var marker = new google.maps.Marker({
              		map: map, 
              		position: results[0].geometry.location,
              		shadow: shadow,
              		icon: image
          		});
        	} 
        	else 
        	{
          		alert("Geocode was not successful for the following reason: " + status);
        	}
      	});
    }
}

});
