<!--

//var stoppflytt = false;

var flytt_div = true;
var oppover = true;


function aapne_vindu(url,vindu) 
{
//alert (url+vindu);
// mywindow = window.open (url,vindu,"location=1,status=1,scrollbars=1, width=100,height=100");
 mywindow = window.open (url,vindu);



}


function moveDiv()
{
//	deltax=parseInt(document.skjema.deltax.value);
//	deltay=parseInt(document.skjema.deltay.value);
	
	startx=-5
	starty =0;	
	
 deltax= 0;
 deltay = 1;

	
	if (oppover) {deltay = - deltay	}
	
  var the_style = getStyleObject("myDiv");
  var the_left = parseInt(the_style.left) + deltax;
  var the_top = parseInt(the_style.top) + deltay;
	
	if (the_top > -7) {
		oppover = true;
		the_left = startx;
//		the_top = 10;
			}
			
	if (the_top < -355) {
		oppover = false;
		the_left = startx;
//		the_top = 10;
			}
			
			
  if (document.layers)
  {
    the_style.left = the_left;
    the_style.top = the_top;
  }
  else 
  {
    the_style.left = the_left + "px";
    the_style.top = the_top + "px";  
  }
	
	if (flytt_div) {
		setTimeout('moveDiv()',100);
		}	
	

}

  function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject



function startstopp()
{
flytt_div = !flytt_div ;

if (flytt_div) {
	document.kontroll.knapp.value="||";
	moveDiv()
	}else{
	
	document.kontroll.knapp.value=">";

	}


}


function stoppflytt()
{
flytt_div = false;

document.kontroll.knapp.value="a";

}

function startflytt()
{
flytt_div = true;
moveDiv()
}

function endreretning()
{
oppover=!oppover
}


// start med å flytte lag
moveDiv()

// -->


