//JS standardmaessig deaktiviert
JS_enabled						= false;

//init-Routine
function initJS()
  {
  JS_enabled					= true;
  }


// Simple Browser Check
var ns4 = (document.layers) ? 1 : 0;
var ie  = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;

//ueberprueft, ob in einem String (strToCheck) nur erlaubte Zeichen (strTyp) enthalten sind
function checkValue(strToCheck,strTyp)
  {
  for(i=0;i<strToCheck.length;i++)
    {
	if(strTyp.indexOf(strToCheck.charAt(i)) == -1)
	  {
	  return false;
	  }
	}
  return true;
  }
  
function openAWindowPro(strPfad,strTitel,strOptions)
  {
  window.open(strPfad,strTitel,strOptions);
  }
 
function JS_openWindow(strURL,strName,strOptions)
  {
  window.open(strURL,strName,strOptions);
  }
  
function removeCharFromString(iStr, iChr)
  {
  var startpos = 0;
  var foundpos = 0;
  var newStr   = "";
  while ((foundpos = iStr.indexOf(iChr, startpos)) >= 0)
    {
    newStr = newStr + iStr.substring(startpos, foundpos);
    startpos = foundpos + iChr.length;
    }
  return newStr + iStr.substring(startpos);
  }

//function fuer den adminbereich
function goAdmin()
  {
  document.location.href	= JS_rb+'admin/';
  }
  
//div funktionen
function showDiv(strElement)
  {
  if(ie)
    {
	eval(strElement).style.visibility							= 'visible';
	}
  else if(ns4)
    {
	document.eval(strElement).visibility						= 'show';
	}
  else if(ns6)
    {
	document.getElementById(strElement).style.visibility		= 'visible';
	}
  }
  
function hideDiv(strElement)
  {
  if(ie)
    {
	eval(strElement).style.visibility							= 'hidden';
	}
  else if(ns4)
    {
	document.eval(strElement).visibility						= 'hide';
	}
  else if(ns6)
    {
	document.getElementById(strElement).style.visibility		= 'hidden';
	}
  }
  
  
  
//popup-fenster, welches erst verschwindet, wenn es tatsaechlich geschlossen wird
//aufruf: modelesswin("http://yahoo.com",600,600)
function modelesswin(url,mwidth,mheight,strOptions,strName)
  {
  if(strOptions != '')
    {
	strOptions		= ','+strOptions;
	}

  if(document.all&&window.print&&1==2) //if ie5
	{
	eval('window.showModelessDialog(url,"","help:0;resizable:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")');
	}
  else
    {
	if(modelesswin.arguments.length == 4)
	  {
	  eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px'+strOptions+'")');
	  }
	else
	  {
	  eval('window.open(url,\''+strName+'\',"width='+mwidth+'px,height='+mheight+'px'+strOptions+'")');
	  }
	}
  }
