function MM_reloadPage(init)
{  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
		location.reload();
}
			
MM_reloadPage(true);

function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore)
		selObj.selectedIndex=0;
}
			
function formHandler()
{
	var URL = document.form.site.options[document.form.site.selectedIndex].value;
	window.location.href = URL;
}

function GoBack()
{
    var container = document.getElementById("EnlargedImageContainer");
    container.style.display = "none";
    while(container.childNodes[0])
        container.removeChild(container.childNodes[0]);
}

function Show(file, width, height)
{
    var container = document.getElementById("EnlargedImageContainer");
    container.style.display = "block";
    container.style.backgroundImage = "url(http://www.gotlandsidrottscenter.se/include/javascript/images/BlackPixel.png)";
    container.style.width = "100%";
    container.style.height = "100%";
    container.style.position = "fixed";
    
    var image = document.createElement("img");
    image.src = file.replace("_tn", "");
	image.style.width = (width).toString() + "px";
	image.style.height = (height).toString() + "px";
    image.style.border = "10px solid #ffffff";
    
    var imageContainer = document.createElement("div");
    imageContainer.style.textAlign = "center";
    imageContainer.style.width = (width + 20).toString() + "px";
    imageContainer.style.height = (height + 20 + 27).toString() + "px";
    imageContainer.style.left = "50%";
    imageContainer.style.marginLeft = (-((width + 20) / 2)).toString() + "px";
    imageContainer.style.top = "50%";
    imageContainer.style.marginTop = (-((height + 20 + 27) / 2)).toString() + "px";
    imageContainer.style.backgroundColor = "#ffffff";
    imageContainer.style.position = "fixed";
    imageContainer.appendChild(image); 
    
    var closeImage = document.createElement("img");
    closeImage.src = "http://www.gotlandsidrottscenter.se/include/javascript/images/CloseImg.png";
    closeImage.style.cursor = "pointer";
    closeImage.title = "Stäng";
    closeImage.onclick = GoBack;
    imageContainer.appendChild(closeImage);
    
    container.appendChild(imageContainer);
}
