$(document).ready(function(){
	
	/* MORE WILL COME */
	if($('#morewillcome').length){
		$('#morewillcome').click(function(){
			$('#morewillcome').css({'display':'none'});
		});
	}
	
	
	/* MORE CONTENT */
	if($('#content-complete').length){
		var ccSpeed = 500;
		$('.content-more').click(function(event){
			event.preventDefault();
			$('#zainoo-overlay').css({'opacity':0,'display':'block','height':$(document).height()});
			$('#content-complete').css({'opacity':0,'display':'block'});
			$('body').append($('#content-complete'));
			
			$('#zainoo-overlay').animate({
				'opacity':0.8
			}, ccSpeed, function() {
			});
			$('#content-complete').animate({
				'opacity':1
			}, ccSpeed, function() {
			});
			window.setTimeout(function() {
				$('html,body').animate({scrollTop: $('#content-country').offset().top-30}, 1000);
			}, 200);
		});
		$('#zainoo-overlay').click(function(){
			$('#zainoo-overlay').animate({
				'opacity':0
			}, ccSpeed, function() {
				$('#zainoo-overlay').css({'display':'none'});
			});
			$('#content-complete').animate({
				'opacity':0
			}, ccSpeed, function() {
				$('#content-complete').css({'display':'none'});
			});
		});
		$('#content-complete-close').click(function(){
			$('#zainoo-overlay').animate({
				'opacity':0
			}, ccSpeed, function() {
				$('#zainoo-overlay').css({'display':'none'});
			});
			$('#content-complete').animate({
				'opacity':0
			}, ccSpeed, function() {
				$('#content-complete').css({'display':'none'});
			});
		});
	}
	/*
	var markers = [];
  	
	var latlng1 = new google.maps.LatLng(45.4370082, 10.9863281);
	var myOptions = {
		zoom: 6,
		minZoom: 5,
		center: latlng1,
		panControl: false,
		zoomControl: true,
		streetViewControl: false,
		zoomControl: true,
		zoomControlOptions: {
			style: google.maps.ZoomControlStyle.LARGE,
			position: google.maps.ControlPosition.LEFT_CENTER
		},
		scaleControl: false,				
		scrollwheel: false,
		mapTypeId: google.maps.MapTypeId.TERRAIN
    };
    var map = new google.maps.Map(document.getElementById("location-map"),myOptions);

	google.maps.event.addListener(map, 'zoom_changed', function() {
	    zoomLevel = map.getZoom();
		if(zoomLevel > 8){
			map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
		}else{
			map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
		}
		
		$.each(markers, function(index, element){
      if(element[0]<=zoomLevel && (!element[2] || element[2]>=zoomLevel)) {
        element[1].setVisible(true);
      } else {
        element[1].setVisible(false);
      }
    }); 
	});

	// markers
	function setNewMarker(point){
	  point.icon = point.icon ? point.icon : 'icon-poi.png';
		var image = new google.maps.MarkerImage('/images/map/'+point.icon,
		      new google.maps.Size(22, 26),
		      new google.maps.Point(0,0),
		      new google.maps.Point(11, 26));
		  var shadow = new google.maps.MarkerImage('/images/map/icon-shade.png',
		      new google.maps.Size(32, 20),
		      new google.maps.Point(0,0),
		      new google.maps.Point(8, 20));

		var visible = false;
		
		if(point.zoom<=6) {
       visible = true;
    } 
    
    var marker = new google.maps.Marker({
			map: map,
			position: new google.maps.LatLng(point.x, point.y),
			visible: visible,
			shadow: shadow,
			icon: image,
			title: point.name
		});
		
		markers.push([point.zoom,marker,point.until]);

		var boxText = document.createElement("div");
		boxText.style.cssText = "padding: 15px 15px 0 60px; color:#fff;";
		boxText.innerHTML = "<h3>"+point.name+"</h3><h4>"+point.type+'</h4><a href="'+point.link+'">Details anzeigen</a>';

		var myOptions = {
			content: boxText
			,disableAutoPan: false
			,maxWidth: 0
			,pixelOffset: new google.maps.Size(0, -70)
			,zIndex: null
			,boxStyle: { 
				background: "url('/images/map/map-label.png') no-repeat"
				,opacity: 0.98
				,width: "350px"
				,height: "122px"
			}
			,closeBoxMargin: "-12px -2px 0 0"
			,closeBoxURL: "/images/map/map-label-close.png"
			,infoBoxClearance: new google.maps.Size(1, 1)
			,isHidden: false
			,pane: "floatPane"
			,enableEventPropagation: false
		};

		google.maps.event.addListener(marker, "click", function (e) {
			ib.open(map, this);
		});
		var ib = new InfoBox(myOptions);
	}
	
  if(typeof map_options != 'undefined') {
    $.each(map_options.points, function(index, point) {
        setNewMarker(point);
    });
    
	}



*/


	
	
		/* MAPS 
		function initialize() {
			if (GBrowserIsCompatible()) {
		  		var map = new GMap2(document.getElementById("location-map"));
				map.setCenter(new GLatLng(45.4370082, 10.9863281), 6);
				map.setMapType(G_PHYSICAL_MAP);
				//G_PHYSICAL_MAP
				//map.setUIToDefault();
				//map.addControl(new GSmallZoomControl3D());
				//map.enableRotation();
				map.disableScrollWheelZoom();
				map.enableDoubleClickZoom(); 
				
			
				zoomControl = new MZoomControl({
					background:'#1c1b1b',
					foreground:'#5aaa25',
					direction:'V',
					position:new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(70, 210)),
					validValues: [5,6,7,8,9,10,11,12,13,14,15,16,17,18]
				});
				map.addControl(zoomControl);

				var tinyIcon = new GIcon();
				tinyIcon.image = "http://www.google.com/mapfiles/marker.png";
				tinyIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
				tinyIcon.iconSize = new GSize(20, 34);
				tinyIcon.shadowSize = new GSize(37, 34);
				tinyIcon.iconAnchor = new GPoint(10, 34);
				tinyIcon.infoWindowAnchor = new GPoint(5, 1);
				var point = new GLatLng(45.4370082, 10.9863281);
				var html= '<p></p>';
				var marker = new GMarker(point, tinyIcon);
				GEvent.addListener(marker, "click", function(){
					marker.openInfoWindowHtml(html);
				});
				map.addOverlay(marker);
			}
		}
		initialize();*/
	
});
