// ************************************************************
// Menü-Script - Bonne Maman
// (c) 2003 - Byte-XXL, Neckargemünd --  www.byte-xxl.de
//  Letzte Änderung:02.03.2009
// *************************************************************

function init(path){


// ming "Menu Images" + mpat "Menu Path"
// Bilder und Sprungziele zuordnen


//mimg = new Array("prod","rez","card","buch","imp");
mimg = new Array("prod", "bezug","rez","spiel","buch","imp","home");
//mimg = new Array("prod","spiel","card","buch","imp");

mpath = new Array("produkte/produkt.htm",
			"bezugsquellen/bezugsquellen.php",
		  "rezepte/rezepte.php",
		  "larochelle/larochelle.htm",
		  "forum/index.php",
		  "kontakt/kontakt.htm",
		  "index.html");



		  //"umfrage/index.php?site=umfrage",


norm   = new Array(path + "images/m_" + mimg[0] + ".gif",
                   path + "images/m_" + mimg[1] + ".gif",
                   path + "images/m_" + mimg[2] + ".gif",
                   path + "images/m_" + mimg[3] + ".gif",
                   path + "images/m_" + mimg[4] + ".gif",
									 path + "images/m_" + mimg[5] + ".gif",
                   path + "images/m_" + mimg[6] + ".gif");


over   = new Array(path + "images/m_" + mimg[0] + "_ch.gif",
                   path + "images/m_" + mimg[1] + "_ch.gif",
                   path + "images/m_" + mimg[2] + "_ch.gif",
                   path + "images/m_" + mimg[3] + "_ch.gif",
                   path + "images/m_" + mimg[4] + "_ch.gif",
									 path + "images/m_" + mimg[5] + "_ch.gif",
                   path + "images/m_" + mimg[6] + "_ch.gif");


			// css-weiche	für Kopf-Datei (Bildschirmgröße)					 
									 
									 	//alert(window.innerWidth);

if (window.innerWidth <= 1000){
 document.write('<link rel="stylesheet" href="../styles/bonnemaman800.css" type="text/css">');
}else{
			if (window.innerWidth >= 1600){
				 document.write('<link rel="stylesheet" href="../styles/bonnemaman1600.css" type="text/css">');
				 }else{
				 document.write('<link rel="stylesheet" href="../styles/bonnemaman.css" type="text/css">');
				 }
}

// For IE document.documentElement.clientWidth;
if (document.documentElement.clientWidth <= 1000){
 document.write('<link rel="stylesheet" href="../styles/bonnemaman800.css" type="text/css">');
}else{
			if (document.documentElement.clientWidth >= 1600){
				 document.write('<link rel="stylesheet" href="../styles/bonnemaman1600.css" type="text/css">');
				 }else{
				 document.write('<link rel="stylesheet" href="../styles/bonnemaman.css" type="text/css">');
				 }
}


}


function menue(){
document.write ("<TABLE class='themenue' WIDTH='700' BORDER='0' CELLSPACING='0' CELLPADDING='0' height='16'>");

document.write ("<TR height='16'><TD width='1' height='16'><img ID='l0' Name='l0' src='" + path + "images/m_line_c.gif'></TD>");
document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[0] + "' onmouseover='mover(0)' onmouseout='mout(0)'><IMG ID='m0' Name='m0' SRC='" + path + "images/m_" + mimg[0] +".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");
document.write ("<TD width='1' height='16'><img ID='l1' Name='l1' src='" + path + "images/m_line_a.gif'></TD>");
document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[1] +"' onmouseover='mover(1)' onmouseout='mout(1)'><IMG ID='m1' Name='m1' SRC='" + path + "images/m_" + mimg[1] + ".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");
document.write ("<TD width='1' height='16'><img ID='l2' Name='l2' src='" + path + "images/m_line_a.gif'></TD>");
document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[2] +"' onmouseover='mover(2)' onmouseout='mout(2)'><IMG ID='m2' Name='m2' SRC='" + path + "images/m_" + mimg[2] + ".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");
document.write ("<TD width='1' height='16'><img ID='l3' Name='l3' src='" + path + "images/m_line_a.gif'></TD>");
document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[3] +"' onmouseover='mover(3)' onmouseout='mout(3)'><IMG ID='m3' Name='m3' SRC='" + path + "images/m_" + mimg[3] + ".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");
document.write ("<TD width='1' height='16'><img ID='l4' Name='l4' src='" + path + "images/m_line_a.gif'></TD>");
document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[4] +"' onmouseover='mover(4)' onmouseout='mout(4)'><IMG ID='m4' Name='m4' SRC='" + path + "images/m_" + mimg[4] + ".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");

document.write ("<TD width='1' height='16'><img ID='l5' Name='l5' src='" + path + "images/m_line_a.gif'></TD>");
document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[5] +"' onmouseover='mover(5)' onmouseout='mout(5)'><IMG ID='m5' Name='m5' SRC='" + path + "images/m_" + mimg[5] + ".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");

document.write ("<TD width='1' height='16'><img ID='l6' Name='l6' src='" + path + "images/m_line_a.gif'></TD>");
document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[6] +"' onmouseover='mover(6)' onmouseout='mout(6)'><IMG ID='m6' Name='m6' SRC='" + path + "images/m_" + mimg[6] + ".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");

//document.write ("<TD width='1' height='16'><img ID='l7' Name='l7' src='" + path + "images/m_line_a.gif'></TD>");
//document.write ("<TD WIDTH='99' height='16'><a href='"+ path + mpath[7] +"' onmouseover='mover(7)' onmouseout='mout(7)'><IMG ID='m7' Name='m7' SRC='" + path + "images/m_" + mimg[7] + ".gif' WIDTH='99' HEIGHT='16' border='0'></a></TD>");
document.write ("<TD width='1' height='16'><img  ID='l8' Name='l8' src='" + path + "images/m_line_c.gif'></TD>");
document.write ("</TR></TABLE>");




}

// Bilder Tauschen

var a;
var pa;
var vimg;
var himg;
var v_img;
var h_img;
var ns4 = (document.layers)? true:false;




function mover(a){
vimg = a;
himg = a + 1;

if (ns4 == true) {
	document.images['l' + vimg].src = path + "images/m_line_b.gif";
	document.images['m' + a].src = over[a];
	document.images['l' + himg].src = path + "images/m_line_b.gif";
	}else{
	
	document.getElementById('l' + vimg).src = path + "images/m_line_b.gif";
	document.getElementById('m' + a).src = over[a];
	document.getElementById('l' + himg).src = path + "images/m_line_b.gif";
	
		}

}

function mout(a){

vimg = a;
himg = a + 1;


if (a == 0) { 

		v_img = "c";
		h_img = "a"; 
	} else {
		v_img = "a";
		h_img = "a"; 
}

if (a == 6) { 
//if (a == 4) { 
		v_img = "a";
		h_img = "c";  
	} 

if (ns4 == true) {
	document.images['l' + vimg].src = path + "images/m_line_" + v_img + ".gif";
	document.images['m' + a].src = norm[a];
	document.images['l' + himg].src = path + "images/m_line_" + h_img + ".gif";
	}else{
	document.getElementById('l' + vimg).src = path + "images/m_line_" + v_img + ".gif";
	document.getElementById('m' + a).src = norm[a];
	document.getElementById('l' + himg).src = path + "images/m_line_" + h_img + ".gif";
	}

}