(function($) {	/*	Some functions to enable mtr ;) ...	*/		$.fn.extend({   	//image resizing 'Ajax', php backend	mtrRez: function() {		var width = $(window).width();		var height = $(window).height()-30;		$("#mtrslide").prepend("<div style='position:absolute;' class='loading'></div>").find(".mtrimage").each(function() {			var id = $(this).find("span.mtrtitle").html();			$(this)			.find("img")			.hide()			.attr("src","http://www.mija-t-rosa.com/img/?i=" + id + "&width=" + width + "&height=" + height)			.show();			/*		    if (pageTracker) {				pageTracker._trackEvent('Browserdimensionen', 'resize', $(window).width() + 'x' + $(window).height());			}			*/		});			    }	});		$.fn.extend({   	//image navigation	mtrNav: function() {					var cur = $("#mtrslide .mtrimage:visible");				var next = cur.next(".mtrimage");		if(next.length == 0) {			next = $("#mtrslide .mtrimage:first");		}				var prev = cur.prev(".mtrimage");		if(prev.length == 0) {			prev = $("#mtrslide .mtrimage:last");		}				var nav = $(this).hasClass("prev");		if (nav) {			var slide = prev;		} else {			var slide = next;		}		cur.hide();				var wi = parseInt(slide.find(".mtrwidth").text());		var he = parseInt(slide.find(".mtrheight").text());		if (wi < he) {			$('#mtrslide').css({paddingLeft:"10em"}); // minumum left padding when portrait			} else {			$('#mtrslide').css({paddingLeft:"0"}); // minumum left padding when landscape			}		slide.show();	    }	});		/*	Here comes the mija t. rosa frontend core action	*/	$(document).ready(function(){		$("h1")			.css({cursor:"pointer"})			.click(function() {			window.location.href = "http://www.mija-t-rosa.com/";		});	    // $("#footer").hide(); // we'll use this one later		/*	    if (pageTracker) {			pageTracker._trackEvent('Browserdimensionen', 'einstieg', $(window).width() + 'x' + $(window).height());		}		*/	    // prepare related links	    $(".siblings").find("li:not(:last)").append(" &nbsp; "); // formatting: comma seperating	    $(".langmenu a span").each(function() {			var l = $(this).parent("a").attr("hreflang");			$(this).text(l);	    });			    // resize initially	    if($('#mtrslide .mtrimage').length > 0) { // if mtrslide mtr images exist...			// do a onresize resizing			$(window).resize(function(){				$.fn.mtrRez(); // resize the images			});						$("#wrapper").hide(); // hide all other content			$('#mtrslide .mtrimage').each(function() { // create the images				$(this).prepend("<img src='' />");			});			$.fn.mtrRez(); // resize the images			$('#mtrslide').css({marginTop:"80px"}); // minumum header bar			$("body").css({overflow:"hidden"}); // scrollbars when downsizing window are obstructing proper width/height calculation			$("#mtrslide .mtrimage") // show pointer mouse cursor to indicate the clickability				.css({display:"none",position:"relative"});				$("#mtrslide .mtrimage:first").css({display:"block"})				.each(function(){					var wi = parseInt($(this).find(".mtrwidth").text());					var he = parseInt($(this).find(".mtrheight").text());					if (wi < he) {						$('#mtrslide').css({paddingLeft:"10em"}); // minumum left padding when portrait 					}				});	    }			    var num = $("#mtrslide .mtrimage").index($("#mtrslide .mtrimage:visible")) + 1;		if (!timeTracker) {			var timeTracker = new TimeTracker();			var ttrack = 0;		}	    $("#mtrslide .mtrimage img")			//.attr("title",$(".credits.active:first").text()) //TODO use different attr for the image id			.css({cursor:"pointer"})			.live("click",function() {			$(this).mtrNav();			timeTracker._recordEndTime();						if (pageTracker) {				var text = $(this).parent().find(".mtrimgtitle").text();				ttrack = Math.round(timeTracker._getTimeDiff()/1000);				pageTracker._trackEvent('Imagephotos', 'view', text, ttrack);			}						timeTracker = new TimeTracker();			timeTracker._recordStartTime();	    });	    		/*  put the orderinfo into the textarea */			if($(".orderinfo").length != 0) {				$("textarea[name='your-message']").html($(".orderinfo .imgfororder").text());			}	});})(jQuery);