var max_page_height = 700;
var agt=navigator.userAgent.toLowerCase();
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
               && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
               && (agt.indexOf('webtv')==-1));
var is_major = parseInt(navigator.appVersion);
var is_opera = (agt.indexOf("opera") != -1);
var not_nav6 = (is_nav && (is_major < 5));
var isNN=(navigator.appName=="Netscape");

var is_opera7 = (is_opera && agt.indexOf("7.")!=-1);
var is_opera6 = (is_opera && !is_opera7);

if(!document.getElementById){
	if(eval){
	   document.getElementById = eval
	}
}

var my_height;
function detect_height()
{/*   version 1.4.0.00 */
	if(isNN){
		if(not_nav6){
			my_height=window.innerHeight+5;
		}else{
			my_height=window.innerHeight;
		}
	}else if(is_opera){
		my_height=window.innerHeight;
	}else{
		my_height=document.body.clientHeight;
	}
}
//detect_height()

//window.onresize = resizer
//window.onerror = handle_error
var msg_array = new Array()
var url_array = new Array()
var lno_array = new Array()

function handle_error(msg,url,lno)
{/*   version 1.4.0.01 */
   msg_array[msg_array.length] = msg
   url_array[url_array.length] = url
   lno_array[lno_array.length] = lno
   pom = "*** Mssg No. : "+msg_array.length
   pom+= (lno_array.length>0) ? " (ln:"+lno_array[0]+")" : ""
   window.status = pom
   return true
}

function starer(){
	detect_height()
	sredi_sadrzaj()
}
function resizer(){
	detect_height()
//	setTimeout("sredi_sadrzaj()",100)
	sredi_sadrzaj()
}
function sredi_sadrzaj()
{/*   version 1.4.0.01 */

	if(document.getElementById){
	   if(document.getElementById("searchbox").style){
			document.getElementById("searchbox").style.visibility = "hidden"
	      document.getElementById("bottommenu").style.visibility = "hidden"
	      document.getElementById("partBRLevelX3").style.visibility = "hidden"
		}
      t_height = document.getElementById("partLevelX0").offsetHeight
      t_01 = document.getElementById("partTTLevelX0").offsetHeight + document.getElementById("gornji").offsetHeight + document.getElementById("mainbodyitem").offsetHeight + document.getElementById("bottommenu").offsetHeight
      t_02 = document.getElementById("logo").offsetHeight + document.getElementById("langmenu").offsetHeight + document.getElementById("leftmenu").offsetHeight + document.getElementById("searchbox").offsetHeight
      t_03 = 34 + document.getElementById("partTTLevelX0").offsetHeight + document.getElementById("newsmenu").offsetHeight + document.getElementById("partBRLevelX3").offsetHeight
      t_height = t_01
      t_height = (t_height>t_02)? t_height:t_02
      t_height = (t_height>t_03)? t_height:t_03
   	t_height = (t_height>my_height)? t_height:my_height
		if(document.getElementById("donji")){
		   p_height = t_height - document.getElementById("partTTLevelX0").offsetHeight - document.getElementById("gornji").offsetHeight - document.getElementById("mainbodyitem").offsetHeight
   		document.getElementById("donji").height = (p_height>0?p_height:1)
		}
		if(document.getElementById("partBLLevelX1")){
		   p_height = t_height - document.getElementById("logo").offsetHeight - document.getElementById("langmenu").offsetHeight - document.getElementById("leftmenu").offsetHeight
   		document.getElementById("partBLLevelX1").height = (p_height>0?p_height:1)
		}
		if(document.getElementById("partBRLevelX2")){
		   p_height = t_height - 34 - document.getElementById("partTTLevelX0").offsetHeight - document.getElementById("newsmenu").offsetHeight
   		document.getElementById("partBRLevelX2").height = (p_height>0?p_height:1)
		}
	   if(document.getElementById("searchbox").style){
			document.getElementById("searchbox").style.visibility = "visible"
	      document.getElementById("bottommenu").style.visibility = "visible"
	      document.getElementById("partBRLevelX3").style.visibility = "visible"
		}
	}
}

function printOrder(_url)
{/*   version 1.4.0.00 */
	printWindow = window.open(_url,
							  "printWindow","toolbar=0, location=0, status=1, resizable=1, menubar=1, "+
							  "scrollbars=1, width=750, height=540");
	printWindow.focus();
}

function statusWrite(_what, _when)
{/*   version 1.4.0.00 */
   if(_what == null)
      _what = "";
   if(_when == null)
      _when = 10;
   statusTimeout = setTimeout("window.status='"+_what+"'",_when)
}

function popup(_url)
{/*   version 1.4.0.00 */
	popupWindow = window.open(_url,
							  "popupWindow","toolbar=0, location=0, status=1, resizable=1, menubar=0, "+
							  "scrollbars=1, width=790, height=540");
	popupWindow.focus();
}

function notification(_text)
{/*   version 1.4.0.00 */
	alert(_text);
}

function sendmail(_to,_subject,_body)
{/*   version 1.4.0.00 */
   _code = "utf-8";
   _to = "info@erlebniswelt-waldbronn.de"
   _subject = "Internetpraesenz%20&quot;Erlebniswelt%20Waldbronn&quot;"
   _body = "Firma:%20%0D%0AName:%20%0D%0AVorname:%20%0D%0AStrasse:%20%0D%0APLZ/Stadt:%20%0D%0ALand:%20%0D%0ATelefon:%20%0D%0ATelefax:%20%0D%0A"

   mail_str = "";
   mail_str += "mailto:"+_to
   mail_str += "?subject=" + _subject;
//   mail_str += "&charset=" + _code;
//   mail_str += "&char-set=" + _code;
//   mail_str += "&hreflang=" + _code;
//   mail_str += "&href-lang=" + _code;
   mail_str += "&body=" + _body;
   mail_str = "mailto:info@erlebniswelt-waldbronn.de?subject=Internetpraesenz%20&quot;Erlebniswelt%20Waldbronn&quot;&body=Firma:%20%0D%0AName:%20%0D%0AVorname:%20%0D%0AStrasse:%20%0D%0APLZ/Stadt:%20%0D%0ALand:%20%0D%0ATelefon:%20%0D%0ATelefax:%20%0D%0A"
   location.href = mail_str;
}

function backfrompopup()
{
//   mrt
}

function table_data_over(id,lvl)
{
   // uradjeni samo overi nad tabelom, treba uraditi overe nad linkovima!?!?!?
   if(id==null)
      return
   if(lvl==null)
      return
   if(!id.hasChildNodes())
		return
   for(var i=0; i<id.childNodes.length; i++){
      switch(id.childNodes[i].nodeType){
         // element node
         case 1:
            t_tabl = id.childNodes[i];
            break;
         // text node
         case 3:
            break;
      }
   }
   t_klas = t_tabl.className;
	if(t_klas)
		if(	t_klas.indexOf("item")!=-1 &&
			t_klas.indexOf("Level")!=-1)
			if(	t_klas.substr(t_klas.length-2,t_klas.length-1)!="on" &&
				t_klas.substr(t_klas.length-2,t_klas.length-1)!="ov")
				t_tabl.className = t_klas + "ov"
}

function table_data_out(id,lvl)
{
   // uradjeni samo overi nad tabelom, treba uraditi overe nad linkovima!?!?!?
   if(id==null)
      return
   if(lvl==null)
      return
   if(!id.hasChildNodes())
		return
   for(var i=0; i<id.childNodes.length; i++){
      switch(id.childNodes[i].nodeType){
         // element node
         case 1:
            t_tabl = id.childNodes[i];
            break;
         // text node
         case 3:
            break;
      }
   }
   t_klas = t_tabl.className;
	if(t_klas)
		if(	t_klas.indexOf("item")!=-1 &&
			t_klas.indexOf("Level")!=-1)
			if(	t_klas.substr(t_klas.length-2,t_klas.length-1)!="on" &&
				t_klas.substr(t_klas.length-2,t_klas.length-1)=="ov")
				t_tabl.className = t_klas.substr(0,t_klas.length-2)
}

function table_data_click(targetAddress,targetWindow)
{
	if(targetAddress != "empty"){
		if(targetWindow == "_self"){
			location = targetAddress;
		}else if(targetWindow == "_blank"){
			window.open(targetAddress);
		}
	}
}

function menu_over(){
}

function menu_out(){
}


