function getWidths(width, numParts) {
	
	var aReturn = new Array();
	
	var widthPart = width / numParts;
	var widthPartSmaller = Math.floor(widthPart);
	var widthPartBigger = Math.ceil(widthPart);
	
	var retVal0 = widthPartSmaller * numParts / 10;
	var retVal1 = widthPartBigger * numParts / 10;
	
	aReturn[0] = retVal0.toString().replace(".", ",");
	aReturn[1] = retVal1.toString().replace(".", ",");
	
	return aReturn;
}

function widthInvalidForPartition(width, numParts) {
	
	var invalid = true;
	var widthPart = width / numParts;
	if(widthPart == widthPart.toFixed(0)) {
	
		invalid = false;
	}
	else {
	
		invalid = true;
	}
	
	return invalid;
}


function getError(formulaID, width, height, ext) {

	var aWidth2 = new Array();
	var aHeight2 = new Array();
	var widthTmp = width + "";
	aWidth2 = widthTmp.split(".");
	var heightTmp = height + "";
	aHeight2 = heightTmp.split(".");
	
	if(aWidth2[1] == undefined) {
	
		aWidth2[1] = 0;
	}
	if(aHeight2[1] == undefined) {
		
		aHeight2[1] = 0;
	}

    width = width * 10;
    height = height * 10;

    var msg = "";

    // Raumteiler 2 F
    if(formulaID == 1 || formulaID == 9 || formulaID == 4 || formulaID == 17) {
    
        if(width > 3000 && height >= 6000 || width >= 6000 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 300 x 600 cm bzw. 600 x 300 cm.";
        }
        if(height < 450) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(height > 6000) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(width < 450) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 45 und 600 cm.";
        }
        if(width > 6000) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 45 und 600 cm.";
        }
    }
    
    // Raumteiler 2 ER
    if(formulaID == 2 || formulaID == 10) {
    	
    	if(widthInvalidForPartition(width, 2)) {
    	
    		var aWidth = getWidths(width, 2);
    		msg = "Das gewählte Maß ist nicht durch zwei teilbar. Vorgeschlagene Breiten: " + aWidth[0] + " und " + aWidth[1] + " cm";
    	}

        if(width > 6030 && height > 6000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 603 x 600 cm bzw. 1203 x 300 cm.";
        }
        if(width > 12030 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 1203 x 300 cm bzw. 603 x 600 cm.";
        }
        if(width < 900 && height < 450) {
        
            msg = "Bitte wählen Sie ein Mindestmaß von 90 x 45 cm.";
        }
        if(height < 450) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(height > 6000) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(width < 900) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 90 und 1203 cm.";
        }
        if(width > 12030) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 90 und 1203 cm.";
        }
    }
    
    // Raumteiler 3 ER
    if(formulaID == 3 || formulaID == 11) {
    	
    	if(widthInvalidForPartition(width, 3)) {
        	
    		var aWidth = getWidths(width, 3);
    		msg = "Das gewählte Maß ist nicht durch drei teilbar. Vorgeschlagene Breiten: " + aWidth[0] + " und " + aWidth[1] + " cm";
    	}
    
        if(width > 9060 && height > 6000 || width > 18060 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 906 x 600 cm bzw. 1806 x 300 cm.";
        }
        if(width > 18060 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 1806 x 300 cm bzw. 906 x 600 cm.";
        }
        if(width < 1350 && height < 450) {
        
            msg = "Bitte wählen Sie ein Mindestmaß von 135 x 45 cm.";
        }
        if(height < 450) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(height > 6000) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(width < 1350) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 135 und 1806 cm.";
        }
        if(width > 18060) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 135 und 1806 cm.";
        }
    }
    
    // Wandrahmen
    if(formulaID == 5 || formulaID == 12 || formulaID == 14) {
    
        if(width > 3000 && height >= 6000 || width >= 6000 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 300 x 600 cm bzw. 600 x 300 cm.";
        }
        if(width < 450 && height < 450) {
        
            msg = "Bitte wählen Sie ein Mindestmaß von 45 x 45 cm.";
        }
        if(height < 450) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(height > 6000) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 45 und 600 cm.";
        }
        if(width < 450) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 45 und 600 cm.";
        }
        if(width > 6000) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 45 und 600 cm.";
        }
    }
    
    // Wandrahmen 2ER
    if(formulaID == 6 || formulaID == 13) {
    	
    	if(widthInvalidForPartition(width, 2)) {
        	
    		var aWidth = getWidths(width, 2);
    		msg = "Das gewählte Maß ist nicht durch zwei teilbar. Vorgeschlagene Breiten: " + aWidth[0] + " und " + aWidth[1] + " cm";
    	}
    
        if(width > 6000 && height > 6000 || width > 12000 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 600 x 600 cm bzw. 1200 x 300 cm.";
        }
        if(width < 600 && height < 450) {
        
            msg = "Bitte wählen Sie ein Mindestmaß von 60 x 45 cm.";
        }
        if(width < 900 && height < 300) {
            
            msg = "Bitte wählen Sie ein Mindestmaß von 90 x 30 cm.";
        }
        if(height < 300) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 30 und 600 cm.";
        }
        if(height > 6000) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 30 und 600 cm.";
        }
        if(width < 600) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 60 und 1200 cm.";
        }
        if(width > 12000) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 30 und 1200 cm.";
        }
    }
    
    // Wandrahmen 3ER
    if(formulaID == 7 || formulaID == 15) {
    	
    	if(widthInvalidForPartition(width, 3)) {
        	
    		var aWidth = getWidths(width, 3);
    		msg = "Das gewählte Maß ist nicht durch drei teilbar. Vorgeschlagene Breiten: " + aWidth[0] + " und " + aWidth[1] + " cm";
    	}
    
        if(width > 9000 && height > 6000 || width > 18000 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 900 x 600 cm bzw. 1800 x 300 cm.";
        }
        if(width < 900 && height < 450) {
        
            msg = "Bitte wählen Sie ein Mindestmaß von 90 x 45 cm.";
        }
        if(width < 1350 && height < 300) {
            
            msg = "Bitte wählen Sie ein Mindestmaß von 90 x 45 cm.";
        }
        if(height < 300) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 30 und 600 cm.";
        }
        if(height > 6000) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 30 und 600 cm.";
        }
        if(width < 900) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 90 und 1800 cm.";
        }
        if(width > 18000) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 90 und 1800 cm.";
        }
    }
    
    // Wandrahmen 4ER
    if(formulaID == 8 || formulaID == 16) {
    
    	if(widthInvalidForPartition(width, 4)) {
        	
    		var aWidth = getWidths(width, 4);
    		msg = "Das gewählte Maß ist nicht durch vier teilbar. Vorgeschlagene Breiten: " + aWidth[0] + " und " + aWidth[1] + " cm";
    	}
    	
        if(width > 12000 && height > 6000 || width > 24000 && height > 3000) {
        
            msg = "Bitte wählen Sie ein Maximalmaß von 1200 x 600 cm bzw. 2400 x 300 cm.";
        }
        if(width < 1200 && height < 450) {
        
            msg = "Bitte wählen Sie ein Mindestmaß von 120 x 45 cm.";
        }
        if(width < 1800 && height < 300) {
            
            msg = "Bitte wählen Sie ein Mindestmaß von 80 x 30 cm.";
        }
        if(height < 300) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 30 und 600 cm.";
        }
        if(height > 6000) {
        
            msg = "Bitte wählen Sie eine Höhe zwischen 30 und 600 cm.";
        }
        if(width < 1200) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 120 und 2400 cm.";
        }
        if(width > 24000) {
        
            msg = "Bitte wählen Sie eine Breite zwischen 120 und 2400 cm.";
        }
    }

    if(aWidth2[1].length > 1) {
    
    	msg = "Bitte geben Sie nur eine Kommastelle an.";
    }
    if(aHeight2[1].length > 1) {
        
    	msg = "Bitte geben Sie nur eine Kommastelle an.";
    }

    if(form_input_is_int(height) == false || height < 1) {
    
        msg = "Bitte geben Sie eine gültige Höhe ein.";
    }
    if(form_input_is_int(width) == false || width < 1) {

        msg = "Bitte geben Sie eine gültige Breite ein.";
    }
    if (/^(jpg|png|jpeg|gif|JPG|JPEG|GIF|PNG)$/.test(ext) == false) {

        msg = "Geeignete Bildformat: jpg, jpeg, png, gif";
    }
    
    return msg;
}

function form_input_is_int(input){

    return !isNaN(input);
}

function doAlertMotiveProcess(errorMsg) {

    parent.document.getElementById("motiveProcessAlert").style.display = "block";
    parent.document.getElementById("motiveProcessAlertMsg").innerHTML = errorMsg;
}

function setUploadingStatus(status, target) {
	
	var displayVal;
	
	if(status == "on") {
	
		displayVal = "block";
	}
	else if(status == "off") {

		displayVal = "none";
	}
	
	if(target == "self") {
		
	    document.getElementById("uploading").style.display = displayVal;
	}
	else if(target == "parent") {
	
	    parent.document.getElementById("uploading").style.display = displayVal;
	}
}

function runde(x, n) {
  if (n < 1 || n > 14) return false;
  var e = Math.pow(10, n);
  var k = (Math.round(x * e) / e).toString();
  if (k.indexOf('.') == -1) k += '.';
  k += e.toString().substring(1);
  return k.substring(0, k.indexOf('.') + n+1);
}

function updateScrollBar(elementID) {
	
	//get size of the div 
	var contentSrollbar = parent.document.getElementById(elementID);
    //update Srollbar based on the size of the div 
	if(contentSrollbar!=null && contentSrollbar.scrollUpdate) { contentSrollbar.scrollUpdate(); } 
	alert(contentSrollbar);
}
function doFieldActive(inputClass, inputID) {

 	    // activate the input field   

 	    jQuery("textarea").removeClass(inputClass+"Act");
        jQuery("textarea").addClass(inputClass);
        jQuery("input").removeClass(inputClass+"Act");
        jQuery("input").addClass(inputClass);
        jQuery("#"+inputID).addClass(inputClass+"Act");

    }
function showLayer(zoomID) {
	
	var x=270;
	var y=55;
	jQuery("#layerBox"+zoomID).fadeIn("slow").addClass("displayBlock");

}
function hideLayer(zoomID) {

	jQuery("#layerBox"+zoomID).fadeOut("slow").addClass("displayNone");
}
function closeandShowlayer(zoomID, zoomIDNext) {

	jQuery("#layerBox"+zoomIDNext).fadeOut("slow").addClass("displayNone");
	var x=270;
	var y=55;
	jQuery("#layerBox"+zoomID).fadeIn("slow").addClass("displayBlock");

}
function showLayerSite(type, documentPath, hierarchy, showCloseButton, layerBg) {
	
	hideLayerSite();
	
	if(type == "iframe") {
	
	    var filter = "";
	    var iframeHeight = "603";
	    var iframeWidth  = "1028";
	    var layerID = "";

	    if(layerBg == "motive") {
	    
	        filter = '<div class="alleslinks dimLayer filterSiteLayerMotive">';
	        layerID = "Motive";
	    }
	    if(layerBg == "motiveLight") {
	    
	        filter = '<div class="alleslinks dimLayer filterSiteLayerMotiveLight">';
	        layerID = "MotiveLight";
	    }
	    if(layerBg == "motiveJustMotive") {
	    	
	        filter = '<div class="alleslinks dimLayer filterSiteLayerMotiveJustMotive">';
	        layerID = "MotiveJustMotive";
	    }
	    if(layerBg == "picedit") {

	        filter = '<div class="alleslinks dimLayer filterSiteLayerPicedit">';
            layerID = "Picedit";
	    }
	    if(layerBg == "site") {
	    
	        filter = '<div class="alleslinks dimLayer filterSiteLayer">';
	    }
	    if(layerBg == "system") {
		    
	        filter = '<div class="alleslinks dimLayer filterSiteLayerSystem">';
	        layerID = "System";
	    }
	    if(layerBg == "IStock") {
		    
	        filter = '<div class="alleslinks dimLayer filterSiteLayerIStock">';
	        layerID = "IStock";
	    }

	    
	    if(showCloseButton == true) {
	        
	        var closeButton = '<div class="closeSiteButton"><a href="javascript:hideLayerSite(true);" onclick="javascript:hideLayerSite(true);" ><img src="/img/close.gif" border="0"></a></div>';
	        filter += closeButton;
	        iframeHeight = "545";
	        iframeWidth  = "980";
	    }
	    
	    if(hierarchy == "parent") {

	        jQuery("#layerSiteBox" + layerID, top.document).fadeIn("slow");
	        parent.document.getElementById("layerSiteBox" + layerID).innerHTML = filter + '<iframe id="iframeSite" height="' + iframeHeight + '" frameborder="0" width="' + iframeWidth + '" style="overflow:hidden; position:absolute; top:0px;" src="' + documentPath + '" allowtransparency="true" scrolling="no"></iframe></div>';
	    }
	    else if(hierarchy == "selbst") {

	        jQuery("#layerSiteBox" + layerID).fadeIn("slow");
	        document.getElementById("layerSiteBox" + layerID).innerHTML = filter + '<iframe name="iframeSiteName" id="iframeSite" height="' + iframeHeight + '" frameborder="0" width="' + iframeWidth + '" style="overflow:hidden; position:absolute; top:0px;" src="' + documentPath + '" allowtransparency="true" scrolling="no"></iframe></div>';
            document.iframeSiteName.location.reload();
	    }
	    
    }
    else if(type == "ajax") {

		jQuery.ajax({
		   type: "POST",
		   data: {  },
		   url: documentPath,
		   success: function(text){ 
			jQuery("#layerSiteBox", document).html(text);
            jQuery("#layerSiteBox").fadeIn("slow");
			} 
		 });
    }
}
function showLayerAgb() {
	    
	hideLayerSite();
    jQuery("#layerSiteBoxAgb").fadeIn("slow");
}
function showLayerDelivery() {
    
    hideLayerDelivery();
    jQuery("#layerSiteBoxDelivery", top.document).fadeIn("slow");
}
function hideLayerDelivery() {
	
	jQuery("#layerSiteBoxDelivery", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

    });
}
function showLayerNewsletter() {
	    
    jQuery("#layerSiteBoxNewsletter").fadeIn("slow");
}
function hideLayerSite(reload) {

	jQuery("#layerSiteBox", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);


      });
	jQuery("#layerSiteBoxSystem", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);
      if(reload == true){
	    	if(window.location.pathname == "/"){
	    		//document.location.reload();
	    		fillIntro();
	    	}else{
	    		//document.location.reload();
	    	}
	      }

    });
	
	jQuery("#layerSiteBoxMotive", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

      });
	jQuery("#layerSiteBoxMotiveLight", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

      });
	
	jQuery("#layerSiteBoxMotiveJustMotive", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

    });

	jQuery("#layerSiteBoxPicedit", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

      });

	jQuery("#layerSiteBoxAgb").hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

      });
	
	jQuery("#layerSiteBoxIStock", top.document).hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

    });
	
	jQuery("#layerSiteBoxDelivery").hide(function () {
	      var cssObj = {
	    	        "top" : "50%",
	    	        "left" : "50%"
	    	      }
	      jQuery(this).css(cssObj);

    });
}


function showLayerInfo(zoomID) {

    jQuery("#layerInfo" + zoomID).fadeIn("fast");
}
function hideLayerInfo(zoomID) {

    jQuery("#layerInfo" + zoomID).fadeOut("fast");
}


function showOfferLayer(offerID, productID) {
	
	document.getElementById("offerlayer").innerHTML = '<iframe src ="/offerLayer.php?productOfferID=' + offerID + '&productID=' + productID + '" frameborder="0" scrolling="no" style="margin:0; padding:0;" width="680" allowtransparency="true" height="364"></iframe>';
	jQuery("#offerlayer").fadeIn("slow").addClass("displayBlock");    
}

function hideOfferLayer() {

	jQuery("#offerlayer", top.document).fadeOut("slow").addClass("displayNone");
}

function showFormatLayer(productID) {
	
	/*jQuery("#formatLayerBox", top.document).fadeIn("slow").addClass("displayBlock");*/
	parent.document.getElementById("formatLayerBox").style.display = "block";
	parent.document.getElementById("formatIframe").src = "/motiveProcess.php?productID=" + productID;

}
function hideFormatLayer() {

	/*jQuery("#formatLayerBox").fadeOut("slow").addClass("displayNone");*/
	parent.document.getElementById("formatLayerBox").style.display = "none";
}
function showLayerNav(categoryID, display, xKordinate, yKordinate){

	var y = yKordinate;
	if(display == "left"){
		var x = xKordinate;
        var titlePos = "floatLeft";
	}else{
		var x = xKordinate-307;
		var titlePos = "floatRight";
	}
	 var cssObj = {
			 		"top" : y + "px",
	    	        "left" : x + "px"
	    	        
	    	      }
	setNavInact();
  	setNavAct(categoryID);
  	
    var content = "";
    content = getLayerContent(categoryID, 1, titlePos);

	jQuery("#navLayer").html(content);
	jQuery("#navLayer").css(cssObj);
    jQuery("#navLayer").slideDown(600);
}


function hideLayerNav() {

	jQuery("#navLayer").slideUp(600);
	
	setNavInact();
}

var actID = 0;
var navActID = 0;

function setNavAct(categoryID) {

    if(categoryID != actID && categoryID != navActID) {
    
        if(categoryID == 1) { 
            jQuery("#navLabel" + 1).find('img').stop().attr("src", "/img/nav_leinwand_act.gif"); 
        }
        if(categoryID == 2) { 
            jQuery("#navLabel" + 2).find('img').stop().attr("src", "/img/nav_leinwand_geteilt_act.gif"); 
        }
        if(categoryID == 3) {
            jQuery("#navLabel" + 3).find('img').stop().attr("src", "/img/img_nav_raumteiler_aktiv.gif"); 
        }
        if(categoryID == 4) { 
            jQuery("#navLabel" + 4).find('img').stop().attr("src", "/img/img_nav_moebel_aktiv.gif"); 
        }
        if(categoryID == 5) { 
            jQuery("#navLabel" + 5).find('img').stop().attr("src", "/img/img_nav_nur_motiv_aktiv.gif"); 
        }
	    
	    jQuery("#navLabel" + categoryID).addClass("headerNavItemLabelAct");
	    jQuery("#navLabel" + categoryID).addClass("headerNavItemLabelAct"  + categoryID);
	    
	    actID = categoryID;
	    jQuery("#navLayer").attr("name", categoryID);
	}  
}

function setNavInact() {

	//for(var i = 1; i <= 5; i++) {
	    
	    //if(jQuery("#navLabelImg" + i).attr("name") == "act") {
      
            i = actID;
            actID = 0;
             
	        jQuery("#navLabel" + i).removeClass("headerNavItemLabelAct");
	        jQuery("#navLabel" + i).removeClass("headerNavItemLabelAct"  + i);
	        
	        jQuery("#navLabelImg" + i).attr("name", "inact");
	        jQuery("#navLayer").attr("name", "inact");
	        
	        if(i == 1) { jQuery("#navLabel" + 1).find('img').stop().attr("src", "/img/nav_leinwand_inact.gif"); }
	        if(i == 2) { jQuery("#navLabel" + 2).find('img').stop().attr("src", "/img/nav_leinwand_geteilt_inact.gif"); }
	        if(i == 3) { jQuery("#navLabel" + 3).find('img').stop().attr("src", "/img/raumteiler_inact.gif"); }
	        if(i == 4) { jQuery("#navLabel" + 4).find('img').stop().attr("src", "/img/img_nav_moebel_inaktiv.gif"); }
	        if(i == 5) { jQuery("#navLabel" + 5).find('img').stop().attr("src", "/img/img_nav_nur_motiv_inaktiv.gif"); }
	    //}
    //}
    setNavInactMotiv();
}

function setNavInactMotiv() {
     
    jQuery("#navLabel" + 5).removeClass("headerNavItemLabelAct");
    jQuery("#navLabel" + 5).removeClass("headerNavItemLabelAct"  + 5);
    
    jQuery("#navLabelImg" + 5).attr("name", "inact");

    jQuery("#navLabel" + 5).find('img').stop().attr("src", "/img/img_nav_nur_motiv_inaktiv.gif"); 
}


function getLayerContent(categoryID, keyID, titlePos) {

    var content = "";
    var titleShort = new Array(); 

    content += '<div class="navLayerTitle" id="navLayerTitle">'; 
    
    // create the layer-navigation
    for (var i = 1; i < aCategory[categoryID]["aProduct"].length; i++) {
    
        if(i == keyID) {
               
            content += '<div class="navLayerTitleItem ' + titlePos + '"><a href="' + aCategory[categoryID]["aProduct"][keyID]["link"] + '" title="' + aCategory[categoryID]["aProduct"][keyID]["linkTitle"] + '"><img src="' + aCategory[categoryID]["aProduct"][keyID]["imgHdShortAct"].src + '" border="0" /></a></div>';
        }
        else {
        
            content += '<div class="navLayerTitleItem ' + titlePos + '"><a href="' + aCategory[categoryID]["aProduct"][keyID]["link"] + '" title="' + aCategory[categoryID]["aProduct"][keyID]["linkTitle"] + '" onMouseOver="javascript:document.getElementById(\'navLayer\').innerHTML=getLayerContent(' + categoryID + ', ' + i + ', \'' + titlePos + '\');"><img src="' + aCategory[categoryID]["aProduct"][i]["imgHdShortInact"].src + '" border="0" /></a></div>';
        }
    }
    
    content += '</div>';
    content += '<div class="clearBoth"></div>';
    content += '<div class="navLayerImgBig"><a href="' + aCategory[categoryID]["aProduct"][keyID]["link"] + '" title="' + aCategory[categoryID]["aProduct"][keyID]["linkTitle"] + '"><img src="' + aCategory[categoryID]["aProduct"][keyID]["imgBig"].src + '" height="201" width="375" border="0" /></a></div>';
    content += '<div class="navLayerBottom">';
    //content += '<img class="floatLeft" src="' + aCategory[categoryID]["aProduct"][keyID]["imgSmall"] + '" height="46" border="0" />';
    content += '<div class="navLayerText floatLeft"><img src="' + aCategory[categoryID]["aProduct"][keyID]["imgHdLong"].src + '" border="0" /></div>';
    content += '<div class="clearBoth"></div>';
    content += '</div>';
    content += '<div class="navLayerLinkBox">';
    content += '<div class="navLayerLink floatLeft"><a style="font-size: 14px;" href="' + aCategory[categoryID]["aProduct"][keyID]["link"] + '" title="' + aCategory[categoryID]["aProduct"][keyID]["linkTitle"] + '">zu den Preisen und Formaten</a></div>';
    
    //content += '<div class="navLayerLink floatLeft"><a class="thickbox" title="Das mootivoo System" href="javascript: tb_show(\'Das mootivoo System\', \'#TB_inline?height=347&width=600&inlineId=video\', false);">Produktvideo</a></div>';
    /****Product Gallery ****
    content += '<div class="navLayerLink floatLeft">';
    
    // check if a gallery exists
    if(aCategory[categoryID]["aProduct"][keyID]["aGallery"].length != 0) {
    
	    // create the layer-navigation
	    for (var i = 1; i < aCategory[categoryID]["aProduct"][keyID]["aGallery"].length; i++) {
	    
		    if(i == 1) {
		        
		        content += '<a rel="lightbox[galleryLayer' + keyID + ']"  title="' + aCategory[categoryID]["aProduct"][keyID]["aGallery"][i]["description"] + '" href="' + aCategory[categoryID]["aProduct"][keyID]["aGallery"][i]["path"] + '">Galerie</a>';
		    }
		    else {
		    
		        content += '<a rel="lightbox[galleryLayer' + keyID + ']"  title="' + aCategory[categoryID]["aProduct"][keyID]["aGallery"][i]["description"] + '" href="' + aCategory[categoryID]["aProduct"][keyID]["aGallery"][i]["path"] + '" class="displayNone">Galerie</a>';
		    }
	    }
    }
    
    content += '</div>';
    */
    
    content += '</div><div class="clearBoth"></div>';

	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
	
    return content;
}
function fillIntro(){
	
	var so = new SWFObject("/swf/homepage_intro.swf", "intro_home", "986", "488", "8", "#ffffff", "high");
	so.addParam("wmode", "transparent");
	so.write("introo");

}
function getETracker(pagename, areas, lpage) {


    content += '<!-- Copyright (c) 2000-2009 etracker GmbH. All rights reserved. --> ';
    content += '<!-- This material may not be reproduced, displayed, modified or distributed --> ';
    content += '<!-- without the express prior written permission of the copyright holder. --> ';
    
    content += '<!-- BEGIN etracker code ETRC 3.0 --> ';
    content += '<script type="text/javascript">document.write(String.fromCharCode(60)+"script type=\"text/javascript\" src=\"http"+("https:"==document.location.protocol?"s":"")+"://code.etracker.com/t.js?et=SmbIBE\">"+String.fromCharCode(60)+"/script>");</script> ';
    
    content += '<script type="text/javascript"> ';
    content += 'var et_pagename     = "' + pagename + '"; ';
    content += 'var et_areas        = "' + areas + '"; ';
    content += 'var et_lpage        = "' + lpage + '"; ';
    content += '</script>';
    
    content += '<!-- etracker PARAMETER END --> ';
    
    content += '<script type="text/javascript">_etc();</script> ';
    content += '<noscript><p><a href="http://www.etracker.com"><img style="border:0px;" alt="" src="https://www.etracker.com/nscnt.php?et=SmbIBE" /></a></p></noscript> ';

    content += '<!-- etracker CODE END --> ';
    
    return content;
}


// time for navigation
var t;