$(document).ready (function ()
{
	var jetzt = new Date();
	var Tag_des_Monats = jetzt.getDate();
	
	$(".bilderrechts img, .bilderlinks img").css({ cursor:"pointer"});
	$("div.grossbild").css({position:"absolute", top:"150px"});	
	$(".bilderlinks div.grossbild").css({marginLeft:"100px"});
	$(".bilderrechts div.grossbild").css({marginLeft:"-350px"});

	$("img#fernsehturm_klein").click(function(){
		$("div#fernsehturm").fadeIn("slow");	    
	})
	$("img#stadtpark_klein").click(function(){
		$("div#stadtpark").fadeIn("slow");	    
	})	
	$("img#hafen_klein").click(function(){
		$("div#hafen").fadeIn("slow");   
	})
	$("img#elbe_klein").click(function(){
		$("div#elbe").fadeIn("slow");   
	})
	$("img#alster_klein").click(function(){
		$("div#alster").fadeIn("slow");
	})
	$("img#jenisch_klein").click(function(){
		$("div#jenisch").fadeIn("slow");	    
	})
	$("img#hamburgerdom_klein").click(function(){
		$("div#hamburgerdom").fadeIn("slow");    
	})
	$("img#michel_klein").click(function(){
		$("div#michel").fadeIn("slow");  
	})
	$("img#ballone_klein").click(function(){
		$("div#ballone").fadeIn("slow");  
	})
	$("img#airbusse_klein").click(function(){
		$("div#airbusse").fadeIn("slow");  
	})
	$("img#capsandiego_klein").click(function(){
		$("div#capsandiego").fadeIn("slow");
	})
	
	$("div.grossbild").click(function(){
		$(".bilderrechts div, .bilderlinks div").fadeOut("slow");
    });
	
	
// wie oft wurde die Seite bei FB geteilt:	
	var ajaxurl="http://graph.facebook.com/"+location.href;	
	$.ajax({
		type: 'GET',
		// async: false,   // WICHTIG!
		url: ajaxurl,
		success: function(msg){		
			var rueckgabe_klartext=JSON.parse(msg);
			if(msg && msg!='false') {
				// document.getElementById('navi').innerHTML+=rueckgabe_klartext.shares;			
			} 
			else { 
				// document.getElementById('navi').innerHTML+="---";		// nichts tun	
			}
		}
	});

// bei Facebook eingeloggt?
	
	window.fbAsyncInit = function() {
		FB.init({ appId: '305079842877347', status: true, cookie: true, oauth: true, xfbml: true });  // App WebsiteHamburgrundflug

		FB.getLoginStatus(function(response) {
			if (response.status && (response.status === 'not_authorized' || response.status === 'connected')) { 
				document.getElementById('fbteiler').style.display="inline-block";
				_gaq.push(["_trackEvent", "Startseite", "FB +"]);
			} else {
				_gaq.push(["_trackEvent", "Startseite", "FB -"]);
				document.getElementById('fbteiler').style.display="none";
			}	
		});
	};
	(function(d){ 
		var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
		js = d.createElement('script'); js.id = id; js.async = true;
		js.src = "//connect.facebook.net/en_US/all.js";
		d.getElementsByTagName('head')[0].appendChild(js);
	}(document));	
  	
	
});
