
var activeLang;
var imgpath = "images/"+activeLang+"/nav/";

//alert(imgpath);

var slice_dark_color = '#71787d';
var slice_light_color = '#f2f9db';
var LU_id;

/* ------------------------------------------------------------------------- */

function startePreloader() {
PreloadList = new Array();
//document.images.length
	for (xx=0;xx<document.images.length;xx++) {
	  Bildname = document.images[xx].name;
	  if (Bildname) {
		  PreloadList[Bildname] = new Image();
		  PreloadList[Bildname].src = imgpath + "mo/nav_" + Bildname + ".gif";	
	  }
	}
}

/* ------------------------------------------------------------------------- */

function setzeRollover(Bildname) {
  if ((Bildname != activeNav)) {
   document.images[Bildname].src = imgpath + "mo/nav_" + Bildname + ".gif";
   }
}

function setzeNormal(Bildname) {
   if (Bildname != activeNav) {
   document.images[Bildname].src = imgpath + "na/nav_" + Bildname + ".gif";
   }
}

function navpunktAktuell(navPunkt) {
  if (navPunkt != activeNav) {
  activeNav = navPunkt;
  document.images[activeNav].src = imgpath + "sel/nav_" + activeNav + ".gif";
  document.images[previousNav].src = imgpath + "na/nav_" + previousNav + ".gif";
  previousNav = activeNav;
  }
}

/* ------------------------------------------------------------------------- */

function neuesFenster(url,fensterName,features) {
      fensterName = window.open(url,fensterName,features);
  }

/* ------------------------------------------------------------------------- */

function inputCheck(form_name, form_input, form_input_regexp, form_alert) {
	for (i=0; i<form_input.length; i++) {
		if ( eval("document."+form_name+"."+form_input[i]) ) {
			if (!eval("document."+form_name+"."+form_input[i]+".value.match("+(form_input_regexp[i])+")") ) {
		  		alert(form_alert[i]);
				eval("document."+form_name+"."+form_input[i]+".focus();");
			  	return false;
			}
		}
	}
	return true;
}

/* ------------------------------------------------------------------------- */


function overSlice(id){
	//alert(LU_id+"-"+id);
	if ("div_"+LU_id != id) {
		document.getElementById(id).style.backgroundColor = slice_dark_color;
		document.getElementById(id+"_A").style.color =  slice_light_color;
		document.getElementById(id+"_A2").style.color =  slice_light_color;		
	}
}
function outSlice(id){
	if ("div_"+LU_id != id) {
		document.getElementById(id).style.backgroundColor = '';
		document.getElementById(id+"_A").style.color = '';
		document.getElementById(id+"_A2").style.color = '';		
	}
}

/* ------------------------------------------------------------------------- */

//var active_name = "start";

function bg_show(name) {
	if (name != active_name) {
		document.getElementById('change_bg').style.backgroundImage = "";
		document.getElementById('change_bg').style.backgroundColor = 'Black';
		bg = "url(images/bg_produkte_"+name+".jpg)";
		setTimeout("document.getElementById('change_bg').style.backgroundImage = bg;", 80);
	}
	active_name = name;
}

/* ------------------------------------------------------------------------- */

function openWindow(type, param){
	resizeX = 750;
	resizeY = 550;
	switch (type) {
		default :
			centURL = "control/showpic.php?name="+param;
			break;
	}
	// WIN2K gimmick
	if (screen.width*3 > screen.height*4) {
		moveX = Math.floor(screen.width/4 - resizeX/2);	
	} else {
		moveX = Math.floor(screen.width/2 - resizeX/2);	
	}
	moveY = Math.floor(screen.height/2 - resizeY/2 - 50);
//	winProps = "scrollbar=yes,locationbar=no,menubar=no,resizable=yes,status=yes,outerHeight="+resizeY+",outerWidth="+resizeX+",width="+resizeX+",height="+resizeY+",screenx="+moveX+",screeny="+moveY+",left="+moveX+",top="+moveY;
	winProps = "scrollbar=yes,locationbar=no,menubar=no,resizable=yes,status=no,width="+resizeX+",height="+resizeY+",screenx="+moveX+",screeny="+moveY+",left="+moveX+",top="+moveY;

	newWindow = open(centURL,"popup",winProps);
	newWindow.focus();
}