//*******************************************************************
// JavaScript för Gotlands Turistförening.
// Utvecklat under december 2006 (God Jul!) av DIDVISION INTERACTIVE
// Senast uppdaterat XXXX XX XX av XXXXX
// Copyright © 2006 - Gotlands Turistförening
//*******************************************************************

// Allmäna funktioner
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 ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}



// Bildslumpning
var theImages = new Array() 


theImages[0] = 'files/images/uppdrag/01.png'
theImages[1] = 'files/images/uppdrag/02.png'
theImages[2] = 'files/images/uppdrag/03.png'
theImages[3] = 'files/images/uppdrag/04.png'
theImages[4] = 'files/images/uppdrag/05.png'
theImages[5] = 'files/images/uppdrag/06.png'
theImages[6] = 'files/images/uppdrag/07.png'
theImages[7] = 'files/images/uppdrag/08.png'

var j = 0
var p = theImages.length;

var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" style="border:none;">');
}