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);

var is_ie7 = (   (version = parseFloat(navigator.appVersion.split("MSIE")[1]))
    		    && version >=7
   		   ) ? 1 : 0;

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{
		if (is_ie7)
			my_height=document.documentElement.clientHeight;
		else
			my_height=document.body.clientHeight;
	}
}

//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.00 */
	if(document.getElementById){
		var centerDiff = 25; // footer
		var leftDiff = 174 + 57 + 25; // logo + bottom + footer
		var tableHeight = document.getElementById("pageTable").offsetHeight;
		var desiredHeight = tableHeight > my_height ? tableHeight : my_height;
		var desiredLeftHeight = desiredHeight - leftDiff;
		var desiredCenterHeight = desiredHeight - centerDiff;
		document.getElementById("leftMenuTD").height = desiredLeftHeight;
		document.getElementById("mainTableCenter").height = desiredCenterHeight;
	}
}

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 mailpage(_str)
{/*   version 1.4.0.01 */
   mail_str = "";
   if(!_str){
      mail_str += location.href;
   }else{
      chek = _str.substr(0,_str.indexOf('_title_')) + "'" + document.title + "'"
      bodi = _str.substr(_str.indexOf('_title_')+7,_str.length)
      bodi = bodi.substr(0,bodi.indexOf('_title_')) + "'" + document.title + "'" + bodi.substr(bodi.indexOf('_title_')+7,bodi.length)
      bodi = bodi.substr(0,bodi.indexOf('_url_')) + location.href + bodi.substr(bodi.indexOf('_url_')+5,bodi.length)

      mail_str = "mailto:?subject=" + chek;
      mail_str += "&body=" + bodi;
   }
   location.href = mail_str;
}

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 flashChecker()
{

var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i];
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
/*
if ( MM_FlashCanPlay ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
	document.write(' ID="$TI" WIDTH="$WI" HEIGHT="$HE" ALIGN="$HA">');
	document.write(' $PO ');
	document.write(' <EMBED $PE ');
	document.write(' swLiveConnect=FALSE WIDTH="$WI" HEIGHT="$HE" NAME="$TI" ALIGN="$HA"');
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
	document.write(' </EMBED>');
	document.write(' </OBJECT>');
} else{
	document.write('<IMG SRC=$IS WIDTH="$IW" HEIGHT="$IH" usemap=$IU BORDER=0>');
}
*/
if ( MM_FlashCanPlay ) {
   alert("Flash plugin installed and activated")
}else{
   alert("Flash plugin not installed or deactivated !\n\nUnable to play movie")
}

}
//flashChecker()


/* deo scripta koji se odnosi na stranu */
/*             portfolio                */

preImg = new Array()
preImg[0] = new Image()
preImg[1] = new Image()
preImg[2] = new Image()
preImg[3] = new Image()
preImg[0].src = "../../Data/Images/Portfolio/01printOv.gif"
preImg[1].src = "../../Data/Images/Portfolio/02videoOv.gif"
preImg[2].src = "../../Data/Images/Portfolio/03zvukOv.gif"
preImg[3].src = "../../Data/Images/Portfolio/04multiOv.gif"

function refOver(id)
{
	if(id==null){
		return
	}
   if(!id.parentNode){
		return
	}
	t_cell = id.parentNode;
	t_tabl = t_cell.parentNode;
	t_klas = t_tabl.className;
	if(t_klas){
		if(	t_klas.indexOf("refLayoutItem")!=-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 refOut(id)
{
   if(id==null){
      return
	}
   if(!id.parentNode){
		return
	}
   t_cell = id.parentNode;
	t_tabl = t_cell.parentNode;
	t_klas = t_tabl.className;
	if(t_klas){
		if(	t_klas.indexOf("refLayoutItem")!=-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)
			}
		}
	}
}



var windowVar = null

function myZoom(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
	}
	if(_height == null){
//		_height = h + 35
		_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("Data/zoom.html?pic="+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(id,lvl)
{
   if(id==null)
      return
   if(lvl==null)
      return
   t_cell = id.parentNode.parentNode.parentNode.parentNode.parentNode
	t_tabl = t_cell.parentNode.parentNode.parentNode
	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 menu_out(id,lvl)
{
   if(id==null)
      return
   if(lvl==null)
      return
   t_cell = id.parentNode.parentNode.parentNode.parentNode.parentNode
	t_tabl = t_cell.parentNode.parentNode.parentNode
	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 menu_click(id,lvl)
{
	if(id==null)	return
	if(lvl==null)	return
	t_cell = id.parentNode.parentNode.parentNode.parentNode.parentNode
	t_tabl = t_cell.parentNode.parentNode.parentNode
	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_tabl.className = t_klas.substr(0,t_klas.length-2)+"ov"
   else
			if(	t_klas.substr(t_klas.length-2,t_klas.length-1)=="ov")
				t_tabl.className = t_klas.substr(0,t_klas.length-2)+"on"
			else
				t_tabl.className = t_klas+"on"
}

