
var currentContentID = "contentHome";
var activatedContentID = "";

var oldProductListWrapperID = "";
var newProductListWrapperID = "";

var currentLeftSubMenuID = "";

var menuClickCounter = 0;

var currentRightWidgetID = new Array("sustainabilityWidget", "goldWidget", "recipeWidget");
var productRightWidgetIDSet01 = new Array("transparencyWidget", "mscWidget", "fishingMapWidget"); 
var productRightWidgetIDSet02 = new Array("newCuisineWidget", "newProductsWidget", "goldWidget");
var recipeRightWidgetIDSet = new Array("sustainabilityWidget", "goldWidget", "recipeWidget");

var blockRightWidgetID = false;
var hideAfterShow = false;

var currentFishingMethodID = "fishingPelagian";

var holdActiveFishingRegionListBox = false;
var holdActiveFishingRegionListBoxBlock = false;

var lastListBoxTop = 0;

var activeFishID = "";

var imagesPreloaded = false;

var mainImages = [];
var mainImagesSrc = new Array(
	"Femeg_Logo.png",
	"Kutter.png",
	"flagge_GB.png",
	"flagge_F.png",
	"Infofeld_rechts_MSC.png",
	"Infofeld_rechts_Transparenz.png",
	"Infofeld_rechts_karte.png",
	"Infofeld_rechts_Gold.png",
	"Infofeld_rechts_NK.png",
	"Infofeld_rechts_Neu.png",
	"Infofeld_rechts_Rezepte.png",
	"Infofeld_rechts_rezepttipp.png",
	"NK_button.png",
	"Infofeld_Front_BlackTiger.png",
	"Infofeld_Front_MSC.png",
	"MSC_button.png",
	"RahmenWarenkunde2.png",
	"Infofeld_Front_blankoGruen.png",
	"RahmenFangmethoden.png",
	"Rezeptstreifen.png",
	"newCuisine.gif",
	"quality.gif",
	"Balken_rechts.png",
	"ZeigerOben_right.png",
	"ZeigerOben_left.png",
	"ZeigerUnten_right.png",
	"ZeigerUnten_left.png",
	"Image_CM_Start.jpg",
	"Image_CM_Kontakt.jpg",
	"Image_CM_Impressum.jpg",
	"Image_CM_neuekueche.jpg",
	"Image_CM_selectedseaf.jpg",
	"Image_CM_MSC.jpg",
	"Image_CM_warenkunde1.jpg",
	"Image_CM_fischerei.jpg",
	"Image_CM_Femeg.jpg",
	"Image_CM_Rezepte1.jpg",
	"Image_CM_Sort_Start.jpg",
	"Image_CM_warenkunde2_sizeToFit.jpg"
);
var productImages = [];

function historyChange(newLocation, historyData) {
	// var historyMsg = (typeof historyData == "object" && historyData != null
		// ? historyStorage.toJSON(historyData)
		// : historyData
	// );
	var msg = "<b>A history change has occured:</b> | newLocation=" + newLocation + " | historyData=" + historyData + " |";
	alert(msg);
};

/* Our event handler to add history change events */
function addHistoryEvent() {
	var newLocation, historyData;
	dhtmlHistory.add(newLocation,historyData);
	if (typeof a[1] == "object") {/*stringify this so we can log it better*/
		a[1] = historyStorage.toJSON(historyData);
	}
	var msg = "<b>A history event has been added:</b> [newLocation=" + newLocation + " | historyData=" + historyData + "]";
	alert(msg);

}

function toggleWidgetIndex(widgetIndex, widgetSet){
	return widgetIndex % widgetSet.length;
}
function showFishingMethod(callerID){
	
	$(".fishingMenuItem").removeClass("activeFishingMenuItem");
	$("#" + callerID).addClass("activeFishingMenuItem");         

	$("#" + currentFishingMethodID).slideUp(111);
	currentFishingMethodID = callerID.replace(/menu/g, "fishing");
	$("#" + currentFishingMethodID).show(111);

}
function loadLeftSubMenu(leftSubMenuID){
	if(currentLeftSubMenuID != "")
		$("#" + currentLeftSubMenuID).hide(40);
	if(leftSubMenuID != ""){
		$("#" + leftSubMenuID).show(40);
		currentLeftSubMenuID = leftSubMenuID;
	}
}
function loadContent(){
    //$("#" + currentContentID).hide(666);
    if(activatedContentID == "")
        activatedContentID = "contentHome";
    //$("#" + currentContentID).fadeOut("slow");
    //$("#" + currentContentID).slideUp(666);
    if(!hideAfterShow){
		$("#" + currentContentID).css("display","none");
		$("#" + activatedContentID).fadeIn(333); 
		
		
	} else {
// alert(oldProductListWrapperID);
// alert(newProductListWrapperID);	
	//$(document).ready(function(){
		if(currentContentID != activatedContentID){
		//$("#" + currentContentID).css("display","none");
		//$("#" + activatedContentID).css("display","none");
			$("#" + currentContentID).fadeOut(100);
			$("#" + activatedContentID).fadeIn(1000);
			if(oldProductListWrapperID != "")
				$("#" + oldProductListWrapperID).remove();
			oldProductListWrapperID = newProductListWrapperID;
		} else {
			if(oldProductListWrapperID != newProductListWrapperID){
				if(oldProductListWrapperID != "")
					$("#" + oldProductListWrapperID).fadeOut(100);
					oldProductListWrapperID = newProductListWrapperID;
					//$("#" + newProductListWrapperID).fadeIn(1000);
					$("#" + activatedContentID).css("width","1px");
					$("#" + activatedContentID).animate(
						{ 
				        width: "644px"
						}, 700 );
				
			} else {
				;//$("#" + activatedContentID).fadeIn(333);
			}
		}
		//});
	}
     //$("#" + currentContentID).slideUp(222);
     //$("#" + currentContentID).fadeOut(222);
    //window.setTimeout('$("#" + activatedContentID).show(333)', 111);
    

		
/*     $("#" + currentContentID).slideUp();
    //window.setTimeout('$("#" + activatedContentID).show(333)', 111);
    $("#" + activatedContentID).show(); */

	// currentContentID = activatedContentID;
	currentContentID = activatedContentID;
    //window.setTimeout('currentContentID = activatedContentID', 4500);

	
 	//ToDo Variable Function
	if(!blockRightWidgetID){
		toggleRightMenuItem("mscWidget", 0);	
		toggleRightMenuItem("goldWidget", 1);	
	} 
}

function showContent(newContentID){
    activatedContentID = newContentID; 
    loadContent();
}

// function toggleRightMenuItem(displayID, hideID){
	// if(displayID != hideID){
		// $("#" + hideID).slideUp(222);
		// $("#" + displayID).show(333);
		// currentRightWidgetID[1] = displayID;
	// }
// }
function toggleRightMenuItem(displayID, hideIdIndex){
	if(displayID != currentRightWidgetID[hideIdIndex]){
		$("#" + currentRightWidgetID[hideIdIndex]).slideUp("fast");
		//$("#" + currentRightWidgetID[hideIdIndex]).css("display","none");
		$("#" + displayID).show();
		currentRightWidgetID[hideIdIndex] = displayID;
	}
}

function showRecipeList(recipeListType, recipeProductGroupID, targetID){
    var bgImg = "";
	if(recipeListType == 0 || recipeListType == -1){
		//return;
		bgImg = "Image_CM_Rezepte2.jpg";
	}
	else if(recipeListType == 1 && recipeProductGroupID == 0){
		bgImg = "Image_CM_AlleRezepte.jpg";
	}
	else if(recipeListType == 1 && recipeProductGroupID != 0){

	    switch(recipeProductGroupID){
	        case 1:
	            bgImg = "Image_CM_Sort_Filets.jpg";
				toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet02)], 1);
				toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet01)], 0);
	            break;
	        case 2:
	            bgImg = "Image_CM_Sort_GanzeFische.jpg";
				toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet02)], 1);
				toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet01)], 0);
	            break;          
	        case 4:
	            bgImg = "Image_CM_Sort_Schalen.jpg";
				toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet02)], 1);
				toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet01)], 0);
	            break;   
	        case 5:
	            bgImg = "Image_CM_Sort_Scholle.jpg";
				toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet02)], 1);
				toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet01)], 0);
	            break;   
	        case 6:
	            bgImg = "Image_CM_Sort_Spezial.jpg";
				toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet02)], 1);
				toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(Math.floor(Math.random()*3), productRightWidgetIDSet01)], 0);
	            break; 
	    }
	}
    
	$.get("getRecipeList.php" + "?recipeListType=" + recipeListType + "&id=" + recipeProductGroupID, function(data){
        //alert(data);
		if(data == "null"){
			alert("Für das gewählte Produkt sind momentan keine aktuellen Rezepttipps verfügbar.");
        //alert($(data).text());
		}
		else{
			$("#" + targetID + " > .contentHeader").empty();
			$("#" + targetID + " > .contentHeader").css("height","100%");
			//$("#" + targetID + " > .contentHeader").css("background-image","url(" + bgImg + ")");
			
			$("#" + targetID + " > .contentHeader").append(data);
			$("#" + targetID).css("background-image","url(" + bgImg + ")");
	        activatedContentID = targetID; 
			blockRightWidgetID = true;
	        loadContent();
			blockRightWidgetID = false;
		}
//        $("#leftInnerWrapper").height($("#leftInnerWrapper").height() * 2);
//        $("#rightInnerWrapper").height($("#rightInnerWrapper").height() * 2);
	});

}

function searchProductsAndRecipes(countryID, targetID){
	var bgImg = "Image_CM_Rezepte2.jpg";
	var url = ""; 
	var dataSource = $("input[name='searchData']:checked").val();
	
	var category = $("#productSearchSelect").val();
	if(dataSource == "product")
		url = "getProductList.php" + "?group_id=" + category + "&country_id=" + countryID;
	else if(dataSource == "recipe")
		url = "getRecipeList.php" + "?recipeListType=" + "1" + "&id=" + category;
//alert(dataSource);
	$.get(url, function(data){
        //alert(data);
        //alert($(data).text());
		//$("#" + targetID).css("display","none");
		$("#" + targetID).slideUp();
		$("#" + targetID + " > .contentHeader").empty();
		$("#" + targetID + " > .contentHeader").css("height","100%");
		//$("#" + targetID + " > .contentHeader").css("background-image","url(" + bgImg + ")");
		
		// $("#" + targetID + " > .contentHeader").append(data);
		// $("#fisheye").css("background-image","url(" + bgImg + ")");
        activatedContentID = targetID; 
		blockRightWidgetID = true;
        loadContent();
		blockRightWidgetID = false;
		$("#" + targetID + " > .contentHeader").append(data);
		$("#fisheye").css("background-image","url(" + bgImg + ")");		
		//alert("ready");
		tb_init('a.thickbox, area.thickbox, input.thickbox');		

//        $("#leftInnerWrapper").height($("#leftInnerWrapper").height() * 2);
//        $("#rightInnerWrapper").height($("#rightInnerWrapper").height() * 2);
	});
}
function showProductList(countryID, productGroupID, targetID){
    var bgImg = "";

    switch(productGroupID){
        case 1:
            bgImg = "Image_CM_Sort_Filets.jpg";
			//toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(++menuClickCounter, productRightWidgetIDSet02)], 1);
			toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(menuClickCounter, productRightWidgetIDSet01)], 0);
            break;
        case 2:
            bgImg = "Image_CM_Sort_GanzeFische.jpg";
			//toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(++menuClickCounter, productRightWidgetIDSet02)], 1);
			toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(menuClickCounter, productRightWidgetIDSet01)], 0);
            break;           
        case 4:
            bgImg = "Image_CM_Sort_Schalen.jpg";
			//toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(++menuClickCounter, productRightWidgetIDSet02)], 1);
			toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(menuClickCounter, productRightWidgetIDSet01)], 0);
            break;    
        case 5:
            bgImg = "Image_CM_Sort_Scholle.jpg";
			//toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(++menuClickCounter, productRightWidgetIDSet02)], 1);
			toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(menuClickCounter, productRightWidgetIDSet01)], 0);
            break;    
        case 6:
            bgImg = "Image_CM_Sort_Spezial.jpg";
			//toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(++menuClickCounter, productRightWidgetIDSet02)], 1);
			toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(menuClickCounter, productRightWidgetIDSet01)], 0);
            break;    
		//*********ToDo: split function! *****************
        case 101:
			//MSC
            bgImg = "Image_CM_MSC_2.jpg";
			//toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(++menuClickCounter, productRightWidgetIDSet02)], 1);
			toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(menuClickCounter, productRightWidgetIDSet01)], 0);
            break;    
        case 102:
			//new
            bgImg = "Image_CM_Sort_Neuheiten.jpg";
			toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem("newCuisineWidget", 1);
            break;    
        case 103:
			//DLG
            bgImg = "Image_CM_Sort_Gold.jpg";
			//toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem(productRightWidgetIDSet02[toggleWidgetIndex(++menuClickCounter, productRightWidgetIDSet02)], 1);
			toggleRightMenuItem(productRightWidgetIDSet01[toggleWidgetIndex(menuClickCounter, productRightWidgetIDSet01)], 0);
            break;  
        case 104:
			//new Cuisine
            bgImg = "Image_CM_Sort_NeueKueche.jpg";
			toggleRightMenuItem("transparencyWidget", 0);
			toggleRightMenuItem("newProductsWidget", 1);
            break;    
    }
    
	$.get("getProductList.php" + "?group_id=" + productGroupID + "&country_id=" + countryID, function(data){
        //alert(data);
        //alert($(data).text());
		//$("#" + targetID).css("display","none");
		
/* 		$("#" + targetID).slideUp();
		$("#" + targetID + " > .contentHeader").empty();
		$("#" + targetID + " > .contentHeader").css("height","100%"); */
		
		//$("#" + targetID + " > .contentHeader").css("background-image","url(" + bgImg + ")");
		
		// $("#" + targetID + " > .contentHeader").append(data);
		// $("#fisheye").css("background-image","url(" + bgImg + ")");
        activatedContentID = targetID; 
		blockRightWidgetID = true;
		hideAfterShow = true;


			
		
		newProductListWrapperID = 'productList_' + productGroupID + '_' + countryID;
		$("#" + newProductListWrapperID).remove();
		
		loadContent();
		$("#" + targetID + " > .contentHeader").append('<div id="' + newProductListWrapperID + '">' +  data + '</div>');
		//$("#fisheye").css("background-image","url(" + bgImg + ")");
	
		//$("#" + newProductListWrapperID).css("background-image","url(" + bgImg + ")");	
		
		$("#" + newProductListWrapperID).children("#fisheye").css("background-image","url(" + bgImg + ")");	

		blockRightWidgetID = false;
		hideAfterShow = false;
	
		//alert("ready");
		tb_init('a.thickbox, area.thickbox, input.thickbox');
		


	});

}

function loginB2B(){
	var usernameB2B = $("#usernameB2B").val();
	var passwordB2B = $("#passwordB2B").val(); 
	$.get("loginB2B.php" + "?uidB2B=" + usernameB2B + "&pwB2B=" + passwordB2B, function(data){
			//alert(data);
			if(data == "yes"){
				alert("Login erfolgreich!");
				tb_remove();				
			//alert($(data).text());if (data == "yes")
			}
			else {
				alert("Login gescheitert!");

			}
	});
}

function preloadImages(sourceArray, targetArray){
	//alert('preloadImages');

	var imagesLength = sourceArray.length;
	$("#statusInformation").css("display","block");
	for(var imageCount = 0; imageCount < imagesLength; imageCount++){
		
		targetArray[imageCount] = new Image();
		targetArray[imageCount].src = sourceArray[imageCount];
		
	}
	$('#statusInformation').css("display","none");
	imagesPreloaded = true;
	//alert("imagesPreloaded");
}
 

$(document).ready(function(){
	//alert('ready');
	
	window.onload = function() {
		
		//initialize our DHTML history
		dhtmlHistory.initialize();
		//alert("<b>dhtmlHistory initialized</b>");

		//subscribe to DHTML history change events
		dhtmlHistory.addListener(historyChange);
		//alert("<b>dhtmlHistory listener created</b>");
	};	

    var activeFishingRegion = "";

    //$("#content").fadeIn(666);
    //$("#mainLogo").slideDown(666);
    $("#rightInnerWrapper").show(666);
	
    //$("#mainLogo").show(66);
    $("#leftInnerWrapper").show(666);
    //window.setTimeout('$(".contentFooter").slideDown(3999)', 1000);
    $(".contentFooter").slideDown(777);
    //$(".leftMenuContainer").fadeIn(2333);	

// var subMenu = '<ul class="leftSubMenu" id="Ul1">';
//                            subMenu += '<li class="leftSubMenu" id="Li1">Sub</li>';
//                            subMenu += '<li class="leftSubMenu" id="Li2">Sub</li>';
//                            subMenu += '</ul>';
//                            $("#SelectedSeafood").append(subMenu);  
/* 
    $(function() {
        $("#leftMenuList").accordion({
	        //event: "mouseover",
	        header: "span",
	        animated: "easeslide"
	        //animated: "easeslide" //animated: "bounceslide"
        });
    });
	 */

	
    $(".leftMenuItemText").hover(
        function(){
            $(this).addClass("hilite");
        },
        function(){
            $(this).removeClass("hilite");
        }
    );
    $(".leftMenuItemLink").hover(
        function(){
            $(this).addClass("hilite");
        },
        function(){
            $(this).removeClass("hilite");
        }
    );
//    $(".leftMenuItemText").mouseover(function(){$(this).css("color", "rgb(186,198,231)");});
//    $(".leftMenuItemText").mouseout(function(){$(this).css("color", "white");});



    $(".leftMenuItemLink").click(function(){

            //$(this).addClass("selected");
            $(".hilite").addClass("selected");
            $("*:not(.hilite)").removeClass("selected");         
            //alert(this.id.replace(/menuItem/g, "content"));
            if(this.className.indexOf("ajaxLoad") == -1){
                activatedContentID = this.id.replace(/menuItem/g, "content");
                loadContent();
            }
//            else
//                currentContentID = "contentProductList";
        });
    $(".foodstuffCloseButton").click(function(){
	
		$(".activeFishingRegionListBox").css("top", lastListBoxTop);
		$(".activeFishingRegionListBox").removeClass("activeFishingRegionListBox");
		$("#foodstuffHeader").css("background-image", "url(Image_CM_warenkunde1.jpg)");
		$("#foodstuffHeader").css("background-position", "0px 0px");
		$("#foodstuffHeader").css("height", "440px");
		//$("#foodstuffFooter").css("position", "relative");
		$("#foodstuffFooter").css("padding-top", "0px");
		$("#foodstuffFooterLeftElement").css("margin-top", "0px");		
		//$("#foodstuffProducts").css("margin-top", "220px");		
	
		holdActiveFishingRegionListBox = false;
		$(".fishingRegion").show();
		$(".fishingRegionListBox").hide();
		//$("#foodstuffFooterLeftElement").hide();
		$("#foodstuffHeadline").text("Interaktive Karte");
		$(".foodstuffCloseButton").hide();
		$(".foodstuffDeadButton").show();
		$("#foodstuffDetails").empty();
		$("#foodstuffProducts").empty();
		$("#foodstuffManual").show();
		
    });

    $(".regionListClick").click(function(){
		var fishID = this.id.substring("fish.".length, this.id.length);


		$(".fishingRegion:not(.activeFishingRegion)").hide();
		//$("#foodstuffFooterLeftElement").show();	
		$("#foodstuffDetails").empty();
		$.get("getFoodstuff.php" + "?fishID=" + fishID, function(data){
			//alert(data);
			$("#foodstuffDetails").append(data);

			
		});
		if(!holdActiveFishingRegionListBox){			
			//var topMenuTop = $("#topMenu").css("top");
			//var topMenuHeight = $("#topMenu").css("height");

			var listBoxTop = $(".activeFishingRegionListBox").css("top");
			// var listBoxHeight = $(".activeFishingRegionListBox").css("height");
			// var foodstuffHeaderTop = $("#foodstuffHeader").css("top");
			// var foodstuffHeaderHeight = $("#foodstuffHeader").css("height");

			
			lastListBoxTop = eval(listBoxTop.substring(0, listBoxTop.indexOf("px")));
			// listBoxHeight = eval(listBoxHeight.substring(0, listBoxHeight.indexOf("px")));
			// foodstuffHeaderTop = eval(foodstuffHeaderTop.substring(0, foodstuffHeaderTop.indexOf("px")));
			// foodstuffHeaderHeight = eval(foodstuffHeaderHeight.substring(0, foodstuffHeaderHeight.indexOf("px")));
			
			listBoxTopOffset = 100 - lastListBoxTop;

			$(".activeFishingRegionListBox").css("top", 100);
			$("#foodstuffHeader").css("background-image", "url(Image_CM_warenkunde1-2.jpg)");
			$("#foodstuffHeader").css("background-position", "0px " + listBoxTopOffset + "px");
			$("#foodstuffHeader").css("height", "260px");
			//$("#foodstuffFooter").css("position", "relative");
			$("#foodstuffFooter").css("padding-top", "0px");
			$("#foodstuffFooterLeftElement").css("margin-top", "-40px");
		}

		
		var currentFoodstuffHeadline = $(this).text();
		$("#foodstuffHeadline").text(currentFoodstuffHeadline);
		$(".foodstuffDeadButton").hide();
		$(".foodstuffCloseButton").show();
		$("#foodstuffManual").hide();
		
		$("#foodstuffProducts").empty();
		$.get("getFoodstuffProducts.php" + "?fishID=" + fishID, function(data){
			//alert(data);
			$("#foodstuffProducts").append(data);
		});
		
		holdActiveFishingRegionListBox = true;		
		holdActiveFishingRegionListBoxBlock = true;		
		
    });	
    $("#foodstuffHeader").click(function(){
		if(!holdActiveFishingRegionListBoxBlock){
			$(".activeFishingRegionListBox").css("top", lastListBoxTop);
			$(".activeFishingRegionListBox").removeClass("activeFishingRegionListBox");
			$("#foodstuffHeader").css("background-image", "url(Image_CM_warenkunde1.jpg)");
			$("#foodstuffHeader").css("background-position", "0px 0px");
			$("#foodstuffHeader").css("height", "440px");
			//$("#foodstuffFooter").css("position", "relative");
			$("#foodstuffFooter").css("padding-top", "0px");
			$("#foodstuffFooterLeftElement").css("margin-top", "0px");		
			//$("#foodstuffProducts").css("margin-top", "220px");		
		
			holdActiveFishingRegionListBox = false;
			$(".fishingRegion").show();
			$(".fishingRegionListBox").hide();
			//$("#foodstuffFooterLeftElement").hide();
			$("#foodstuffHeadline").text("Interaktive Karte");
			$(".foodstuffCloseButton").hide();
			$(".foodstuffDeadButton").show();
			$("#foodstuffDetails").empty();
			$("#foodstuffProducts").empty();
			$("#foodstuffManual").show();
		}
		
    });			
	$(".fishingRegionListBox").hover(
	      function () {
			$(this).addClass("activeFishingRegionListBox");
	      }, 
	      function () {
			  if(!holdActiveFishingRegionListBox){
				$(this).removeClass("activeFishingRegionListBox");
				$(this).hide();
				}
				else
					holdActiveFishingRegionListBoxBlock = false;
			//$(".fishingRegionListBox:not(.activeFishingRegionListBox)").hide();
	      }
	    );
	$(".fishingRegion").mouseenter(function(){
		$(this).addClass("activeFishingRegion");
		$(".fishingRegionListBox").hide();
		$("#" + this.id.substring(0, this.id.indexOf("_") + 1) + "ListBox").show();
			}).mouseleave(function(){
				//$("#" + this.id.substring(0, this.id.indexOf("_") + 1) + "ListBox").hide();
				$(this).removeClass("activeFishingRegion");
		});
		
		window.setTimeout("preloadImages(mainImagesSrc, mainImages)",1000);
		$.get("getProductImageData.php" + "?country_id=1", function(data){
			//alert(data);
			preloadImages(data.split(';'), productImages);
			//alert(productImages[5].src);
 
		});
});
                   

