var hintwindow;
var prevwindow;
var timer;
 
function highlight( id )
{
	var obj = document.getElementById( 'image' + id );
	if( obj )
	{
		if( obj.src.indexOf( 'spacer.gif' ) > -1 )
		{
			obj.src = '/images/bullets/menu_selected.gif';
		}
		else
		{
			obj.src = '/images/spacer.gif';
		}
	}
}




function dictionaryWordIn( id, event ) {
	var windowy=0;
	var windowx=0;

	window.clearTimeout(timer);

	if (prevwindow) {
		prevwindow.style.display = "none";
	}
		
	hintwindow = document.getElementById("dictionary" + id);

	if (hintwindow) {
		windowy = event.clientY + document.body.scrollTop;
		windowx = event.clientX + document.body.scrollLeft;
		    
		hintwindow.style.top  = windowy + 5;
		hintwindow.style.left = windowx + 5;
		hintwindow.style.position = "absolute";
		hintwindow.style.display = "block";
	}
	    
	timer = window.setTimeout("dictionaryOut(" + id + ")",9999);
	prevwindow = hintwindow;
}

function dictionaryDescriptionIn( id ) {
	window.clearTimeout(timer);
}

function dictionaryOut( id ) {
	hintwindow = document.getElementById("dictionary" + id);
	window.clearTimeout(timer);
	timer = window.setTimeout("hide()",1500);
}
  
function hide() {
	hintwindow.style.display = "none";
	prevwindow = false;
}

function openWin( url, height, width ) {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	if (!width)
	  width = 452;
	window.open(url,"_blank","fullscreen=0,width=" + width + ",height=" + height +",left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,location=0");
}

function openElsparehus() {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	window.open("/elsparehus/privatkunde/elsparehus.html","_blank","fullscreen=0,width=800,height=450,left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=0,location=0");
}


function insertEmailLink( address ){
	document.write("<a href=\"mailto:" + address + "\">" + address + "</a>");
}

function showHelp( id, height, width ) {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	if (!width) {
		width = 420;
	}
	if (!height) {
		height = 300;
	}
	window.open("/WebModules/ShowHelp.aspx?ID=" + id,"_blank","fullscreen=0,width=" + width + ",height=" + height +",left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,location=0");
}


function swap(io,id,btn) {
	document.getElementById(id).setAttribute("src","../images/buttons/"+btn+io+".gif");		
}

function SearchText(io,id) {
	if (io=="focus") {
		document.getElementById(id).setAttribute("value","");
	}
	if (io=="blur") {
		if (document.getElementById(id).value.length < 1) {
			document.getElementById(id).setAttribute("value","Søgeord...");
		}
	}
}



//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';
  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, "", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
