var floatingBarDiv;
var dockingBarDiv;	
var dockingBarDivImages;
var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
var MSIE456 = (navigator.userAgent.indexOf('MSIE 6.0')>=0 || navigator.userAgent.indexOf('MSIE 5.0')>=0 || navigator.userAgent.indexOf('MSIE 4.0')>=0) ?true:false;
var Opera = navigator.userAgent.indexOf('Opera')>=0?true:false;
var navigatorVersion = navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1;

function initMenuWithDocking(){
    if (!MSIE456)
        document.getElementById('imgCopyright').style.marginBottom="35px";

	dockingBarDiv = document.getElementById('dockingBar');
	
	repositionDockingBar();
	
    window.onscroll = repositionDockingBar;
	window.onresize = repositionDockingBar;
}

// "http://www.howtocreate.co.uk/tutorials/javascript/browserwindow"
function returnWindowHeight() 
{
	var  myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) 
	{
	  //Non-IE
	  myHeight = window.innerHeight;
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
	  //IE 6+ in 'standards compliant mode'
	  myHeight = document.documentElement.clientHeight;
	}   
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
	  //IE 4 compatible
	  myHeight = document.body.clientHeight;
	}

	return myHeight;
}

function repositionDockingBar()
{
    availH = returnWindowHeight() - 37;

    if (dockingBarDiv!=null){
	    if(MSIE && navigatorVersion<6){
		    dockingBarDiv.style.top = availH  + 'px';
	    }else{
		    dockingBarDiv.style.top = availH  + 'px';
	    }
	}
}

window.onload = initMenuWithDocking;