function switchBg(){
	if ( screen.availWidth <= 1100 ){
		document.getElementById('body1').setAttribute('background','pics/fade_1024.jpg');
	} else {
		if ( screen.availWidth <= 1200 ){
			document.getElementById('body1').setAttribute('background','pics/fade_1152.jpg');
		} else {
			if ( screen.availWidth <= 1300 ){
				document.getElementById('body1').setAttribute('background','pics/fade_1280.jpg');
			} else {
				if ( screen.availWidth > 1300 ){
					document.getElementById('body1').setAttribute('background','pics/fade_1600.jpg');
				}
			}
		}			
	}
			
}


function openWindow(url)
{
	window.open(url,'Bild','scrollbars=yes,toolbar=no,menubar=no');
}

function switchImg2(element, src, element2, text, element3, url){
	var img = new Image();
	img.src = src;
	element.style.backgroundImage = 'url(' + img.src + ')';	
	element2.innerHTML = text;
	element2.innerHTML.replace(/<([^<>]*)>/g,"");	
	
	element3.onclick = new Function("openWindow('" + url + "')") ;
}

function switchLogiImg(element1, src1, icon){

	// reset all icons
	resetIcons();
	
	// load the new main image
	var img = new Image();
	img.src = src1;
	element1.style.backgroundImage = 'url(' + img.src + ')';	
	
	// set selected icon
	var theIcon = document.getElementById(icon)
	theIcon.src = "./pics/" + icon + ".selected.gif";
	
}

function resetIcons()
{
	var icon1 = document.getElementById('icon.dubbelrum');
	if ( icon1 != null )
	icon1.src = "./pics/icon.dubbelrum.gif";
	
	var icon2 = document.getElementById('icon.havet');
	if ( icon2 != null )
	icon2.src = "./pics/icon.havet.gif";	
	
	var icon3 = document.getElementById('icon.havsvillan');
	if ( icon3 != null )
	icon3.src = "./pics/icon.havsvillan.gif";
	
	var icon4 = document.getElementById('icon.kungen');
	if ( icon4 != null )
	icon4.src = "./pics/icon.kungen.gif";
	
	var icon5 = document.getElementById('icon.lagenhet');
	if ( icon5 != null )
	icon5.src = "./pics/icon.lagenhet.gif";
	
	var icon6 = document.getElementById('icon.punchverandan');
	if ( icon6 != null )
	icon6.src = "./pics/icon.punchverandan.gif";
	
	var icon7 = document.getElementById('icon.svit');
	if ( icon7 != null )
	icon7.src = "./pics/icon.svit.gif";
	
	var icon8 = document.getElementById('icon.utkiken');
	if ( icon8 != null )
	icon8.src = "./pics/icon.utkiken.gif";	
	
	var icon9 = document.getElementById('icon.gronskar');
	if ( icon9 != null )
	icon9.src = "./pics/icon.gronskar.gif";
	
	var icon10 = document.getElementById('icon.revangen');
	if ( icon10 != null )
	icon10.src = "./pics/icon.revangen.gif";	
	
	var icon11 = document.getElementById('icon.sando');
	if ( icon11 != null )
	icon11.src = "./pics/icon.sando.gif";	
	
	var icon12 = document.getElementById('icon.korso');
	if ( icon12 != null )
	icon12.src = "./pics/icon.korso.gif";	
	
	var icon13 = document.getElementById('icon.svangen');
	if ( icon13 != null )
	icon13.src = "./pics/icon.svangen.gif";	
}


function hideDiv(hideDiv){
	var theDiv = document.getElementById(hideDiv);
	theDiv.style.visibility = 'hidden';		
}

