var newWin = null;
function popUp(strURL, strType, strHeight, strWidth) {
	if (newWin != null && !newWin.closed)
		newWin.close();
		var strOptions="";
	if (strType=="popup")
		strOptions="location=0,menubar=1,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,height="+strHeight+",width="+strWidth;
	newWin = window.open(strURL, 'newWin', strOptions);
	newWin.focus();
}

function gotoURL(page) {
    if (page != '') {
       document.location.href = page;
    }
}


function playVideo(domain,binary,width,height) {

      var so = new SWFObject(domain+"/flash/videoplayer.swf", "videoplayer", width, height, 8, "#ffffff");
      so.addVariable("content",domain+"/binary/" + binary + "/file?ext=.flv");
      so.addVariable("skin", domain+"/flash/SteelExternalAll.swf");
      so.addVariable("width", width);
      so.addVariable("height", height);
      so.addVariable("autoPlay","true");
      so.write("flash-video"+binary);
}

function expandColapse(trigger, icon, div) {
    var elDiv = document.getElementById(div);
    var elIcon = document.getElementById(icon);
     
    if (elDiv.style.display == 'none') {
        elDiv.style.display = 'block';
        elIcon.src = 'images/colapse.gif';
        trigger.title = 'Trykk for å lukke';
        trigger.style.color = '#FF0000';
    }
    else {
        elDiv.style.display = 'none';
        elIcon.src = 'images/expand.gif';
        trigger.title = 'Trykk for å åpne';
        trigger.style.color = '';
    }
    
}

function emAdr(_name,host) {
   document.location.href = 'mailto: '+_name+'@'+host;
}

// Skal brukes kun av Ettermarked
function go(selectElement, pageId) {
    if (selectElement.value !='') {
        document.location.href = 'page?id='+pageId+'&query=data/county=\''+selectElement.value+'\'&county='+selectElement.value;
    }
}

sfHover = function() {
	 //var sfEls = document.getElementById("nav").getElementsByTagName("li");
	 var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
