var menuStat = "m1";

function setHi(ID) {
	obj = document.getElementById(ID);
	if (obj.className != "mainMenuHi") {
		obj.className = "mainMenuHi";
	}
}

function setDf(ID) {
	obj = document.getElementById(ID);
	if (menuStat != ID) {
		obj.className = "mainMenu";
	}
}

function setMainMenu() {
	objA = document.getElementById("m1");
	objB = document.getElementById("m2");
	objC = document.getElementById("m3");
	objD = document.getElementById("m4");
	objE = document.getElementById("m5");
	objF = document.getElementById("m6");
	objG = document.getElementById("m7");
	SPLIT = location.href.split("/");
	mSPLIT = SPLIT[SPLIT.length-1];
	
	sSPLIT = mSPLIT.split("=");
	xSPLIT = sSPLIT[sSPLIT.length-1];
	if (location.href == "http://www.restaurant-kesselhaus.de/") { objA.className = "mainMenuHi"; menuStat = "m1"; setActImg(); }
	//if (location.href == "http://www.restaurant-kesselhaus.de/index.php?id=88") { objG.className = "mainMenuHi"; menuStat = "m7"; }
	if (location.href == "http://www.kesselhaus-catering.de/") { location.href = "index.php?id=106"; }
	if (location.href == "http://www.catering-kesselhaus.de/") { location.href = "index.php?id=106"; }
	
	if (mSPLIT == "index.php?id=8") { objA.className = "mainMenuHi"; menuStat = "m1"; setActImg(); }
	if (mSPLIT == "index.php?id=87") { objB.className = "mainMenuHi"; menuStat = "m2"; setActImg(); }
	if (mSPLIT == "index.php?id=10") { objC.className = "mainMenuHi"; menuStat = "m3"; setActImg(); }
	if (mSPLIT == "index.php?id=11") { objD.className = "mainMenuHi"; menuStat = "m4"; setActImg(); }
	if (mSPLIT == "index.php?id=12") { objE.className = "mainMenuHi"; menuStat = "m5"; setActImg(); }
	if (mSPLIT == "index.php?id=13") { objF.className = "mainMenuHi"; menuStat = "m6"; setActImg(); }
	if (mSPLIT == "index.php?id=106") { objG.className = "mainMenuHi"; menuStat = "m7"; }
}

var menuCStat = "c1";

function setCHi(ID) {
	obj = document.getElementById(ID);
	if (obj.className != "mainMenuHi") {
		obj.className = "mainMenuHi";
	}
}

function setCDf(ID) {
	obj = document.getElementById(ID);
	if (menuCStat != ID) {
		obj.className = "mainMenu";
	}
}

function setMainMenuC() {
	objA = document.getElementById("c1");
	objB = document.getElementById("c2");
	objC = document.getElementById("c3");
	objD = document.getElementById("c4");
	objE = document.getElementById("c5");
	objF = document.getElementById("c6");
	objG = document.getElementById("c7");
	SPLIT = location.href.split("/");
	mSPLIT = SPLIT[SPLIT.length-1];
	
	cSPLIT = SPLIT[SPLIT.length-2];
	gSPLIT = SPLIT[SPLIT.length-3];
	
	sSPLIT = mSPLIT.split("=");
	xSPLIT = sSPLIT[sSPLIT.length-1];
	//if (location.href == "http://www.restaurant-kesselhaus.de/") { objA.className = "mainMenuHi"; menuStat = "m1"; setActImg(); }
	//if (location.href == "http://www.restaurant-kesselhaus.de/index.php?id=88") { objG.className = "mainMenuHi"; menuStat = "m7"; }
	//if (location.href == "http://www.kesselhaus-catering.de/") { location.href = "index.php?id=93"; }
	//if (location.href == "http://www.catering-kesselhaus.de/") { location.href = "index.php?id=93"; }
	
	if (mSPLIT == "index.php?id=106") { objA.className = "mainMenuHi"; menuCStat = "c1"; }
	if (cSPLIT == "beratungsservice") { objA.className = "mainMenuHi"; menuCStat = "c1"; }
	if (cSPLIT == "checklisten") { objA.className = "mainMenuHi"; menuCStat = "c1"; }
	
	if (mSPLIT == "index.php?id=109") { objB.className = "mainMenuHi"; menuCStat = "c2"; setActImgC(); }
	if (cSPLIT == "belegte-koestlichkeiten") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "canapees") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "belegte-baguettescheiben") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "halbe-belegte-broetchen") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "fingerfood") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "fingerfood-belegte-baguettescheiben") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "fingerfood-belegte-broetchen") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "soups") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "buffets-saisonal-und-thema") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "classic-buffet") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "norddeutsches-buffet") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "speicherstadt-buffet") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "schlemmer-buffet") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "italienisches-buffet") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "menues") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "nbsp-nbsp-nbsp-ratsherren-menue") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "nbsp-nbsp-nbsp-fangf-r-isch-menue") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "nbsp-nbsp-nbsp-lukullus-menue") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "nbsp-nbsp-nbsp-kesselhaus-menue") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "desserts") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "weine") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "alkoholfreie-getraenke") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "aperetifs-digestifs-cocktails") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "heissgetraenke") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	if (cSPLIT == "tagungssnacks-getraenke") { objB.className = "mainMenuHi"; menuCStat = "c2"; }
	
	
	if (mSPLIT == "index.php?id=118") { objC.className = "mainMenuHi"; menuCStat = "c3"; setActImgC(); }
	if (gSPLIT == "manpower-extraservice") { objC.className = "mainMenuHi"; menuCStat = "c3"; }
	
	if (mSPLIT == "index.php?id=127") { objD.className = "mainMenuHi"; menuCStat = "c4"; setActImgC(); }
	if (gSPLIT == "equipment-zelte-etc") { objD.className = "mainMenuHi"; menuCStat = "c4"; }
	
	if (mSPLIT == "index.php?id=133") { objE.className = "mainMenuHi"; menuCStat = "c5"; setActImgC(); }
	if (gSPLIT == "atmosphaere-locations") { objE.className = "mainMenuHi"; menuCStat = "c5"; }
	
	if (mSPLIT == "index.php?id=137") { objF.className = "mainMenuHi"; menuCStat = "c6"; setActImgC(); }
	if (gSPLIT == "musik-entertainment") { objF.className = "mainMenuHi"; menuCStat = "c6"; }
	
	if (mSPLIT == "index.php?id=8") { objG.className = "mainMenuHi"; menuCStat = "c7"; }
}


var m1Text = new Array();
	m1Text[1] = "Speiseraum innen: Stimmungsvolles Ambiente l\u00e4dt zum Verweilen ein...";
	m1Text[2] = "Text 2...";
	m1Text[3] = "Text 3...";
	m1Text[4] = "Text 4...";
	
var m2Text = new Array();
	m2Text[1] = "m2Text: Stimmungsvolles Ambiente l\u00e4dt zum Verweilen ein...";
	m2Text[2] = "Text 2...m2Text";
	m2Text[3] = "Text 3...m2Text";
	m2Text[4] = "Text 4...m2Text";
	
var m3Text = new Array();
	m3Text[1] = "m3Text: Stimmungsvolles Ambiente l\u00e4dt zum Verweilen ein...";
	m3Text[2] = "Text 2...m3Text";
	m3Text[3] = "Text 3...m3Text";
	m3Text[4] = "Text 4...m3Text";
	
var m4Text = new Array();
	m4Text[1] = "m4Text: Stimmungsvolles Ambiente l\u00e4dt zum Verweilen ein...";
	m4Text[2] = "Text 2...m4Text";
	m4Text[3] = "Text 3...m4Text";
	m4Text[4] = "Text 4...m4Text";
	
var m5Text = new Array();
	m5Text[1] = "m5Text: Stimmungsvolles Ambiente l\u00e4dt zum Verweilen ein...";
	m5Text[2] = "Text 2...m5Text";
	m5Text[3] = "Text 3...m5Text";
	m5Text[4] = "Text 4...m5Text";
	
var m6Text = new Array();
	m6Text[1] = "m6Text: Stimmungsvolles Ambiente l\u00e4dt zum Verweilen ein...";
	m6Text[2] = "Text 2...m6Text";
	m6Text[3] = "Text 3...m6Text";
	m6Text[4] = "Text 4...m6Text";

var arrayName;

function setActImg() {
	for (i = 1; i < 5; i++) {
		thumbObj = "thumb" + i;
		bigImg = menuStat + "Img" + i;
		if (i == 1) {
			thumb = menuStat + "Soft" + i;
			tbObj = document.getElementById(thumbObj);
			tbObj.src = "fileadmin/thumbs/" + thumb + ".jpg";
			imgObj = document.getElementById("changeImg");
			imgObj.src = "fileadmin/cImages/" + bigImg + ".jpg";
		} else {
			thumb = menuStat + "Img" + i;
			tbObj = document.getElementById(thumbObj);
			tbObj.src = "fileadmin/cImages/" + bigImg + ".jpg";
		}
	}
	//infoObj = document.getElementById("changeTxt");
	//xNodeChild = infoObj.childNodes[0];
	//if (menuStat == "m1") { xNodeChild.nodeValue = m1Text[1]; }
	//if (menuStat == "m2") { xNodeChild.nodeValue = m2Text[1]; }
	//if (menuStat == "m3") { xNodeChild.nodeValue = m3Text[1]; }
	//if (menuStat == "m4") { xNodeChild.nodeValue = m4Text[1]; }
	//if (menuStat == "m5") { xNodeChild.nodeValue = m5Text[1]; }
	//if (menuStat == "m6") { xNodeChild.nodeValue = m6Text[1]; }
}

function clickThumbs(ID,NUM) {
	resetThumbs();
	bigImg = menuStat + "Img" + NUM;
	tbObj = document.getElementById(ID);
	tbObj.src = "fileadmin/thumbs/" + menuStat + "Soft" + NUM + ".jpg";
	imgObj = document.getElementById("changeImg");
	imgObj.src = "fileadmin/cImages/" + bigImg + ".jpg";
	
	//infoObj = document.getElementById("changeTxt");
	//xNodeChild = infoObj.childNodes[0];
	//if (menuStat == "m1") { xNodeChild.nodeValue = m1Text[NUM]; }
	//if (menuStat == "m2") { xNodeChild.nodeValue = m2Text[NUM]; }
	//if (menuStat == "m3") { xNodeChild.nodeValue = m3Text[NUM]; }
	//if (menuStat == "m4") { xNodeChild.nodeValue = m4Text[NUM]; }
	//if (menuStat == "m5") { xNodeChild.nodeValue = m5Text[NUM]; }
	//if (menuStat == "m6") { xNodeChild.nodeValue = m6Text[NUM]; }
}

function resetThumbs() {
	for (i = 1; i < 5; i++) {
		thumb = menuStat + "Img" + i;
		thumbObj = "thumb" + i;
		tbObj = document.getElementById(thumbObj);
		tbObj.src = "fileadmin/cImages/" + thumb + ".jpg";
	}
}


function setActImgC() {
	for (i = 1; i < 5; i++) {
		thumbObj = "thumb" + i;
		bigImg = menuCStat + "Img" + i;
		if (i == 1) {
			thumb = menuCStat + "Soft" + i;
			tbObj = document.getElementById(thumbObj);
			tbObj.src = "fileadmin/thumbsC/" + thumb + ".jpg";
			imgObj = document.getElementById("changeImg");
			imgObj.src = "fileadmin/catCimages/" + bigImg + ".jpg";
		} else {
			thumb = menuCStat + "Img" + i;
			tbObj = document.getElementById(thumbObj);
			tbObj.src = "fileadmin/catCimages/" + bigImg + ".jpg";
		}
	}
}

function clickThumbsC(ID,NUM) {
	resetThumbsC();
	bigImg = menuCStat + "Img" + NUM;
	tbObj = document.getElementById(ID);
	tbObj.src = "fileadmin/thumbsC/" + menuCStat + "Soft" + NUM + ".jpg";
	imgObj = document.getElementById("changeImg");
	imgObj.src = "fileadmin/catCimages/" + bigImg + ".jpg";
}

function resetThumbsC() {
	for (i = 1; i < 5; i++) {
		thumb = menuCStat + "Img" + i;
		thumbObj = "thumb" + i;
		tbObj = document.getElementById(thumbObj);
		tbObj.src = "fileadmin/catCimages/" + thumb + ".jpg";
	}
}


var errVal = 1;
var adressCont = "";

function checkForX() {
    errVal = 1;
    AlertStrX = "Das Formular konnte noch nicht gesendet werden.\nEs fehlen noch folgende Angaben:\n";


    NameX = document.mForm.Name.value;
    //StrasseX = document.mForm.Strasse.value;
    PLZX = document.mForm.PLZ.value;
    //OrtX = document.mForm.Ort.value;
    TelefonX = document.mForm.Telefon.value;
    emailX = document.mForm.Email.value;
    
    if (NameX.length == 0) {
       errVal = 0;
       AlertStrX += "- Ihr Name - \n" }    

    //if (StrasseX.length == 0) {
     //  errVal = 0;
    //   AlertStrX += "- Ihre Strasse - \n" }
  
    if (PLZX.length == 0) {
       errVal = 0;
       AlertStrX += "- Ihre Postleitzahl - \n" }
    //if (OrtX.length == 0) {
    //   errVal = 0;
    //   AlertStrX += "- Ihr Ort - \n" }
    if (TelefonX.length == 0) {
       errVal = 0;
       AlertStrX += "- Ihre Telefonnummer - \n" }
    if (emailX.length == 0) {
       errVal = 0;
       AlertStrX += "- Ihre E-mail Adresse - \n" }


    if (errVal == 0) {
        alert(AlertStrX); 
    } else {
        self.document.mForm.submit();
    }
}
