/*KOLLAR OM HEMSIDAN ÄR FAST I ANDRAS RAMAR*/
function trappedInFrames()
{
	if (window!= top)
	{
		top.location.href = location.href;
	}
}
function popUp(mypage,myname,w,h,scroll)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=0'
	win = window.open(mypage,myname,settings);
}
/*FÖRLADDA BILDER*/
function preload()
{
    if (document.images)
    {
      imageObject = new Image();
      
      // URL
      imageURL = new Array();
      imageURL[0] = "/images/mollerod_logga1024.jpg";
      imageURL[1] = "/images/mollerod_logga800.jpg";
      imageURL[2] = "/images/leftbox_bottom1024.png";
      imageURL[3] = "/images/leftbox_bottom800.png";
      imageURL[4] = "/images/leftbox_top1024.png";
      imageURL[5] = "/images/leftbox_top800.png";
      imageURL[6] = "/images/faux1024_outer.gif";
      imageURL[7] = "/images/faux800_outer.gif";
      imageURL[8] = "/images/menuright.gif";
      imageURL[9] = "/images/menuleft.gif";
      imageURL[10] = "/images/bg_menu.gif";
      imageURL[11] = "/images/pageicon.gif";

       var i = 0;
       for(i=0; i<=12; i++) 
       {
         imageObject.src = imageURL[i];
       }
    }
}

function DisableButton(button)
{
      button.disabled = true;
      button.value = 'Skickar anmälan...';
      button.form.submit();
}

function checkRes()
{
//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 "/mollerod/css/mollerod800.css"; @import "/mollerod/css/menu800.css";</style>');
		document.write('<style type="text/css">#header, #mainmenu, #innerwrapper, #footer {width:722px;}</style>');
		
	}
	else
	{
		document.write('<style type="text/css" media="screen, projection">@import "/mollerod/css/mollerod1024.css"; @import "/mollerod/css/menu1024.css";</style>');
	}
}
/*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*/


