
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var db = (document.body) ? 1 : 0;
 var scroll = (window.scrollTo) ? 1 : 0;

 function setCookie(name, value) {
  var curCookie = name + "=" + escape(value) + ";";
  document.cookie = curCookie;
 }

 function getCookie(name) {
  var arg = name + "=";
  var argLength = arg.length;
  var cookieLength = document.cookie.length;

  var i = 0;
  while (i < cookieLength)
  {
   var j = i + argLength;
   if (document.cookie.substring(i, j) == arg){
   var endstr = document.cookie.indexOf (";", j);
   if (endstr == -1) {
    endstr = document.cookie.length;
   }
   return unescape(document.cookie.substring(j, endstr));
   }

  //increment while loop from next cookie element in document.cookie
   i = document.cookie.indexOf(" ", i) + 1;
   if (i == 0) {
   break;
   }
  }
  return null;
 }

 function saveScroll() {
  if (!scroll) return;
  var x = 0;
  var y = 0;

  if (window.pageYOffset) {
  // Netscape, must go first since NS supports document.body
  x = window.pageXOffset;
  y = window.pageYOffset;
  } else if (document.documentElement && document.documentElement.scrollTop) {
  // I Explorer 6
  x = document.documentElement.scrollLeft;
  y = document.documentElement.scrollTop;
  } else if (document.body) {
  // I Explorer 5
  x = document.body.scrollLeft;
  y = document.body.scrollTop;
  }
  setCookie("yx", x + "_" + y);
 }

 function loadScroll() {
  if (!scroll) return;
  var xy = getCookie("yx");
  if (!xy) return;
  var ar = xy.split("_");
  if (ar.length == 2) scrollTo(parseInt(ar[0]), parseInt(ar[1]));    
 }


function toggle(elem){
	// blendet Dioptrien Table ein/aus
  obj=document.getElementById("therow");
	if (elem == 0){
	  obj.style.visibility="hidden";
	  obj.style.display=( (obj.style.display=='none') ? '' : 'none');
	}

	if (elem == 1){
	  obj.style.visibility="visible";
	  obj.style.display=( (obj.style.display=='block') ? '' : 'block');
	}

}


function other(elem){

  obj=document.getElementById("therow");

  if (elem.options[elem.selectedIndex].value == 0){
  obj.style.visibility='hidden';
  obj.style.display=( (obj.style.display=='none') ? '' : 'none');
  }
  if (elem.options[elem.selectedIndex].value == 1){
  obj.style.visibility='visible';
  obj.style.display=( (obj.style.display=='block') ? '' : 'block');
  return true;
}
}



/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function getDocHeight(doc) {
  var docHt = 0, sh, oh;
  if (doc.height) docHt = doc.height;
  else if (doc.body) {
    if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
    if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
    if (sh && oh) docHt = Math.max(sh, oh);
  }
  return docHt;
}

function setIframeHeight(iframeName) {
  var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if ( iframeEl && iframeWin ) {
    iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous  
    var docHt = getDocHeight(iframeWin.document);
    // need to add to height to be sure it will all show
    if (docHt) iframeEl.style.height = docHt + 30 + "px";
  }
}

function loadIframe(iframeName, url) {
  if ( window.frames[iframeName] ) {
    window.frames[iframeName].location = url;   
    return false;
  }
  else return true;
}


function TabClick( nTab )
{	nTab = parseInt(nTab);
	var oTab;
	var prevTab = nTab-1;
	var nextTab = nTab+1;
	event.cancelBubble = true;
	el = event.srcElement;
	for (var i = 0; i < content.length; i++)
	{		oTab = tabs[i];
		oTab.className = "clsTab";
		oTab.style.borderLeftStyle = "";
		oTab.style.borderRightStyle = "";
		content[i].style.display = "none";
	}
	content[nTab].style.display = "block";
	tabs[nTab].className = "clsTabSelected";
	oTab = tabs[nextTab];
	if (oTab) oTab.style.borderLeftStyle = "none";
		oTab = tabs[prevTab];
	if (oTab) oTab.style.borderRightStyle = "none";
		event.returnValue = false;
	}



function text2float(txt)				//x,yz => x.yz
{
	var i = txt.indexOf(",");
	if (i >= 0)
	{
		txt = txt.substring(0,i)+'.'+txt.substr(i+1,4);		//Neu-Erstellen des Strings
	}

	if (isNaN(txt) || (txt == ""))		//Wenn nur Kokolores eingegeben wurde
	{
		txt = 0.00;
	}
	else
	{
		txt = parseFloat(txt);
	}
	return txt;
}

function float2text(f_number)		//x.yz =>	x,yz
{
	var i, tmp = "", j = 0, nullen = 4;
	f_number = f_number.toString(10);
	i = f_number.indexOf(".");
	if (i > 0)
	{
		tmp = f_number.substr(i+1,4);
		j = nullen - tmp.length;				//Wenn man hinterm Komma Nullen anzeigen moechte
		for (;j > 0; j--)								//.
		{																//.
			tmp = tmp + '0';							//.
		}																//.
		f_number = f_number.substring(0,i)+','+tmp;
	}
	return f_number;
}




