function preload()
{
    if (document.images)
    {
      imageObject = new Image();
      
      // URL
      imageURL = new Array();
      imageURL[0] = "/images/logo1024.png";
      imageURL[1] = "/images/logo800.png";
      imageURL[2] = "/images/newsbox205_bottom.png";
      imageURL[3] = "/images/newsbox205_top.png";
      imageURL[4] = "/images/newsbox187_bottom.png";
      imageURL[5] = "/images/newsbox187_top.png";
      imageURL[6] = "/images/newsbox167_bottom.gif";
      imageURL[7] = "/images/newsbox167_top.gif";
      imageURL[8] = "/images/menuright.gif";
      imageURL[9] = "/images/menuleft.gif";
      imageURL[10] = "/images/faux1024_outer.gif";
      imageURL[11] = "/images/faux1024_inner.gif";
      imageURL[12] = "/images/footerbg.gif";
      imageURL[13] = "/images/button_large.gif";
      imageURL[14] = "/images/button_small.gif";
      imageURL[15] = "/images/buttonmollerod_large.gif";
      imageURL[16] = "/images/buttonmollerod_small.gif";
      imageURL[17] = "/images/buttongastbok_large.gif";
      imageURL[18] = "/images/buttongastbok_small.gif";

       var i = 0;
       for(i=0; i<=19; i++) 
       {
         imageObject.src = imageURL[i];
       }
    }
}

function DisableButton(button)
{
      button.disabled = true;
      button.value = 'Skickar...';
      button.form.submit();
}

function checkResolution()
{
//upplösning, Internet explorer, Firefox och modern Netscape
var resWidth; 
var ie;	
var ns6;

	ie = document.all; 
    ns6 = document.getElementById && !document.all;
    
    if(ns6)
	{
		resWidth = innerWidth; //Netscape & Firefox
		resHeight = innerHeight;
	}
	else
	{
		resWidth = screen.width; //IE och Opera
		resHeight = screen.height;
	}
	if(resWidth <= 800)
	{
		document.write('<style type="text/css" media="screen, projection">@import "/styles/style800.css"; @import "/styles/mainmenu800.css";</style>');
		document.write('<!--[if lt IE 6]><style type="text/css">@import "/styles/ie55_800.css";</style><![endif]-->');
		document.write('<!--[if lt IE 5.500]><style type="text/css">@import "/styles/ie5_800.css";</style><![endif]-->');
	}
	else
	{
		document.write('<style type="text/css" media="screen, projection">@import "/styles/style1024.css"; @import "/styles/mainmenu1024.css";</style>');
		document.write('<!--[if lt IE 6]><style type="text/css">@import "/styles/ie55_1024.css";</style><![endif]-->');
		document.write('<!--[if lt IE 5.500]><style type="text/css">@import "/styles/ie5_1024.css";</style><![endif]-->');
	}
}

/*HIGHLIGHTA AKTUELLT FORMULÄRFÄLT*/
//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="#ffff52"

var netscape6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which)
{
	if (which.style&&intended.test(which.tagName))
	{
		if (netscape6&&eventobj.nodeType==3)
		eventobj=eventobj.parentNode.parentNode
		return true
	}
	else
		return false;
}

//Function to highlight form element
function highlight(e)
{
	eventobj=netscape6? e.target : event.srcElement
	if (previous!='')
	{
		if (checkel(previous))
		{
		previous.style.backgroundColor=''
		}
		previous=eventobj
		if (checkel(eventobj))
		{
		eventobj.style.backgroundColor=highlightcolor
		}
	}
	else
	{
		if (checkel(eventobj))
		{
			eventobj.style.backgroundColor=highlightcolor
		}
		previous=eventobj
	}
}
/*SLUT AKTUELLT FORMULÄRFÄLT*/

