function getTotalHeight(){
	//Getting height of wrapper div
	var topHeight = 190;
	var contentHeight = document.getElementById("wrapper").offsetHeight;
	var bottomSpace = 100;
	var fullHeight = topHeight + contentHeight + bottomSpace;
   
   // Checking for max avail height in browser
   if(fullHeight < window.innerHeight){
	    fullHeight = window.innerHeight;	    
	}
	//Equivalent for ie
	if(fullHeight < document.body.clientHeight){
	    fullHeight = document.body.clientHeight;
	}
    
// ====================================================================
//       URLEncode and URLDecode functions
//
// Copyright Albion Research Ltd. 2002
// http://www.albionresearch.com/
//
// You may copy these functions providing that 
// (a) you leave this copyright notice intact, and 
// (b) if you use these functions on a publicly accessible
//     web site you include a credit somewhere on the web site 
//     with a link back to http://www.albionresearch.com/
//
// If you find or fix any bugs, please let us know at albionresearch.com
//
// SpecialThanks to Neelesh Thakur for being the first to
// report a bug in URLDecode() - now fixed 2003-02-19.
// And thanks to everyone else who has provided comments and suggestions.
// ====================================================================
function URLEncode(plaintext)
{
            // The Javascript escape and unescape functions do not correspond
            // with what browsers actually do...
            var SAFECHARS = "0123456789" +                                                        // Numeric
                                                            "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +         // Alphabetic
                                                            "abcdefghijklmnopqrstuvwxyz" +
                                                            "-_.!~*'()";                                                          // RFC2396 Mark characters
            var HEX = "0123456789ABCDEF";

            //var plaintext = document.URLForm.F1.value;
            var encoded = "";
            for (var i = 0; i < plaintext.length; i++ ) {
                        var ch = plaintext.charAt(i);
                if (ch == " ") {
                            encoded += "+";                                            // x-www-urlencoded, rather than %20
                        } else if (SAFECHARS.indexOf(ch) != -1) {
                            encoded += ch;
                        } else {
                            var charCode = ch.charCodeAt(0);
                                    if (charCode > 255) {
                                        alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
                                                          "(URL encoding only supports 8-bit characters.)\n" +
                                                                          "A space (+) will be substituted." );
                                                encoded += "+";
                                    } else {
                                                encoded += "%";
                                                encoded += HEX.charAt((charCode >> 4) & 0xF);
                                                encoded += HEX.charAt(charCode & 0xF);
                                    }
                        }
            } // for
            return encoded;

};

    if(window.location.search.length > '0'){
	    var rawUrl = window.location.href + "&xml=true"
	}
	else
	{
	     var rawUrl = window.location.href + window.location.search + "?xml=true"
	}
    
    // strip # from ancor so url dont break up
    // if # in url. Remove #
	if(rawUrl.split("#")[0] != rawUrl){
	   //Capturing 
	    rawUrl = rawUrl.split("#")[0];
	    // checking for ? in url for direct anchor in url
	    if(rawUrl.split("?")[0]){
	        rawUrl = rawUrl.split("?")[0] + "?xml=true";
	    }	    
	}
   
    var xmlpath = URLEncode(rawUrl).toString();
    
	if(document.all && !window.opera){
	    window.flashMovie = new Object();
	}
	
	// Skriver flashen i html 
	var FO = { movie:"/ui/park/flash/llp_topmenu.swf", swliveconnect:"true", allowScriptAccess:"sameDomain", width:"100%", wmode:"transparent",  height:fullHeight.toString(), bgcolor:"#FFFFFF", majorversion:"8", build:"0", id:"bgflashobject", name:"bgflashobject", flashvars:"wrapperHeight=" + contentHeight + "&surl=" + xmlpath, xi:"false"  };
	UFO.create(FO, "bg-flash");
	
	/*var fo = new FlashObject( "/ui/park/flash/llp_topmenu.swf", "flashMovie", "100%", fullHeight.toString(), "8", "#FFFFFF", true );
    fo.addParam("wmode", "transparent");
    fo.addParam("swliveconnect", "true");
    fo.addParam("allowScriptAccess", "allways");
    
    fo.addVariable("wrapperHeight", contentHeight);
    fo.addVariable("surl", xmlpath);
    
	fo.write( "bg-flash" );	 		
	*/
	document.getElementById("bg-flash").style.height = fullHeight + "px";	
}

window.onload = getTotalHeight;