		var checkFn;
		var zoomInitDist = 5;
		
		
		var isSliding=false;
		
		$(document).ready(function() {		
		
//    	$("#link_nextArticleTop").hide();
//    	$("#link_nextArticleTop").after("<div class='linusslide_re'>"+$("#link_nextArticleTop").html()+"</div>");
  		
  		$(window)._scrollable();
  		
			
		//SLIDE TO NEW DIV HEIGHT
			function slideIn(newHeight) 
      {
        newHeight = $("#body").height()+30;
        //alert("#body: "+$("#body").height());
        //alert($("#product_img").attr('src'));
		
		//$("#product_img").load(function() {
        //alert($(this).height());
        //alert($(this).width());
    //});
		
        $("#ktmask").animate({"height": newHeight},800);
			};
		
		//SLIDE TO NEW DIV HEIGHT - INIT ON LOAD
			var newHeightStart = $("#body").find(".bg").height();
			slideIn(newHeightStart);
		
		// RESET ON NEW ITEM
			function resetImgBig() {
			 return;
			
			$('#product_img').css('height','400px');
			
				var offset = $(window).scrollTop();
				var newItem = document.getElementById("body");
				//var zoomImg = $(newItem).find('#anzugBig img');
				var zoomImg = $('#product_img');
				
				var h = $(zoomImg).height();
			 	//alert(h);
			 	if (h > 401) {
			 	 //$('#product_img').animate({"height": 400, "margin-left": 0}, "slow");

/*			 		setZoom();
					var small = $(zoomImg).attr("small");
					var orgL = $(zoomImg).attr("orgL");
  					$(zoomImg).animate({"height": small, "margin-left": orgL}, "slow");
  					$(newItem).find(".styleTipp").animate({"opacity": "0"}, "slow", function() {
    					$(newItem).find(".styleTipp").css("display", "none");
  					});
*/  					
  				};	
			};			

	
		
			
		//SLIDE FUNCTION	
			function gotoToSlide(nextSlide, rightSlide) {
//console.debug("gotoToSlide(%s,%s)",nextSlide,rightSlide);
				//BESSER MACHEN... ODER ZURÜCK ZU 0 ETC
				if(mainMenuCount == nextSlide) return;
				//if(mainMenuCount-1 < 0) return;
				
				if(rightSlide==undefined) {rightSlide = true;}
				
				isSliding = true;
				
				var going = document.getElementById("body");
				var coming = document.getElementById("comingItem");
				
				mainMenuCount = nextSlide;
				var nextLink = mainMenuIndex[mainMenuCount]+' #body > *';
				
        			
				$(coming).load(nextLink, function() {
//alert(this.id+this.outerHTML);

					$.scrollTo(0);
				
					
          resetImgBig();
          					
					if (rightSlide) 
          {
					
						var checkPos = $(coming).position();						
//console.debug("rightSlide: checkPos.left ",checkPos.left);
						if (checkPos.left < 870) 
            {
							var newPos = checkPos.left+880*2;
							$(coming).css("left", newPos);
						};
						$(going).animate({"left": "-=880" }, "slow");
						$(coming).animate({"left": "-=880" }, "slow", function() {
							 $(going).css("position", "absolute");
							 swapDivIdAfterSlide(going,coming);
  					});
  					
					} 
          else 
          {
						var checkPos = $(coming).position();
//console.debug("leftSlide: checkPos.left ",checkPos.left);
						if (checkPos.left > (-870)) 
            {
							var newPos = checkPos.left-(880*2);
							$(coming).css("left", newPos);
						};
						$(going).animate({"left": "+=880" }, "slow");
						$(coming).animate({"left": "+=880" }, "slow", function() {
							 $(going).css("position", "absolute");
							 swapDivIdAfterSlide(going,coming);
  					});
  					
					};
					
		      updateMenuHighlight(nextSlide);
		      initKTDetails();
					
				});
				
			};
			

			function swapDivIdAfterSlide(going,coming) {
  			$(going).attr("id","comingItem");
				$(coming).attr("id","body");		

        isSliding = false;        
        slideIn();					
			};
			
//			$("#li").click(function(){		
/*
			$(".linusslide_li").click(function(){
			  // endless slide
				if(mainMenuCount-1 < 0) mainMenuCount = mainMenuIndex.length;
				//process sliding
				if (isSliding) return;
				var newSlide = mainMenuCount-1;
				gotoToSlide(newSlide, false);
			});

*/			
//			$("#re").click(function(){
/*
			$(".linusslide_re").click(function(){
			  // endless slide
				if(mainMenuCount+1 > mainMenuIndex.length-1) mainMenuCount = -1;
				//process sliding
				if (isSliding) return;
				var newSlide = mainMenuCount+1;
				gotoToSlide(newSlide);
			});
			
	*/		
			
			function updateMenuHighlight(nextSlide)
			{
        //alert(mainMenuTOC+" "+document.location);
        for (var i=0; i<mainMenuTOC.length; i++)
        {
          if (mainMenuTOC[i] > nextSlide)
          {
            $('ul.menue').find('a').attr('class','');
            //alert($('a[id="root'+(i+1)+'"]').html());
            var currentItem = $('a[id="root'+(i+1)+'"]');
            currentItem.attr('class','exp');
            
            //attr('class'));
            break;
          };
        };
       
       //alert(mainMenuIndex[1]+" < "+nextSlide+" # "+mainMenuIndex.indexOf(nextSlide));
			 
			 
			 
        //alert($("#mn.categories a").attr('class'));
      }
						
			
		});
		
		//$('#product_img').ready(function(){
		//	alert("#body 2: "+$("#body").height());
		//});
		
		
