// JavaScript Document

// rollover by rod.rant-on.net | rodmorelos@msn.com
// keep these two lines and you're free to use this code

// to use: <img src="your_image.gif" rsrc="rollover_image.gif">

var rollover = {
	images: document.getElementsByTagName ? document.getElementsByTagName('img') : null,
	setup: function()
	{
		for (var i = 0; i < rollover.images.length; i++)
		{
			if (rollover.images[i].getAttribute && rollover.images[i].getAttribute('rsrc'))
			{
				rollover.images[i].s = new Image();
				rollover.images[i].s.src = rollover.images[i].getAttribute('src');
				rollover.images[i].r = new Image();
				rollover.images[i].r.src = rollover.images[i].getAttribute('rsrc');
				rollover.images[i].onmouseover = function() { this.setAttribute('src', this.r.src); }
				rollover.images[i].onmouseout = function() { this.setAttribute('src', this.s.src); }
			}
		}
	}
}

window.onload = rollover.setup;

function popWin(file){
      newWin=window.open("","ResizeBillede","width=300,height=200,status=no");
      txt='<ht'+'ml><he'+'ad><ti'+'tle><\57ti'+'tle><scri';
      txt+='pt language="javascript" type="text/javascript">';
      txt+='function resPic(){h=document.images[0].scrollHeight;';
      txt+='w=document.images[0].scrollWidth;window.resizeTo(w+6,h+32);}<\57scri';
      txt+='pt><\57he'+'ad><bo'+'dy style="overflow:hidden;';
      txt+='border:0px;margin:0px"><i'+'mg src="'+file+'" style="top:0px;left:0px;border:0px;cursor:pointer;';
      txt+='" onload="resPic();" OnClick="window.close();"><\57bo'+'dy><\57ht'+'ml>';
      newWin.document.write(txt);
      newWin.document.close();
    }

function update() {
  alert("Siden er under opdatering, så der kan forekomme fejl")
}

function startList() {

	// code for IE
	if(!document.body.currentStyle) return;
	var subs = document.getElementsByName('submenu');
	for(var i=0; i<subs.length; i++) {
		var li = subs[i].parentNode;
		if(li && li.lastChild.style) {
			li.onmouseover = function() {
				this.lastChild.style.visibility = 'visible';
			}
			li.onmouseout = function() {
				this.lastChild.style.visibility = 'hidden';
			}
		}
	}
}
/*window.onload=startList;
*/

function checkForm() {
	 regex = /^[\s]*$/;
        if (regex.test(document.getElementById("q").value)){
          alert("Du skal indtaste et søgeord!");
          return false;
        }
		 if (document.getElementById("q").value == 'Indtast søgeord...'){
          alert("Du skal indtaste et søgeord!");
          return false;
        }

}
