/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "pics/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg");

overSources = new Array("empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg","empty.jpg");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();
subInfo[8] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo[1][1] = new Array("Aufbau","/haaraufbau.html","");
subInfo[1][2] = new Array("Irrt&uuml;mer","/irrtuemer.html","");
subInfo[1][3] = new Array("Ursachen","/ursachen.html","");
subInfo[1][4] = new Array("Diagnose","/diagnose.html","");
subInfo[1][5] = new Array("Therapie","/therapie.html","");
subInfo[1][6] = new Array("Transplantation","/transplantation.html","");
subInfo[1][7] = new Array("Arten v. Haarausfall","/arten.html","");
subInfo[1][8] = new Array("Vorher/Nacher","/vorher-nacher.html","");

subInfo[2][1] = new Array("Lipom","/fettabsaugen-spezial.html","");
subInfo[2][2] = new Array("Schweissdrüsen","/fettabsaugen-schwitzen.html","");
subInfo[2][3] = new Array("lipödem","/lipoedem.html","");
subInfo[2][4] = new Array("Besenreiser","/besenreiser.html","");
subInfo[2][5] = new Array("Resurfacing","/falten-resurfacing.html","");
subInfo[2][6] = new Array("Lipodystrophie","/lipodystrophie.html","");
subInfo[2][7] = new Array("Lippenaufbau","/lippenaufbau.html","");
subInfo[2][8] = new Array("Rejuvenation","/falten-rejuvenation.html","");
subInfo[2][9] = new Array("Preise/Kosten","/preise-kosten.html","");

subInfo[3][1] = new Array("Allgemeines","/fettabsaugung-allgemein.html","");
subInfo[3][2] = new Array("M&ouml;glichkeiten","/fettabsaugen-moeglichkeiten.html","");
subInfo[3][3] = new Array("Absaug Regionen","/fettabsaugen-regionen.html","");
subInfo[3][4] = new Array("Die Vorbereitung","/fettabsaugen-vorbereitung.html","");
subInfo[3][5] = new Array("Die Operation","/fettabsaugen-operation.html","");
subInfo[3][6] = new Array("Nachbehandlung","/fettabsaugen-nach-op.html","");
subInfo[3][7] = new Array("Beine (Reiterhosen)","/fettabsaugen-reiterhosen.html","");
subInfo[3][8] = new Array("Arme","/fettabsaugen-arme.html","");
subInfo[3][9] = new Array("Hals-Nacken","/fettabsaugen-hals.html","");
subInfo[3][10] = new Array("R&uuml;cken","/fettabsaugen-ruecken.html","");
subInfo[3][11] = new Array("Bauch","/fettabsaugen-bauch.html","");
subInfo[3][12] = new Array("Kinn Doppelkinn","/fettabsaugen-doppelkinn.html","");
subInfo[3][13] = new Array("Brust","/fettabsaugen-brust.html","");
subInfo[3][14] = new Array("Hüfte","/fettabsaugen-huefte.html","");
subInfo[3][15] = new Array("Po","/fettabsaugen-po.html","");
subInfo[3][16] = new Array("Fettweg-Spritze","/fettwegspritze.html","");
subInfo[3][17] = new Array("Preise/Kosten","/preise-kosten.html","");

subInfo[4][1] = new Array("Allgemeines","/falten-allgemeines.html","");
subInfo[4][2] = new Array("Zornesfalten","/falten-zornesfalten.html","");
subInfo[4][3] = new Array("Stirnfalten","/falten-stirnfalten.html","");
subInfo[4][4] = new Array("Krähenfüsse","/falten-kraehenfuesse.html","");
subInfo[4][5] = new Array("mit Botox","/falten-botox.html","");
subInfo[4][6] = new Array("mit Kollagen","/falten-kollagen.html","");
subInfo[4][7] = new Array("mit Eigenfett","/falten-eigenfett.html","");
subInfo[4][8] = new Array("Lipofilling","/lipofilling.html","");
subInfo[4][9] = new Array("Profilplastik-Wangen","/falten-profilplastik.html","");
subInfo[4][10] = new Array("mit Artecoll","/falten-artecoll.html","");
subInfo[4][11] = new Array("mit Hyaluronsäure","/falten-hyaluronsaeure.html","");
subInfo[4][12] = new Array("mit Sculptra","/falten-polysacharide.html","");
subInfo[4][13] = new Array("mit Goretexfäden","/falten-goretexfaeden.html","");
subInfo[4][14] = new Array("mit Aquamid","/falten-aquamid.html","");
subInfo[4][15] = new Array("mit Bio Alcamid","/falten-bio-alcamid.html","");
subInfo[4][16] = new Array("Dermabrasion","/falten-dermabrasion.html","");

subInfo[5][1] = new Array("Fettabsaugen Mann","/fettabsaugung-bilder.html","");
subInfo[5][2] = new Array("Fettabsaugen Frauen","/fettabsaugung-bilder1.html","");

subInfo[6][1] = new Array("News","/news.html","");
subInfo[6][2] = new Array("Ärzte Schulungen","/fettabsaugung-aerzte-schulungen.html","");
subInfo[6][3] = new Array("Richtpreise","/preise-kosten.html","");
subInfo[6][4] = new Array("Interessante Links","/interessante-links.html","");

subInfo[7][1] = new Array("Kontakt Dr. Zoppelt Freiburg","/zoppelt_kontakt_de.html","");
subInfo[7][2] = new Array("Kontakt Dr. Zoppelt","/zoppelt_kontakt_ch.html","");
subInfo[7][3] = new Array("Impressum","/impressum.html","");
subInfo[7][4] = new Array("Sitemap","/sitemap.html","");
//subInfo[7][4] = new Array("Anfahrt","#","");



//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = -20;
var ySubOffset = 8;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1000;
totalButtons = upSources.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if( subInfo[x+1].length < 1 ) 
	{ 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} 
	else 
	{
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;');
		document.write('setOverImg(\'' + (x+1) + '\',\'\');"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
		document.write('setOutImg(\'' + (x+1) + '\',\'\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) 
		{
			document.write('<li>');
			document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}





//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload() {
	for ( x=0; x<totalButtons; x++ ) {
		buttonUp = new Image();
		buttonUp.src = buttonFolder + upSources[x];
		buttonOver = new Image();
		buttonOver.src = buttonFolder + overSources[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop(id) {
	var el = getElement(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}



//preload();

