//Image preloader
imageSource = new Array (
	"images/bg-masthead.gif",
	"images/bg-nav.gif",
	"images/pagebottom.gif"
);

imageList = new Array ();

for (counter in imageSource) {
    imageList[counter] = new Image();
    imageList[counter].src = imageSource[counter];
}

//Remove outline around links
function removeFocusOnAllLinks(){
for(var i=0 ; i < document.links.length ; i++)
document.links[i].onfocus=blurLink;
}

function blurLink() {
if (this.blur) this.blur();
}

window.onload=removeFocusOnAllLinks;

//Function for contact form
function funcfrmContact() {
	if (document.frmContact.Kontaktperson.value == "") {
		alert('Du måste ange kontaktperson!');
		document.frmContact.Kontaktperson.focus();
		return false;
	}
	else if (document.frmContact.Epostadress.value == "") {
		alert('Du måste ange din epostadress!');
		document.frmContact.Epostadress.focus();
		return false;
	}
	else if (document.frmContact.Meddelande.value == "") {
		alert('Du måste skriva ett meddelande!');
		document.frmContact.Meddelande.focus();
		return false;
	}
	document.frmContact.email.value = document.frmContact.Epostadress.value;
	document.frmContact.realname.value = document.frmContact.Kontaktperson.value;
	document.frmContact.submit();
}

function pop_up_picture(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	screenh = window.screen.height;
screenw = window.screen.width;
posLeft = (screenw-imageWidth)/2;
posTop = (screenh-imageHeight)/2;
theWindow = window.open("","theWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	theWindow.document.open();
	theWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
	theWindow.document.write('<img src="'+imageName+'" width='+imageWidth+' height='+imageHeight+' alt="'+alt+'" onClick="javascript:window.self.close();" galleryimg="no">');
	theWindow.document.write('</body></html>');
	theWindow.document.close();
	theWindow.focus()
}