function getMousePos(e, bXOrY) {

  if( !e ) {
    if( window.event ) {
      //Internet Explorer
      e = window.event;
    } else {
      //total failure, we have no way of referencing the event
      return 0;
    }
  }
  if( typeof( e.pageX ) == 'number' ) {
    //most browsers
    var xcoord = e.pageX;
    var ycoord = e.pageY;
    if (bXOrY)
	return xcoord;
    else
	return ycoord;
  } else if( typeof( e.clientX ) == 'number' ) {
    //Internet Explorer and older browsers
    //other browsers provide this, but follow the pageX/Y branch
    var xcoord = e.clientX;
    var ycoord = e.clientY;
    var badOldBrowser = ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) ||
     ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ||
     ( navigator.vendor == 'KDE' );
    if( !badOldBrowser ) {
      if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //IE 4, 5 & 6 (in non-standards compliant mode)
        xcoord += document.body.scrollLeft;
        ycoord += document.body.scrollTop;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE 6 (in standards compliant mode)
        xcoord += document.documentElement.scrollLeft;
        ycoord += document.documentElement.scrollTop;
      }
    }
    if (bXOrY)
	return xcoord;
    else
	return ycoord;
  } else {
    //total failure, we have no way of obtaining the mouse coordinates
    return 0;
  }
    if (bXOrY)
	return xcoord;
    else
	return ycoord;
}

function gotoMenu(e)
{
	var currLeft = 0; 
	var currTop = 0;
	var obj = document.getElementById('head');
	do {      
		currLeft += obj.offsetLeft;      
		currTop += obj.offsetTop;    
		if (obj.offsetParent == null)
			break;
	} while(obj = obj.offsetParent)

	var xPos = getMousePos(e, true) - currLeft;
	var yPos = getMousePos(e, false) - currTop;


	if (yPos >= 121 && yPos <= 140)
	{
		if (xPos >= 60 && xPos <= 92)
		{
			window.location = '/';
		}
		if (xPos >= 116 && xPos <= 197)
		{
			window.location = '/kurser.asp';
		}
		if (xPos >= 223 && xPos <= 324)
		{
			window.location = '/program.asp';
		}
		if (xPos >= 350 && xPos <= 449)
		{
			window.location = '/konsulttjanster.asp';
		}
		if (xPos >= 469 && xPos <= 564)
		{
			window.location = '/om_informer.asp';
		}
		if (xPos >= 581 && xPos <= 635)
		{
			window.location = '/kontakt.asp';
		}
	}
}
function changeCursor(e)
{
	var currLeft = 0; 
	var currTop = 0;
	var obj = document.getElementById('head');
	var objHead = document.getElementById('head');
	do {      
		currLeft += obj.offsetLeft;      
		currTop += obj.offsetTop;    
		if (obj.offsetParent == null)
			break;
	} while(obj = obj.offsetParent)

	var xPos = getMousePos(e, true) - currLeft;
	var yPos = getMousePos(e, false) - currTop;


	var cursType = "pointer";

	if (yPos >= 121 && yPos <= 140)
	{
		if (xPos >= 60 && xPos <= 92)
		{

	            objHead.style.cursor = cursType;
		}
		else if (xPos >= 116 && xPos <= 197)
		{
		   objHead.style.cursor = cursType;
		}
		else if (xPos >= 223 && xPos <= 324)
		{
		  objHead.style.cursor = cursType;
		}
		else if (xPos >= 350 && xPos <= 449)
		{
		  objHead.style.cursor = cursType;
		}
		else if (xPos >= 469 && xPos <= 564)
		{
			 objHead.style.cursor = cursType;
		}
		else if (xPos >= 581 && xPos <= 635)
		{
			 objHead.style.cursor = cursType;
		}
		else
  		{
		        objHead.style.cursor = "auto";
		}
	}
	else
 	{
	        objHead.style.cursor = "auto";
	}
}
