

var popUpWin = 0;


function tilbake()
{
	history.back()
}



function showFaq(obj,img){

//div_Catalogues
//document.getElementById(obj).style.display  = "inline";


 if(document.getElementById(obj).style.display == "none")
    {
        document.getElementById(obj).style.display  = "inline";
        document.getElementById(img).src = "icons/node_anti_expand.gif"
    }
    else
    {
        document.getElementById(obj).style.display  = "none";
        document.getElementById(img).src = "icons/node_expand.gif"
    }

}

function SwitchImage(gal,img){

if(img == "")
	window.location='Gallery.aspx?gal=' + gal;
else
	window.location='Gallery.aspx?gal=' + gal + '&img=' + img;

}
function ShowGallery(gal)
{
//Setter størrelses variabler
	var width = screen.width - 100;
	var height = screen.heigh - 100;
	var left = (screen.width/2) - (width/2);
	var top = (screen.height/2) - (height - 100);
	
	//Lager en URL til document.aspx siden
	URLStr = 'unsecure/Gallery.aspx?gal=' + gal;

	//Sjekker om et vindu er oppe fra før av.
	if(popUpWin)
	{
		if(!popUpWin.closed)
			popUpWin.close();
	}

	//Viser popup vinduet
	popUpWin = open(URLStr,'popUpWin','toolbar=no,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'');
}

function OpenHatch_adm(dag)
{
//Setter størrelses variabler
	var width = 420;
	var height = 300;
	var left = (screen.width/2) - (width/2);
	var top = (screen.height/2) - (height - 100);
	
	//Lager en URL til document.aspx siden
	URLStr = 'unsecure/jul.aspx?dag=' + dag;

	//Sjekker om et vindu er oppe fra før av.
	if(popUpWin)
	{
		if(!popUpWin.closed)
			popUpWin.close();
	}

	//Viser popup vinduet
	popUpWin = open(URLStr,'popUpWin','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'');
}

function lukkvindu(){
	window.close();
}

function searchArticles(text){
    var search =  text.value;//document.getElementById("Default_Top1_txtSearch").value;
    document.location = "Default.aspx?center=portal/articlesRes&s=" + search;     
}
function searchSite(text2){
    //var search = text.value;// text.value;//;
    var search = document.getElementById(text2);
    search.value = "asd";
  //  document.location = "Default.aspx?center=portal/SearchResults&s=" + search.value;     
}

function show(obj){
  document.getElementById(obj).style.display = "inline";
}
function hide(obj){
  document.getElementById(obj).style.display = "none";
}
function showhide(show,hide){
  document.getElementById(show).style.display = "inline";
  document.getElementById(hide).style.display = "none";
}
function showHideHide(show,hide,hide2){
  document.getElementById(show).style.display = "inline";
  document.getElementById(hide).style.display = "none";
  document.getElementById(hide2).style.display = "none";
}
function showHideHideHide(show,hide,hide2,hide3){
  document.getElementById(show).style.display = "inline";
  document.getElementById(hide).style.display = "none";
  document.getElementById(hide2).style.display = "none";
  document.getElementById(hide3).style.display = "none";
}

function showHideHideHideHide(show,hide,hide2,hide3,hide4){
  document.getElementById(show).style.display = "inline";
  document.getElementById(hide).style.display = "none";
  document.getElementById(hide2).style.display = "none";
  document.getElementById(hide3).style.display = "none";
  document.getElementById(hide4).style.display = "none";
}


function doShow(obj)
{
    if(document.all(obj).style.display == "none")
    {
        document.all(obj).style.display  = "inline";
    }
    else
    {
        document.all(obj).style.display  = "none";
    }
}


/*-------------------------------------------------------
* Åpner opp et popup vindu for å vise refleksjoner
*--------------------------------------------------------*/
function popUpLog(id){
	//Setter størrelses variabler
	var width = 420;
	var height = 300;
	var left = (screen.width/2) - (width/2);
	var top = (screen.height/2) - (height - 100);
	
	//Lager en URL til document.aspx siden
	URLStr = 'unsecure/loggDetailsPU.aspx?log_id=' + id;

	//Sjekker om et vindu er oppe fra før av.
	if(popUpWin)
	{
		if(!popUpWin.closed)
			popUpWin.close();
	}

	//Viser popup vinduet
	popUpWin = open(URLStr,'popUpWin','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'');
}



/*-------------------------------------------------------
* Funksjoner for at siden skal oppdatere seg automatisk
* når popup vinduet lukkes.
*--------------------------------------------------------*/
function redoform(){
	__doPostBack('Refresh','');
}
function __doPostBack(eventTarget, eventArgument){
	var theform = document.Form1;
	theform.__EVENTTARGET.value = eventTarget;
	theform.__EVENTARGUMENT.value = eventArgument
	theform.submit();
}
function CheckWindow(){
	ChildWindow.close();
}
/*------------------------------------------------------*/




/***************************************************
* 3 Funksjoner for at ikke sidene skal
* hoppe opp til toppen etter at man
* har utlost en event
*
*LEgges i Body taggen pa siden:
*ONCLICK="PutPositions()" ONLOAD="ScrollWindow()"
***************************************************/
function doSetFocus() {
	try {
		document.Form1.txt1.focus();
	} catch (e) {}
}

function PutPositions() {
	document.Form1.WindowXPos.value = document.body.scrollLeft;
	document.Form1.WindowYPos.value = document.body.scrollTop;
}

function ScrollWindow() {
	window.scrollTo(document.Form1.WindowXPos.value,
	document.Form1.WindowYPos.value);
}

function visBilde(N,w,h) { 
	var width = w + 20;
	var height = h + 50;
	//document.write('W: ' + width + ' H: ' + height);
		
		//midtstiller bildet
	var left = (screen.width / 2) - (width / 2);
	var top = ((screen.height / 2) - (height / 2))-50;
	wnd = window.open("unsecure/bilde.htm?Image="+ N,"image","location=no,menubar=no,status=no,scrollbars=no,resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
	
}


//DREAMWEAVER REALL
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}