function ScrollOplysninger(str_identifikation, int_hoejde)
{
  // Made by geeeet@ghtml.com
  // Keep these two lines and you're free to use this code
  
  this.str_identifikation = str_identifikation;
  //this.str_vindue = str_vindue;
  //this.str_eventomraade = str_eventomraade;
  
  //this.int_venstre = int_venstre;
  //this.int_hoejde  = int_hoejde;
  this.int_hoejde  = 283;
  
  this.dom = document.getElementById ? true:false;
  this.nn4 = document.layers ? true:false;
  this.ie4 = document.all ? true:false;
  
  this.mouseY;
  this.mouseX;
  
  this.clickUp = false;
  this.clickDown = false;
  this.clickDrag = false;
  this.clickAbove = false;
  this.clickBelow = false;
  
  this.timer = setTimeout("",500);
  this.upL;
  this.upT;
  this.downL;
  this.downT;
  this.dragL;
  this.dragT;
  this.rulerL;
  this.rulerT;
  this.contentT;
  this.contentH;
  this.contentClipH;
  this.scrollLength;
  this.startY;
  
  this.upH = 7;
  this.upW = 7;
  this.downH = 7;
  this.downW = 7;
  this.dragH = 40;
  this.dragW = 7;
  this.scrollH = (this.int_hoejde -14);
  this.speed = 5;
  this.int_speed_musehjul = 20;
  
  var int_bar_hoejde = this.scrollH * document.getElementById('contentClip_' + this.str_identifikation).offsetHeight;
  if (int_bar_hoejde != 0)
    int_bar_hoejde /= document.getElementById('content_' + this.str_identifikation).offsetHeight;
  int_bar_hoejde = Math.round(int_bar_hoejde);
  if (int_bar_hoejde < 20)
    int_bar_hoejde = 20;
  else if (int_bar_hoejde > this.scrollH)
    int_bar_hoejde = this.scrollH;
  this.dragH = int_bar_hoejde;
  
  function opsaetning()
  {
    //var str_visibility = (this.dragH == this.scrollH ? 'none' : 'inline');
    //var str = '<div id="drag_' + this.str_identifikation + '" style="display: ' + str_visibility + '; z-index: 3; position: absolute; width: 7px; height: ' + this.dragH + 'px; top: 7px; left: ' + this.int_venstre + 'px;">' + (erIE() ? '<img src="gfx/spacer.gif" width="7" height="1" border="0" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'gfx/scrollbar_top.png\');">' : '<img src="gfx/scrollbar_top.png" width="7" height="1" border="0">') + (erIE() ? '<img src="gfx/spacer.gif" width="7" height="' + (this.dragH -2) + '" border="0" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'gfx/scrollbar_midte.png\', sizingMethod=scale);">' : '<img src="gfx/scrollbar_midte.png" width="7" height="' + (this.dragH -2) + '" border="0">') + (erIE() ? '<img src="gfx/spacer.gif" width="7" height="1" border="0" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'gfx/scrollbar_bund.png\');">' : '<img src="gfx/scrollbar_bund.png" width="7" height="1" border="0">') + '</div>';
    //str += '<div id="ruler_' + this.str_identifikation + '" style="display: ' + str_visibility + '; z-index: 4; position: absolute; width: 7px; height: ' + this.dragH + 'px; top: 7px; left: ' + this.int_venstre + 'px; background-image: url(\'gfx/spacer.gif\');"></div>';
    //var str = '<div id="up_' + this.str_identifikation + '" style="display: ' + str_visibility + '; z-index: 3; position: absolute; width: 7px; height: 7px; top: 0px; left: ' + this.int_venstre + 'px;">' + (erIE() ? '<img src="gfx/spacer.gif" width="7" height="7" border="0" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'gfx/scroll_op.png\');">' : '<img src="gfx/scroll_op.png" width="7" height="7" border="0">') + '</div>';
    //str += '<div id="down_' + this.str_identifikation + '" style="display: ' + str_visibility + '; z-index: 3; position: absolute; width: 7px; height: 7px; top: ' + (this.int_hoejde - 7) + 'px; left: ' + this.int_venstre + 'px;">' + (erIE() ? '<img src="gfx/spacer.gif" width="7" height="7" border="0" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'gfx/scroll_ned.png\');">' : '<img src="gfx/scroll_ned.png" width="7" height="7" border="0">') + '</div>';
    //document.getElementById('scrollPlacering_' + this.str_identifikation).innerHTML = str;
    if (this.dragH != this.scrollH)
    {
      document.getElementById('op_' + this.str_identifikation).style.display = 'inline';
      document.getElementById('ned_' + this.str_identifikation).style.display = 'inline';
    }
  }
  this.opsaetning = opsaetning;
  
  this.opsaetning();
  
  // Mousedown
  function down(e)
  {
  	if((document.layers && e.which!=1) || (document.all && event.button!=1)) return true; // Enables the right mousebutton
  	this.getMouse(e);
  	this.startY = (this.mouseY - this.dragT);
  	
    // If click on up-arrow
  	if(this.mouseX >= this.upL && (this.mouseX <= (this.upL + this.upW)) && this.mouseY >= this.upT && (this.mouseY <= (this.upT + this.upH))){
  		this.clickUp = true;
  		return this.scrollUp();
  	}	
  	// Else if click on down-arrow
  	else if(this.mouseX >= this.downL && (this.mouseX <= (this.downL + this.downW)) && this.mouseY >= this.downT && (this.mouseY <= (this.downT + this.downH))){
      this.clickDown = true;
  		return this.scrollDown();
  	}
  	// Else if click on scrollbar
  	else if(this.mouseX >= this.dragL && (this.mouseX <= (this.dragL + this.dragW)) && this.mouseY >= this.dragT && (this.mouseY <= (this.dragT + this.dragH))){
  		this.clickDrag = true;
  		return false;
  	}
  	else if(this.mouseX >= this.dragL && (this.mouseX <= (this.dragL + this.dragW)) && this.mouseY >= this.rulerT && (this.mouseY <= (this.rulerT + this.scrollH))){
  		// If click above drag
  		if(this.mouseY < this.dragT){
  			this.clickAbove = true;
  			this.clickUp = true;
  			return this.scrollUp();
  		}
  		// Else click below drag
  		else{
  			this.clickBelow = true;
  			this.clickDown = true;
  			return this.scrollDown();
  		}
  	}
  	// If no scrolling is to take place
  	else{
  		this.clickDown = true;
      return true;
  	}
    
  }
  this.down = down;
  
  function knapNed(e, boo_nedad)
  {
  	if((document.layers && e.which!=1) || (document.all && event.button!=1)) return true; // Enables the right mousebutton
  	
    // If click on up-arrow
  	if (boo_nedad)
    {
  		this.clickUp = true;
  		return this.scrollUp();
  	}	
  	// Else if click on down-arrow
  	else
    {
      this.clickDown = true;
  		return this.scrollDown();
  	}
    
  }
  this.knapNed = knapNed;
  
  // Drag function
  function move(e){
  	if(this.clickDrag && this.contentH > this.contentClipH){
  		this.getMouse(e);
  		this.dragT = (this.mouseY - this.startY);
  		
  		if(this.dragT < (this.rulerT))
  			this.dragT = this.rulerT;		
  		if(this.dragT > (this.rulerT + this.scrollH - this.dragH))
  			this.dragT = (this.rulerT + this.scrollH - this.dragH);
  		
  		this.contentT = ((this.dragT - this.rulerT)*(1/this.scrollLength));
  		this.contentT = eval('-' + this.contentT);
  
  		this.moveTo();
  		
  		// So ie-pc doesn't select gifs
  		if(this.ie4)
  			return false;
  	}
  }
  this.move = move;
  
  function up(){
  	clearTimeout(this.timer);
  	// Resetting variables
  	this.clickUp = false;
  	this.clickDown = false;
  	this.clickDrag = false;
  	this.clickAbove = false;
  	this.clickBelow = false;
  	return true;
  }
  this.up = up;
  
  // Reads content layer top
  function getT(){
  	if(this.ie4)
  		eval("this.contentT = document.all.content_" + this.str_identifikation + ".style.pixelTop;");
  	//else if(this.nn4)
  		//this.contentT = document.contentClip.document.content.top;
  	else if(this.dom)
  		this.contentT = parseInt(document.getElementById("content_" + this.str_identifikation).style.top);
  }
  this.getT = getT;
  
  // Reads mouse X and Y coordinates
  function getMouse(e){
    
  	if(this.ie4){
  		this.mouseY = event.clientY + document.body.scrollTop;
  		this.mouseX = event.clientX + document.body.scrollLeft;
  	}
  	else if(this.nn4 || this.dom){
  		this.mouseY = e.pageY;
  		this.mouseX = e.pageX;
  	}
    
    //this.mouseX -= parseInt(trimTal(document.getElementById('element_forskydelse').offsetLeft)) + 344;
    //this.mouseY -= parseInt(trimTal(document.getElementById('element_forskydelse').offsetTop)) + 122;
    
  }
  this.getMouse = getMouse;
  
  // Moves the layer
  function moveTo(){
  	if(this.ie4){
  		eval("document.all.content_" + this.str_identifikation + ".style.top = this.contentT;");
  		//eval("document.all.ruler_" + this.str_identifikation + ".style.top = this.dragT;");
  		//eval("document.all.drag_" + this.str_identifikation + ".style.top = this.dragT;");
  	}
  	else if(this.dom){
  		document.getElementById("content_" + this.str_identifikation).style.top = this.contentT + "px";
  		//document.getElementById("drag_" + this.str_identifikation).style.top = this.dragT + "px";
  		//document.getElementById("ruler_" + this.str_identifikation).style.top = this.dragT + "px";
  	}
  }
  this.moveTo = moveTo;
  
  // Scrolls up
  function scrollUp(){
  	this.getT();
  	
  	if(this.clickAbove){
  		if(this.dragT <= (this.mouseY-(this.dragH/2)))
  			return this.up();
  	}
  	
  	if(this.clickUp){
  		if(this.contentT < 0){		
  			this.dragT = this.dragT - (this.speed*this.scrollLength);
  			
  			if(this.dragT < (this.rulerT))
  				this.dragT = this.rulerT;
  				
  			this.contentT = this.contentT + this.speed;
  			if(this.contentT > 0)
  				this.contentT = 0;
  			
  			this.moveTo();
  			this.timer = setTimeout("scrolloplysninger_" + this.str_identifikation + ".scrollUp()",25);
  		}
  	}
  	return false;
  }
  this.scrollUp = scrollUp;
  
  // Scrolls down
  function scrollDown(){
  	this.getT();
  	
  	if(this.clickBelow){
  		if(this.dragT >= (this.mouseY-(this.dragH/2)))
  			return this.up();
  	}
  
  	if(this.clickDown){
  		if(this.contentT > -(this.contentH - this.contentClipH)){			
  			this.dragT = this.dragT + (this.speed*this.scrollLength);
  			if(this.dragT > (this.rulerT + this.scrollH - this.dragH))
  				this.dragT = (this.rulerT + this.scrollH - this.dragH);
  			
  			this.contentT = this.contentT - this.speed;
  			if(this.contentT < -(this.contentH - this.contentClipH))
  				this.contentT = -(this.contentH - this.contentClipH);
  			
  			this.moveTo();
  			this.timer = setTimeout("scrolloplysninger_" + this.str_identifikation + ".scrollDown()",25);
  		}
  	}
  	return false;
  }
  this.scrollDown = scrollDown;
  
  function musRul(e)
  {
    if (!e)
      e = event;
    
    this.getT();
    var int_speed_husk = this.speed;
    this.speed = this.int_speed_musehjul;
   
    if (e.wheelDelta < 0 || e.detail > 0)
    {
      if(this.contentT > -(this.contentH - this.contentClipH))
      {			
      	this.dragT = this.dragT + (this.speed*this.scrollLength);
      	if(this.dragT > (this.rulerT + this.scrollH - this.dragH))
      		this.dragT = (this.rulerT + this.scrollH - this.dragH);
      	
      	this.contentT = this.contentT - this.speed;
      	if(this.contentT < -(this.contentH - this.contentClipH))
      		this.contentT = -(this.contentH - this.contentClipH);
      }
    }
    else
    {
      if(this.contentT < 0)
      {		
      	this.dragT = this.dragT - (this.speed*this.scrollLength);
      	
      	if(this.dragT < (this.rulerT))
      		this.dragT = this.rulerT;
      		
      	this.contentT = this.contentT + this.speed;
      	if(this.contentT > 0)
      		this.contentT = 0;
      }
    }
    
    this.moveTo();
    
    this.speed = int_speed_husk;
    
    if (e.preventDefault)
      e.preventDefault();
  }
  this.musRul = musRul;
  
  function eventLoader(){
    
  	if(this.ie4){
  		// Up-arrow X and Y variables
  		//eval("this.upL = document.all.up_" + this.str_identifikation + ".style.pixelLeft;");
  		//eval("this.upT = document.all.up_" + this.str_identifikation + ".style.pixelTop;");
      this.upL = -1;
      this.upT = 0;
  		// Down-arrow X and Y variables
  		//eval("this.downL = document.all.down_" + this.str_identifikation + ".style.pixelLeft;");
  		//eval("this.downT = document.all.down_" + this.str_identifikation + ".style.pixelTop;");
  		this.downL = -1;
      this.downT = (this.int_hoejde - 7);
      // Scrollbar X and Y variables
  		//eval("this.dragL = document.all.drag_" + this.str_identifikation + ".style.pixelLeft;");
  		//eval("this.dragT = document.all.drag_" + this.str_identifikation + ".style.pixelTop;");
  		this.dragL = -1;
      this.dragT = 7;
      // Ruler Y variable
  		//eval("this.rulerT = document.all.ruler_" + this.str_identifikation + ".style.pixelTop;");
      this.rulerT = 7;
  		// Height of content layer and clip layer
  		eval("this.contentH = parseInt(document.all.content_" + this.str_identifikation + ".scrollHeight);");
  		eval("this.contentClipH = parseInt(document.all.contentClip_" + this.str_identifikation + ".style.height);");
  	}
  	//else if(this.nn4){
  		// Up-arrow X and Y variables
  		//this.upL = document.up.left;
  		//this.upT = document.up.top;		
  		// Down-arrow X and Y variables
  		//this.downL = document.down.left;
  		//this.downT = document.down.top;		
  		// Scrollbar X and Y variables
  		//this.dragL = document.drag.left;
  		//this.dragT = document.drag.top;		
  		// Ruler Y variable
  		//this.rulerT = document.ruler.top;
  		// Height of content layer and clip layer
  		//eval("this.contentH = document.contentClip_" + this.str_identifikation + ".document.content.clip.bottom;");
  		//eval("this.contentClipH = document.contentClip_" + this.str_identifikation + ".clip.bottom;");
  	//}
  	else if(this.dom){
  		// Up-arrow X and Y variables
  		//this.upL = parseInt(document.getElementById("up_" + this.str_identifikation).style.left);
  		//this.upT = parseInt(document.getElementById("up_" + this.str_identifikation).style.top);
      this.upL = -1;
      this.upT = 0;
  		// Down-arrow X and Y variables
  		//this.downL = parseInt(document.getElementById("down_" + this.str_identifikation).style.left);
  		//this.downT = parseInt(document.getElementById("down_" + this.str_identifikation).style.top);
      this.downL = -1;
      this.downT = (this.int_hoejde - 7);
  		// Scrollbar X and Y variables
  		//this.dragL = parseInt(document.getElementById("drag_" + this.str_identifikation).style.left);
  		//this.dragT = parseInt(document.getElementById("drag_" + this.str_identifikation).style.top);
      this.dragL = -1;
      this.dragT = 7;
  		// Ruler Y variable
  		//this.rulerT = parseInt(document.getElementById("ruler_" + this.str_identifikation).style.top);
      this.rulerT = 7;
  		// Height of content layer and clip layer
  		this.contentH = parseInt(document.getElementById("content_" + this.str_identifikation).offsetHeight);
  		this.contentClipH = parseInt(document.getElementById("contentClip_" + this.str_identifikation).offsetHeight);
  		document.getElementById("content_" + this.str_identifikation).style.top = 0 + "px";
  		
  	}
  	// Number of pixels scrollbar should move
  	this.scrollLength = ((this.scrollH-this.dragH)/(this.contentH-this.contentClipH));
  	// Initializes event capturing
  	if(this.nn4){
  		document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
  		//window.onresize = reloadPage;
  	}
    //var arr_elementer = new Array('contentClip', 'drag', 'ruler', 'up', 'down');
    var arr_elementer = new Array('contentClip_' + this.str_identifikation);
    for (var i in arr_elementer)
    {
      var str_navn = arr_elementer[i];
      //eval("document.getElementById('" + str_navn + "').onmousedown = function(e) { return scrolloplysninger_" + str_identifikation + ".down(e); };");
      //eval("document.getElementById('" + str_navn + "').onmousemove = function(e) { return scrolloplysninger_" + str_identifikation + ".move(e); };");
      //eval("document.getElementById('" + str_navn + "').onmouseup = function(e) { return scrolloplysninger_" + str_identifikation + ".up(e); };");
      
      eval("document.getElementById('" + str_navn + "').onmousewheel = function(e) { scrolloplysninger_" + str_identifikation + ".musRul(e); return false; };");
      eval("try { document.getElementById('" + str_navn + "').addEventListener('DOMMouseScroll', function(e) { return scrolloplysninger_" + str_identifikation + ".musRul(e); }, false); } catch (ex) { }");
      
      eval("document.getElementById('ned_" + str_identifikation + "').onmousedown = function(e) { return scrolloplysninger_" + str_identifikation + ".knapNed(e, false); };");
      eval("document.getElementById('ned_" + str_identifikation + "').onmouseup = function(e) { return scrolloplysninger_" + str_identifikation + ".up(e); };");
      eval("document.getElementById('ned_" + str_identifikation + "').onmouseout = function(e) { return scrolloplysninger_" + str_identifikation + ".up(e); };");
      
      eval("document.getElementById('op_" + str_identifikation + "').onmousedown = function(e) { return scrolloplysninger_" + str_identifikation + ".knapNed(e, true); };");
      eval("document.getElementById('op_" + str_identifikation + "').onmouseup = function(e) { return scrolloplysninger_" + str_identifikation + ".up(e); };");
      eval("document.getElementById('op_" + str_identifikation + "').onmouseout = function(e) { return scrolloplysninger_" + str_identifikation + ".up(e); };");
    }
  }
  this.eventLoader = eventLoader;
  
}

function erIE()
{
  if (document.all && navigator.userAgent.indexOf('Opera') == -1 && navigator.userAgent.indexOf('Konqueror') == -1)
    return true;
  else
    return false;
}