// JavaScript Document
top.window.moveTo(0,0);
if (document.all) {
	top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
	if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
		top.window.outerHeight = screen.availHeight;
		top.window.outerWidth = screen.availWidth;
	}
}


var success;

function loadwin(opened)	{

var wdh = 760; hgt = 540;

var left, top;
var width = screen.width;

// Open the window in the middle of the screen
left = (screen.availWidth - wdh) / 2
top = (screen.availHeight - hgt) / 2 - 10;


success = open('oneo.htm', '', 'width=' + wdh + ',height=' + hgt + ',left=' + left + ',top=' + top + 'toolbar=no,scrollbars=no,resizable=no');


			   

if(success && opened == "manually")	{	
	// Kun hvis vinduet er åbnet manualt, skal der checkes for om viduet er lukket. Ellers tjekkes det først
	// efter den forsinkede popupblokker-test
		afsked();		
		success.moveTo(left,top);
		
}

	// Yahoo popup blocker delays its restrictions towards popups, so that success.closed will return true,
	// (apart from google popup blocker that returns false on success.closed )
	// even if the window is blocked. To handle this, a second function is delayed 200 ms.
    setTimeout('checkForDelayedpopUpblocker()',200);

}

function checkForDelayedpopUpblocker(){
	if (!success.closed){
    afsked();
	}
}


function afsked() {
  if (!success.closed)
    setTimeout('afsked()',100);
  else{
   document.getElementById('manualWinOpen').style.display = "none";
   //Hvis baggrundsfarven er sort, skal skriften være hvid
   if(document.body.style.backgroundColor == "black"){
	   document.getElementById('rememberStovring').style.color = "white";
   }
   document.getElementById('rememberStovring').style.display = "block";
   //document.body.style.backgroundColor = "white";
  }
}





////Positionerer div med logo og "manuel åbning af popup" tekst
function posCenter() {
        if (self.innerWidth)
            {
            	frameWidth = self.innerWidth;
           		frameHeight = self.innerHeight;
            }
            else if (document.documentElement && document.documentElement.clientWidth)
            {
            	frameWidth = document.documentElement.clientWidth;
            	frameHeight = document.documentElement.clientHeight;
            }
            else if (document.body)
            {
            	frameWidth = document.body.clientWidth;
            	frameHeight = document.body.clientHeight;
            }

            oCenter = document.getElementById('centerDiv');
            oCenterWidth =  oCenter.offsetWidth;
            oCenterHeight = oCenter.offsetHeight;

            nW=Math.round((frameWidth/2)-(oCenterWidth/2));
            nH=Math.round((frameHeight/2)-(oCenterHeight/2));

            oCenter.style.left=nW+'px';
            oCenter.style.top=nH+'px';
			
			document.getElementById('centerDiv').style.visibility = "visible";
        }        
        
        isOpera = (window.opera);
        var origWidth,origHeight;

        function handlerLoad() {
            if (isOpera) {
                origWidth  = this.innerWidth;
                origHeight = this.innerHeight;
                handlerResize();
            }
            posCenter();
			
        }

    function handlerResize() {
            if (this.innerWidth != origWidth
                    ||
                    this.innerHeight != origHeight) location.reload();
            if (isOpera) setTimeout('handlerResize()',500);
            posCenter();
    }