/******************************************************/
/*
/* 	Hotel Theresia
/*	Javascript Document
/* 	Copyright (c) 2007 GFB & Partner Marketing Services
/*	www.gfb.at
/*
/*	Unauthorized copying is not allowed and will be
/*	punished by an appropriate agent. In this case
/*	by an honorable cunt... me
/*
/******************************************************/



/* Navigation
------------------------------------------------------*/

//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus_horizontal(){

for (var i=0; i<menuids.length; i++){
if(document.getElementById(menuids[i])){

  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")

	for (var t=0; t<ultags.length; t++){
		if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
			ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
		}
		else{ //else if this is a sub level menu (ul)
		  //ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
		ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
		}

	ultags[t].parentNode.onmouseover=function(){
	this.getElementsByTagName("ul")[0].style.visibility="visible"
	}
	ultags[t].parentNode.onmouseout=function(){
	this.getElementsByTagName("ul")[0].style.visibility="hidden"
	}
      }
  }
}




}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)
	



// ToggleDisplay

function toggledisplay (id){
				if (document.getElementById) {
					var mydiv = document.getElementById(id);
					mydiv.style.display = (mydiv.style.display=='block'?'none':'block');		
				}
			}



// Iframe Höhenanpassung




function content_size_iframe_obj(iframe,minheight) {
			if (!window.opera && iframe) {
				var height = 0;
				if (iframe.contentDocument && iframe.contentDocument.body && iframe.contentDocument.body.offsetHeight) { //ns6 syntax
						height = iframe.contentDocument.body.offsetHeight * 1.05;
				} else if (iframe.Document && iframe.Document.body && iframe.Document.body.scrollHeight) { //ie5+ syntax
						height = iframe.Document.body.scrollHeight;
				} else {
						// use initial height then
						if (! minheight && iframe.height > 0 ) minheight=iframe.height;

				}
				if (minheight) height = Math.max(minheight, height);
				if (height) iframe.style.height = height+35+"px";
				}
		}






// Verschlüsselte eMail Adresse

    function CryptMailto()
    {
        var n = 0;
        var r = "";
        var s = "mailto:"+document.forms[0].emailField.value;
        var e = document.forms[0].emailField.value;

        e = e.replace( /@/, " [at] ");
        e = e.replace( /\./g, " [dot] ");

        for( var i=0; i < s.length; i++ )
        {
            n = s.charCodeAt( i );
            if( n >= 8364 )
            {
                n = 128;
            }
            r += String.fromCharCode(n+1);
        }
        document.forms[0].cyptedEmailField.value = r;
        document.forms[0].HTMLCyptedEmailField.value = "javascript:Security_gfbCode('"+ r +"');";
    }

    function gfbCode( s )
    {
        var n = 0;
        var r = "";
        for( var i = 0; i < s.length; i++)
        {
            n = s.charCodeAt( i );
            if( n >= 8364 )
            {
                n = 128;
            }
            r += String.fromCharCode( n - 1 );
        }
        return r;
    }

    function Security_gfbCode( s )
    {
        location.href=gfbCode( s );
    }    




