// Please leave this comment in place
// Created by: Randy Drisgill (The Mossman)
// August 17, 2007
//
// THIS OVERRIDES THE OOTB SHAREPOINT FUNCTION WHICH CAUSES ACTIVEX INSTALL ISSUES
//
// Essentially it overrides the ootb sharepoint function which calls the activex object
// See http://support.microsoft.com/default.aspx/kb/931509 for info on the issue
//
// To use in masterpage use this syntax in the <head>:
//  	<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
//   	<script type="text/javascript" src="/_catalogs/masterpage/custom_activex_override.js"></script>


	function ProcessDefaultOnLoad(onLoadFunctionNames)
	{
		//** Uncomment this to see when this runs
		//alert('Fixing the Issue');
		
		ProcessPNGImages();
		UpdateAccessibilityUI();
		
		//** We comment out the offending ootb function
		//** and leave the rest of the functions as they were
		//ProcessImn();
		for (var i=0; i < onLoadFunctionNames.length; i++)
		{
			var expr="if(typeof("+onLoadFunctionNames[i]+")=='function'){"+onLoadFunctionNames[i]+"();}";
			eval(expr);
		}
		if (typeof(_spUseDefaultFocus)!="undefined")
			DefaultFocus();
	}	
	
	
	
	/*Javascript voor hoogte van de kolommen in Building Breda*/
		function setSize()
	{
		
		document.getElementById("bb_positionbox2").style.height = getHeight()- 181 - 80 + "px"; /*toprow (80) - header 94 + 7 border(101) - bottomrow (80)*/

		if (document.getElementById("bb_contentcentercontainer").offsetHeight + 181 + 80 > getHeight())
		{
				document.getElementById("bb_positionbox2").style.height = document.getElementById("bb_contentcentercontainer").offsetHeight + "px";							
		}

		if (document.getElementById("bb_contentrightcontainer").offsetHeight > getHeight() - 181 - 80 && document.getElementById("bb_contentrightcontainer").offsetHeight > document.getElementById("bb_contentcentercontainer").offsetHeight && document.getElementById("bb_contentrightcontainer").offsetHeight > document.getElementById("bb_contentleftcontainer").offsetHeight) 		
		{
			document.getElementById("bb_positionbox2").style.height = document.getElementById("bb_contentrightcontainer").offsetHeight + "px";			
		}
	
		if (document.getElementById("bb_contentleftcontainer").offsetHeight + 50 > getHeight() - 181 - 80 && document.getElementById("bb_contentleftcontainer").offsetHeight + 50 > document.getElementById("bb_contentcentercontainer").offsetHeight && document.getElementById("bb_contentleftcontainer").offsetHeight + 50 > document.getElementById("bb_contentrightcontainer").offsetHeight) 		
		{
			document.getElementById("bb_positionbox2").style.height = document.getElementById("bb_contentleftcontainer").offsetHeight + 50 + "px";			
		}
	
		document.getElementById("bb_contentleft").style.height = document.getElementById("bb_positionbox2").offsetHeight + "px";							
		document.getElementById("bb_contentcenter").style.height = document.getElementById("bb_positionbox2").offsetHeight + "px";							
		document.getElementById("bb_contentright").style.height = document.getElementById("bb_positionbox2").offsetHeight + "px";
	
	}
	
/*		BrowserDetect.version BrowserDetect.name */ 

			
	function getHeight() 
	{
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) 
		{
			//Non-IE
		    myWidth = window.innerWidth;
		    myHeight = window.innerHeight;
		    
		} 
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
		{
			//IE 6+ in 'standards compliant mode'
		    myWidth = document.documentElement.clientWidth;
		    myHeight = document.documentElement.clientHeight;
		} 
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
		{
		    //IE 4 compatible
		    myWidth = document.body.clientWidth;
		    myHeight = document.body.clientHeight;
		}

		return myHeight;
	}

	function getWidth() 
	{
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) 
		{
			//Non-IE
		    myWidth = window.innerWidth;
		    myHeight = window.innerHeight;
		} 
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
		{
			//IE 6+ in 'standards compliant mode'
		    myWidth = document.documentElement.clientWidth;
		    myHeight = document.documentElement.clientHeight;
		} 
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
		{
		    //IE 4 compatible
		    myWidth = document.body.clientWidth;
		    myHeight = document.body.clientHeight;
		}

		return myWidth;

	}

	
	function alertSize() 
	{
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ) 
		{
			//Non-IE
		    myWidth = window.innerWidth;
		    myHeight = window.innerHeight;
		} 
		else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
		{
			//IE 6+ in 'standards compliant mode'
		    myWidth = document.documentElement.clientWidth;
		    myHeight = document.documentElement.clientHeight;
		} 
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
		{
		    //IE 4 compatible
		    myWidth = document.body.clientWidth;
		    myHeight = document.body.clientHeight;
		}
			window.alert( 'Width = ' + myWidth );
			window.alert( 'Height = ' + myHeight );
	}

