// ved sideload
window.onload = function() {
 runSlideShow();
 getPageSizeWithScroll();
 }

// ved sideresize
window.onresize = function() {
 getPageSizeWithScroll();
}





function PopWin(url,w,h) { 
 leftPos = Math.round((screen.availWidth-w)/2); 
 topPos = Math.round((screen.availHeight-h)/2); 
 window.open (url,'Popup','width='+w+',height='+h+',left='+leftPos+',top='+topPos+', toolbar=no,menubar=no,location=no, scrollbars=yes,resizeable=yes'); 
} 

function skift_ekstranetloginbox(){
 if(document.getElementById('extranetlogin').style.display=='none'){
  document.getElementById('extranetlogin').style.display='block';
 } else {
  document.getElementById('extranetlogin').style.display='none';
 }
}

function checkform(){
	if(document.ExtUserForm.Username.value.length <= 0){
		alert('Angiv brugernavn');
		document.ExtUserForm.Username.focus();
		return false;
	}

	if(document.ExtUserForm.Password.value.length <= 0){
		alert('Angiv kodeord');
		document.ExtUserForm.Password.focus();
		return false;
	}
	return true;
}

function parseQueryString() { 
 if ( !location.search || location.search=="?" )return null; 
 var aNameValuePair = 
 location.search.substring(1,location.search.length).split("&") 
 var aParam = new Array(aNameValuePair.length); 
 for ( var i=0; i<aNameValuePair.length; i++ ) { 
  param = aNameValuePair[i].split("="); 
  aParam[param[0]] = aParam[i] = { name: param[0], value:unescape(param[1].replace('+', ' ')) }; 
 } 
return aParam; 
} 

var aParameters = parseQueryString(); 
if ( aParameters!=null ) {
 if(aParameters['mode']!=null){ 
  fejl = aParameters['mode'].value;
  if(fejl!=""){
   alert('Dit brugernavn og/eller kodeord er forkert angivet!');
  }
 } 
}



function getPageSizeWithScroll()
	{     
	

			 
			   newheight = document.body.clientHeight - 35;
			   			  
			   document.getElementById("frame").style.height= newheight+"px";
	

  
}