<!--
function lib_bwcheck()
{
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.opera6=this.agent.indexOf("Opera 6")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie8 || this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw = new lib_bwcheck()

function rakna_position()
{
  try
  {
    if (bw.ns4 || bw.ns6)
    {
		doc_width = self.innerWidth;
    } 
    else if (bw.ie4 || bw.ie5 || bw.ie6 || bw.ie7 || bw.ie8)
    {
		doc_width = document.body.clientWidth;
    }
	var pos2 = (doc_width/2) - 364;

    if (bw.ns4 || bw.ns6)
    {
		doc_width = self.innerWidth;
    } 
    else if (bw.ie4 || bw.ie5 || bw.ie6 || bw.ie7 || bw.ie8)
    {
		doc_width = document.body.clientWidth;
    }
    else if (bw.opera5 || bw.opera6)
    {
		document.all.divScrollTextCont.style.left = pos;
    }
    else if (bw.mac){
  }
	//var pos2 = doc_width/2 - 368;
	
	//if (pos2 < 543) pos2 = 543
	
	if(bw.ie4 || bw.ie5 || bw.ie6 || bw.ie7 || bw.ie8 || bw.opera5 || bw.opera6) document.all.divScrollTextCont.style.left = pos2;
	if (bw.ns6)
	{
	    document.getElementById("divScrollTextCont").style.left = pos2 + "px";	
	    document.getElementById("divScrollTextCont").style.top = 425 + "px"
	}
		
	if(bw.ns4){
		document.layers[0].left = pos2;
		document.layers[0].visiblitity = "visible";
	}
    }
    catch(e)
	{
		//alert('error');
	}
}

function objects(n, d)
{
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length)
  {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=objects(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
// vars for layers
var openLayer= new Array();
openLayer[0] = "0";
subLayer = "";
var timer;
var mousePosition;

function controlLayers()
{
  var i,p,v,obj,args=controlLayers.arguments;
  if(openLayer[0] != 0 && args[1] == "")
  {
	recursiveClose();
  }
  openLayer[0] = args[0];
  
  if (objects(openLayer[0]) != null)
  { 
	if(bw.ie4 || bw.ie5 || bw.ie6 || bw.ie7 || bw.ie8 || bw.opera5 || bw.opera6)
		document.all[openLayer[0]].style.left = mousePosition-25 + "px";
	if (bw.ns6)
	{
		try
                {
		    document.getElementById(openLayer[0]).style.left = mousePosition-25 + "px";
		}
		catch(e)
		{
		    alert(e);
		}
		
	}
  }
	
	
  for (i=0; i<(args.length-2); i+=3) if ((obj=objects(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function closeLayer() 
{
  var i,p,v,obj,args=closeLayer.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  if ((obj=objects(args[i]))!=null) 
  { 
    v=args[i+2];
    if (obj.style) 
    { 
       obj=obj.style; 
       v=(v=='show')?'visible':(v='hide')?'hidden':v; 
    }
    obj.visibility=v; 
  }
}

function recursiveClose()
{       
  for(i=0; i< openLayer.length; i++)
  {
    if(openLayer[i] != null)
      closeLayer(openLayer[i],'','hide');
  }
}

function rakna_ner()
{
   timer = setTimeout("recursiveClose()", 300);
}

function rensa_tiden()
{
   clearTimeout(timer);
}

//Scroll functions
var timer;
var speed;

function makeObj(obj,nest)
{
    nest=(!nest) ? "":'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
	this.up=goUp;this.down=goDown;
	this.moveIt=moveIt; 
        this.x=0; 
        this.y=0;
        this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function moveIt(x,y)
{
	this.x = x
	this.y = y
	this.css.left = this.x+"px";
	this.css.top = this.y+"px";
}

//Makes the object go up
function goDown(move)
{
	if (this.y>-this.scrollHeight+oCont.clipHeight)
        {
		this.moveIt(0,this.y-move)
			if (loop) setTimeout(this.obj+".down("+move+")",speed)
	}
}

//Makes the object go down
function goUp(move)
{
	if (this.y < 0)
    {
		this.moveIt(0,this.y-move)
		if (loop) setTimeout(this.obj+".up("+move+")",speed)
	}
}

//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed)
{
	if (scrolltextLoaded)
    {
		loop = true;
		if (speed > 0) oScroll.down(speed)
		else oScroll.up(speed)
	}
}

//Stops the scrolling (called on mouseout)
function noScroll()
{
	loop = false
	if (timer) clearTimeout(timer)
}

//Makes the object
var scrolltextLoaded = false
function scrolltextInit()
{
	rakna_position();
	oCont = new makeObj('divScrollTextCont')
	oScroll = new makeObj('divText','divScrollTextCont')
	oScroll.moveIt(0,0)
	oCont.css.visibility = "visible"
	scrolltextLoaded = true
}

//Start scrolling after stopped (called on mouseout)
function newScroll(speed)
{
	loop = false
	if (timer) clearTimeout(timer)
}

function mPos(position)
{
  mousePosition = position;
}

function movemenu()
{
  mPos(event.clientX);
  if (objects(openLayer[0]) != null)
  {
    if(bw.ie4 || bw.ie5 || bw.ie6 || bw.ie7 || bw.ie8 || bw.opera5 || bw.opera6)
      document.all[openLayer[0]].style.left = mousePosition-25 +"px";
    if (bw.ns6)
      document.getElementById(openLayer[0]).style.left = mousePosition-25 + "px";
  }
}

function setHeight(elID)
{
  el = document.getElementById(elID);
  el2 = document.getElementById("bottomdel");
  var windowHeight=getWindowHeight();
  var elHeight=el.offsetHeight;
  var el2Height=el2.offsetHeight;

  if (windowHeight-10-elHeight>=0)
  {
    bottomdel.style.height=windowHeight-10-elHeight+'px';
    bottomdel2.style.height=windowHeight-10-elHeight+'px';
  }
  if (elHeight+(el2Height)>=windowHeight)
  {
    bottomdel.style.height=20+'px';
    bottomdel2.style.height=20+'px';
  }
}

function getWindowHeight()
{
  var windowHeight=0;
  if (typeof(window.innerHeight)=='number')
  {
      windowHeight=window.innerHeight;
  }
  else
  {
    if (document.documentElement&&document.documentElement.clientHeight)
    {
   	  windowHeight=document.documentElement.clientHeight;
    }
    else
    {
      if (document.body&&document.body.clientHeight)
      {
	    windowHeight=document.body.clientHeight;
      }
    }
  }
  return windowHeight;
}

function mouse_over(ev,s)
{
  mPos(fnGetPos(ev ? ev : window.event) + 7);
  controlLayers(s,'','show');
  rensa_tiden();
}

function fnGetPos(ev)
{
  var ret = ev.clientX - 0;
  var oEl = fnGetElement(ev);
  if(oEl)
  {
    ret = fnGetRealPos(oEl,"Left");
  }
  return ret;
}

function fnGetRealPos(i,which)
{
  iPos = 0
  while (i!=null)
  {
	iPos += i["offset" + which]
	i = i.offsetParent
  }
  return iPos
}

function fnGetElement(e)
{
  var targ;
  if (!e)
   var e = window.event;
  if (e.target)
   targ = e.target;
  else if (e.srcElement)
   targ = e.srcElement;
  if (targ.nodeType == 3) // defeat Safari bug
	targ = targ.parentNode;
		return targ;
}
//-->