

var popUpWin = 0;


function tilbake()
{
	history.back()
}



function switchArchive(obj,img){   
 
	if(document.getElementById){
	    
	    var el = document.getElementById(obj);	 
		
		if(el.style.display != "block"){
			el.style.display = "block";
		    document.getElementById(img).src = "icons/node_anti_expand.gif"
		}
		
		else {			
			el.style.display = "none";
			document.getElementById(img).src = "icons/node_expand.gif"

		}
			
	}//if(document.getElementById)
	
} //function SwitchMenuShop

function switchChild(obj,img){   
 
	if(document.getElementById){
	    
	    var el = document.getElementById(obj);	 
		
		if(el.style.display != "block"){
			el.style.display = "block";
		    document.getElementById(img).src = "icons/node_anti_expand.gif"
		}
		
		else {			
			el.style.display = "none";
			document.getElementById(img).src = "icons/node_expand.gif"

		}
			
	}//if(document.getElementById)
	
} //function SwitchMenuShop

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);
	
}

function popUpData(id){
    document.getElementById(id).focus();
	//Setter størrelses variabler
	var width = 150;
	var height = 200;
	var left = event.screenX;
	var top =  event.screenY - 50 ;

	//Lager en URL til document.aspx siden
	URLStr = 'unsecure/keywords.aspx?client=' + id;

	//Sjekker om et vindu er oppe fra før av.
	if(popUpWin)
	{
		if(!popUpWin.closed)
			popUpWin.close();
	}
	
	popUpWin =  window.open(URLStr,'Keywords','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top+'');	
	popUpWin.focus();
}



function insertData(data,clientid){

	var val = window.document.getElementById(data);
	var keywords; 
	keywords = "";
	
	for (var i = val.length-1; i >= 0 ; i--) { 
		if (val.options[i].selected) { 
			keywords = keywords  + val.options[i].text + " ";
		} 
	} 

    //var val = window.document.all(data);
    var editor = window.opener.document.getElementById(clientid);    
    editor.value =  editor.value + " " + keywords
    
    editor.focus();
    window.close();
}

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 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";
}

/*-------------------------------------------------------
* Å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+'');
}


/*-------------------------------------------------------
* Åpner opp et popup vindu for å vise refleksjoner
*--------------------------------------------------------*/
function popUpArchive(id){
	//Setter størrelses variabler
	var width = 600;
	var height = 600;
	var left = (screen.width/2) - (width/2);
	var top = (screen.height/2) - (height - 100);

	//Lager en URL til document.aspx siden
	URLStr = 'unsecure/archive.aspx?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=no,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);
}



//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];}
}