Event.observe( window, 'load', initApplication );
var pageWr = null;

function initApplication()
{
        $$('.tx-fdfx2cols-pi1 img').each( function(curImg) {curImg.style.height='auto';} );
	$$('.visual').each( function(curImg) {curImg.style.width='99%';curImg.style.height='auto';} );
	
	pageWr = $$('.pageWr')[0];
	var flash = $('pixelmorph');
	var footer = $$('.footer')[0];

	if (navigator.userAgent.indexOf( 'IE' ) == -1)
		flash = $('pixelmorph2');

	if (navigator.userAgent.indexOf( 'IE 6.0' ) != -1)
	{
		window.onresize = function()
		{
			if (document.documentElement.clientWidth < 1020)
				pageWr.style.width = '980px';
			else
				pageWr.style.width = 'auto';

			if (flash)
			    flash.style.height = flash.getWidth()/2.9468 + "px";

			footer.style.top="0px";
		}

		window.onresize();
	}
	else if (flash)
	{
	
            window.onresize = function(){flash.style.height = (flash.getWidth()/2.9468) + "px";};
            window.onresize();
         }


	var popups = $$( 'a.extLinkPopup' );
	var minPopups = $$( 'a.extLinkPopupMinimal' );
	var topLinks = $$( 'a.top' );
	var downloads = $$( '.dlDetail' );
	var pdfs = $$( '.pdfLink' );

	popups.each( function( item )
	{
		item.onclick = function() { window.open( item.href, '_blank', 'width=900,height=500,menubar=yes,location=yes,scrollbars=yes,resizable=yes' ); return false;}
	} );
	
	minPopups.each( function( item )
	{
		item.onclick = function() { window.open( item.href, '_blank', 'width=900,height=500,menubar=no,scrollbars=yes,resizable=yes' ); return false;}
	} );

	topLinks.each( function( item )
	{
		item.onclick = function() { window.scrollTo( 0,0 ); return false;}
	} );
	
	pdfs.each( function( item )
	{
		item.onclick = function() { window.open( item.href, '_blank', 'width=900,height=500,menubar=yes,location=yes,scrollbars=yes,resizable=yes' ); return false;}
	} );

	downloads.each( function(item) {item.hide();} );
	
	if (typeof(overlib) != 'undefined')
	{
		overlib.init();
		Event.observe( document.body, 'mousemove', overlib.mouseMove );
	}
}

function toggleFileDescr( id )
{
	new Effect.toggle( $(id), 'slide', {duration:0.1} );
}


// TYPO3 Functions
		var browserName = navigator.appName;

		var browserVer = parseInt(navigator.appVersion);

		var version = "";

		var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);

		if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName

=="Opera") {version = "n3";} else {version = "n2";}

			// Blurring links:

		function blurLink(theObject)	{	//

			if (msie4)	{theObject.blur();}

		}

		

			// decrypt helper function

		function decryptCharcode(n,start,end,offset)	{

			n = n + offset;

			if (offset > 0 && n > end)	{

				n = start + (n - end - 1);

			} else if (offset < 0 && n < start)	{

				n = end - (start - n - 1);

			}

			return String.fromCharCode(n);

		}

			// decrypt string

		function decryptString(enc,offset)	{

			var dec = "";

			var len = enc.length;

			for(var i=0; i < len; i++)	{

				var n = enc.charCodeAt(i);

				if (n >= 0x2B && n <= 0x3A)	{

					dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :

				} else if (n >= 0x40 && n <= 0x5A)	{

					dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @

				} else if (n >= 0x61 && n <= 0x7A)	{

					dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z

				} else {

					dec += enc.charAt(i);

				}

			}

			return dec;

		}

			// decrypt spam-protected emails

		function linkTo_UnCryptMailto(s)	{

			location.href = decryptString(s,-1);

		}

function T3_onloadWrapper()
{

}
