// JavaScript Document
  var stockholm = new google.maps.LatLng(51.91624, 4.49915);
  var parliament = new google.maps.LatLng(51.91624, 4.49915);
  var marker;
  var map;


$(document).ready(function(){

	$('#headerrotator').show();												 
	$('#headerrotator').innerfade({
			speed: 'slow',
			timeout: 4000,
			type: 'sequence',
			containerheight: '220px'
	});


	if($('#map_canvas').attr('id')){
	 initialize();
	}

});


  function initialize() {

    var mapOptions = {
      zoom: 13,
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      center: stockholm
    };

    map = new google.maps.Map(document.getElementById("map_canvas"),
            mapOptions);
          
    marker = new google.maps.Marker({
      map:map,
      draggable:true,
      animation: google.maps.Animation.DROP,
      position: parliament
    });
    google.maps.event.addListener(marker, 'click', toggleBounce);
  }

  function toggleBounce() {

    if (marker.getAnimation() != null) {
      marker.setAnimation(null);
    } else {
      marker.setAnimation(google.maps.Animation.BOUNCE);
    }
  }


