function setupFooter() {
	ad = getObject("AdArea");
	menu = getObject("MenuArea");
	content = getObject("ContentArea");
	right = getObject("RightResourceArea");
	footer = getObject("FooterArea");

	menuStyle = getStyleObject("MenuArea");
	footerStyle = getStyleObject("FooterArea");
	
	adHeight = getLayerHeight( ad );
	menuHeight = getLayerHeight( menu );
	contentHeight = getLayerHeight( content );
	rightHeight = getLayerHeight( right );
	
	maxHeight = adHeight;
	
	if( menuHeight > maxHeight )
		maxHeight = menuHeight;
	
	if( contentHeight > maxHeight )
		maxHeight = contentHeight;

	if( rightHeight > maxHeight )
		maxHeight = rightHeight;
	
	footerStyle.top = (parseInt(menuStyle.top) + maxHeight + 10);
	footerStyle.visibility = (ns4) ? "show":"visible";
}


// javascript:popupWindow('/Templates/PlainPage.aspx?id=2800',300,200);
function popupWindow( winUrl , w , h , resize , scrolling ) {
	
	var now = new Date();
	var winNameAddon = now.getFullYear() + "" + now.getHours() + "" + now.getMinutes() + "" + now.getSeconds();
	
	winName = "Kanal5_Popup_" + winNameAddon;
	
	winResize = (resize) ? "1":"0";
	winScroll = (scrolling) ? "1":"0";
	
	winFeatures = "width=[width],height=[height],toollbar=0,scrollbars=[scrolling],status=0,menubar=0,location=0,resizable=[resize]";


	winFeatures = winFeatures.replace( "[width]" , w );
	winFeatures = winFeatures.replace( "[height]" , h );
	winFeatures = winFeatures.replace( "[resize]" , winResize );
	winFeatures = winFeatures.replace( "[scrolling]" , winScroll );

	window.open( winUrl , winName , winFeatures );
}


		
function getStyleObject( s ) {
	if( ns4 )
		return document.layers[s];
	else if( dom )
		return ( document.getElementById( s ) != null ) ? document.getElementById( s ).style:null;
	else if( ie )
		return ( document.all[ s ] != null ) ? document.all[ s ].style:null;
	
	return null;
}


function getObject( s ) {
	if( ns4 )
		return document.layers[s];
	else if( dom )
		return ( document.getElementById( s ) != null ) ? document.getElementById( s ):null;
	else if( ie )
		return ( document.all[ s ] != null ) ? document.all[ s ]:null;
	
	return null;
}


function getLayerHeight( o )  {
	if (ns4)
		return o.clip.height;
	else
		return o.offsetHeight;
}




// copyright 1998 Idocs, Inc. http://www.idocs.com/tags/
// Distribute this script freely, but please keep this 
// notice with the code.

// var image information object
var mloi=new Object();

// set the image for swapping
function setswap()
{
if (! document.images)return;
var imgInfo=new Object();
imgInfo.defaultImg = new Image();
imgInfo.defaultImg.src = document.images[arguments[0]].src;
imgInfo.opts = new Object();
for (var i=1; i < arguments.length; i=i+2)
   {
   imgInfo.opts[arguments[i]]=new Image();
   imgInfo.opts[arguments[i]].src = arguments[i+1];
   }
mloi[arguments[0]] = imgInfo;
}

// set up the link for swapping
function swap(link,imgName,optName)
{
if (! document.images)return;
if (! link.swapReady)
   {   
   link.imgName    = imgName;
   link.onmouseout = swapBack;
   link.swapReady  = true;
   }
document.images[imgName].src=mloi[imgName].opts[optName].src;
}

function swapBack()
   {document.images[this.imgName].src=mloi[this.imgName].defaultImg.src}
