
function responsiveInit() {

	/*
var pageWidth = $(window).width();
	if(pageWidth<=480) {
		$("#innerBody").addClass("mobile");		
		$("#superbgimage").addClass("mobile");		
		$("#innerBody").removeClass("desktop");		
	} else {
		$("#innerBody").addClass("desktop");		
		$("#innerBody").removeClass("mobile");		
		$("#superbgimage").removeClass("mobile");		
	}
*/

}




$(document).ready(function() {
		
		responsiveInit();
		//	responsiveInit();
		$(window).resize(function() {
			responsiveInit();
		});

		$("#logo").animate({"opacity":1,"marginLeft":0}, { duration: 1000, easing: "linear", queue: false} );




/* too slow atm */
/*		$("#gallery").animate({"opacity":1,"marginLeft":0}, { duration: 1000, easing: "linear", queue: false} ); */
/*
		$("#gallery").animate({"opacity":0}, 125, "linear", function() {
			$("#gallery").animate({"opacity":1,"marginLeft":0}, 125, "linear", function() {
				$("#upperContent").animate({"marginTop":-312}, { duration: 500, easing: "linear", queue: false} );
				$("#lowerContent").animate({"marginTop":12}, { duration: 500, easing: "linear", queue: false} );
			});
		});
*/
		var myloc = String(document.location);
		if ( myloc.search(/pages\/de\/.+/) != -1 ) { mfcurrentlanguage="de";	}
		if ( myloc.search(/pages\/en\/.+/) != -1 ) { mfcurrentlanguage="en";	}
		if ( myloc.search(/pages\/fr\/.+/) != -1 ) { mfcurrentlanguage="fr";	}

		$('#logo').bind("click", function() {
 			document.location = "/pages/"+mfcurrentlanguage+"/home";
 		});


// DISABLE accidental selection of text except for contact pages
/*

	if (  myloc.search(/blumenversand\/.+/) == -1 && myloc.search(/mf\/.+/) == -1 &&  myloc.search(/kontakt\/.+/) == -1 && myloc.search(/contact\/.+/) == -1 ) { 

		if (typeof document.onselectstart!="undefined") {
			document.onselectstart=new Function ("return false");
		}else{
			document.onmousedown=new Function ("return false");
			document.onmouseup=new Function ("return true");
		}
	}
*/



	// enable App-Like Behaviour on iPad
	var deviceAgent = navigator.userAgent.toLowerCase();
	var iOSdetected = deviceAgent.match(/(iphone|ipod|ipad)/);
	
	if(iOSdetected) {
		$('a').bind("click", function() {
			if (($(this).attr("href")!="#") && ($(this).attr("href").search(/javascript.+/) == -1 )) {
				var oldref = $(this).attr("href");
				$(this).attr("href","javascript:document.location='"+oldref+"';");
			}
		});
	}

	
	$('.subMenu ul.navi li.inactive, #navigation ul.navi li.inactive, #subnavigation ul.navi li.inactive').bind("mouseenter", function() {
		var self = this;
		$(self).find("a").animate({"color":"#fff"}, { duration: 125, easing: "linear", queue: false} );
	}).bind("mouseleave", function() {
		var self = this;
		$(self).find("a").animate({"color":"#666"}, { duration: 125, easing: "linear", queue: false} );
	});


	


	$('#siteservice').bind("mouseenter", function() {
		var self = this;
		$(self).find("img").animate({"opacity":1}, { duration: 125, easing: "linear", queue: false} );
	}).bind("mouseleave", function() {
		var self = this;
		$(self).find("img").animate({"opacity":.5}, { duration: 125, easing: "linear", queue: false} );
	});


	$('#thumbs a:not(.activeslide)').bind("mouseenter", function() {
		var self = this;
		$(self).find("img").animate({"opacity":1}, { duration: 250, easing: "linear", queue: false} );
	}).bind("mouseleave", function() {
		var self = this;
		$(self).find("img").animate({"opacity":.5}, { duration: 250, easing: "linear", queue: false} );
	});








});
