
$(document).ready(function() {

if ($("#myIframe")){
		// find current website language
		var lng = document.URL;
		var lngResult = lng.search(/mobile-master.de/);
		if (lngResult == -1){
			// german
			var myHint = "<p id='myHint'><strong>Please wait, while the shopping cart is loading ...</strong></p>";
		} else {
			// english
			var myHint = "<p id='myHint'><strong>Bitte warten, der Warenkorb wird geladen ...</strong></p>";
		}
	
	
		$("#myIframe").hide(); // hide iFrame
		$("#myIframe").before( myHint ); // display loading-hint
	
	
		function makeIframeScrolling (){
		
			var th = $(".csc-text").eq(0).height();
			var thh = $(".csc-text").eq(1).height();			

		
			// hide non used
			$("#additionalContent1").hide();	
			// adjust footer and calculate total-height
			$("#footer1").css( "margin-top", "10px" );
			$("#footer1").css( "margin-bottom", "0px" );
			var footer_height_total = $("#footer1").height()+10;
			// adjust iFrame
			var window_height = $(window).height();
			var iframe_offset_y = $("#myIframe").offset().top;
			var iframe_height_new = window_height - iframe_offset_y - footer_height_total-4 - th - thh;
	
			$("body").height(window_height); // prevent scroll-balken in browser-window		
			if (iframe_height_new < 150){
				iframe_height_new = 150;
			}
			$("#myIframe").height(iframe_height_new);		
		}
	
		$("#myIframe").load(function() {
			$("#myIframe").attr("style", "border: 1px solid silver");
			$("#myIframe").show();
			$("#myHint").hide();		
			makeIframeScrolling();
		});
	
		$(window).resize(function(){
			makeIframeScrolling();
		});
	}

});