$(document).ready(function() {

$(function() {

	$('#foto_slide').cycle({ 
   		 fx:   'shuffle', 
    shuffle: { 
        top:  -40, 
        left:  280 
    }, 
	});


});

function formatText(index, panel) {
		  return index + "";
	    }
    
	$(function () {
	        
	            $('.anythingSlider').anythingSlider({
	                easing: "easeInOutCubic",        // Anything other than "linear" or "swing" requires the easing plugin
	                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
	                delay: 3000,                    // How long between slide transitions in AutoPlay mode
	                startStopped: false,            // If autoPlay is on, this can force it to start stopped
	                animationTime: 1000,             // 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);
	            });
	            
	});


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: 15,
	      		center: latlng,
	      		mapTypeId: google.maps.MapTypeId.ROADMAP
	    		}
	    	map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  		} 		

		initialize();			
   		codeAddress();  
   		
   		
}


function codeAddress() 
{
    var address = 'Heinsbergerweg, Posterholt';
    var image = new google.maps.MarkerImage('/peeweeposterholt.nl/img/beachflag.png',
      // This marker is 20 pixels wide by 32 pixels tall.
      new google.maps.Size(27, 50),
      // 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(5, 45));
  	var shadow = new google.maps.MarkerImage('/peeweeposterholt.nl/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(44, 26),
      new google.maps.Point(0,0),
      new google.maps.Point(0, 20));

    
    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);
        	}
      	});
    }
}

});

	
