function preloadImages() {
	var d = document;
	if (d.images) {
		if (!d.imgArray) {
			d.imgArray = new Array();
		}
		var i;
		var j = d.imgArray.length;
		var a = preloadImages.arguments;
		for (i = 0; i < a.length; i++) {
			if (a[i].indexOf("#") != 0){ 
				d.imgArray[j] = new Image; 
				d.imgArray[j++].src = a[i];
			}
		}
	}
}
function changeLoc(address) {
	window.location.href = address;
}
function down(td) {
	td.firstChild.style.position="relative";
	td.firstChild.style.top="1";
	td.firstChild.style.left="1";
	//td.style.backgroundImage="url(img/menu_bg_active.gif)";
}
function over(td) {
	if (document.getElementById || (document.all && !(document.getElementById))) {
		td.style.cursor="hand";
		//td.firstChild.style.color="#630";
		td.style.borderBottom="2px solid #f18a01";
		//td.firstChild.style.textDecoration="underline";
	}
}
function out(td, thisdown) {
	if (document.getElementById || (document.all && !(document.getElementById))) {
		//td.firstChild.style.color="";
		if (thisdown) {
			td.style.borderBottom="2px solid #e2e2e2";
		} else {
			td.style.borderBottom="2px solid #b7b7b7";
		}
		//td.firstChild.style.textDecoration="none";
	}
}

function valideraBoka(f) {
	var epost = f.epost.value;
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
	if (re.test(epost) == false) {
		alert ('Vv kontrollera epostadressen.');
		return false;
	}	
}

function displayFlash (swf, w, h) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + w + '" height="' + h + '" align="middle">');
	document.write('<param name="movie" value="' + swf+ '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#fff" />');
	document.write('<param name="scale" value="noscale" />');
	document.write('<embed src="' + swf + '" quality="high" scale="noscale" bgcolor="#fff" width="' + w + '" height="' + h + '" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
