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
}

var windowVar = null
//function myZoom(pic,w,h,_width,_height,_align,_valign){
function myZoomImage(pic,w,h,_width,_height,_align,_valign){
	my_screen_width = screen.width
	my_screen_height = screen.height
	my_screen_avail_width = my_screen_width - 0
	my_screen_avail_height = my_screen_height - 30 - 27

	def_win_border_height = 0//29 do 52
	def_win_border_width = 0//9 do 10

	def_align = "center"
	def_valign = "middle"
	def_width = 800
	def_height = 600

	_scroll = "no"
	if(_width == null){
		_width = w + 30
	}
	if(_height == null){
		_height = h + 50
//		_height = h
	}
	if(_height>my_screen_avail_height || h>my_screen_avail_height){
		_width += 16
		_height = my_screen_avail_height
		_scroll = "yes"
	}
	if(_align==null){
		_align = def_align
	}else{
		if(_align!="left" && _align!="right"){
			_align = def_align
		}
	}
	if(_valign==null){
		_valign = def_valign
	}else{
		if(_valign!="top" && _valign!="bottom"){
			_valign = def_valign
		}
	}

	_left = (my_screen_avail_width - def_win_border_width - _width)
	_top = (my_screen_avail_height - def_win_border_height - _height)
//		alert(my_screen_avail_height+", "+my_screen_height)
	if(_left < 0 || _align == "left"){
		_left = 0
	}
	if(_align == "center"){
		_left = Math.round(_left/2)
	}

	if(_top < 0 || _valign == "top"){
		_top = 0
	}
	if(_valign == "middle"){
		_top = Math.round(_top/2)
	}


   if(windowVar && windowVar.close){
      windowVar.close()
   }
	windowVar = window.open("index.php?st_location=home&st_version=active&structure_template_type=zoom&image_id="+pic+"&w="+w+"&h="+h,"Zoom","toolbar=no,location=no,diretories=no,scrollbars="+_scroll+",status=no,menubar=no,resizable=yes,top="+_top+",left="+_left+",height="+_height+",width="+_width+"");
	windowVar.focus();
}

function menu_over(){
}

function menu_out(){
}


