// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false;

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) window.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;;
document.onscroll = getMouseXY;;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;
var wid;
var hit;
var logo=document.getElementById('logo');
var logof=document.getElementById('logo-fixed');
// Main function to retrieve mouse x-y pos.s

var hidden=0;
function hide(hide){
	if (hidden==0 && hide==1)
	{
		logo.style.display='none';
		logof.style.top='auto';
		logof.style.bottom='0px';
		if (IE)
		{
			logof.style.display='none';
		}
		hidden=1;
	}
	else
	{
		if (hide==0 && hidden==1)
		{
			logo.style.display='block';
			logof.style.top='0px';
			logof.style.bottom='auto';
			hidden=0;
			if (IE)
			{
				logof.style.display='block';
			}
		}
	}
}

function getMouseXY(e) {
var OX;
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX;
    OX=document.body.scrollTop;
    tempY = event.clientY;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX-window.pageXOffset;
    OX=window.pageYOffset;
    tempY = e.pageY-window.pageYOffset;
  }  
  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0;}
  if (tempY < 0){tempY = 0;}  
  
    wid = window.innerWidth;
    hit = window.innerHeight;
	if (document.all != null){
	    wid = document.body.clientWidth;
	    hit = document.body.clientHeight;
	}
	if (((wid-tempX)<265)&&((tempY)<120))
	{
		hide(1);
	}
	else
	{
		hide(0);
	}
  return true;
}
