
  // Time in seconds to wait before giving up on preload (broken 
  // images can cause the load to never get to 100%).
  
  var bt_timeout = 8;
  
  
  // Array of images to load; feel free to make this as long or
  // as short as you want. First element is filename (include path
  // to file), second is size of images in kB.
  
  var bt_preimages = [
    ['bild1.jpg',20],
    ['bild2.jpg',20],
    ['bild3.jpg',20],
    ['bild4.jpg',20],
    ['bild5.jpg',20],
    ['bild6.jpg',20],
    ['bild8.jpg',20],
    ['bild9.jpg',20],
    ['bild10.jpg',20],
    ['bild11.jpg',20],
    ['bild13.jpg',20],
    ['bild14.jpg',20],
    ['bild15.jpg',20],
    ['bild16.jpg',20],
    ['bild17.jpg',20]
    ];
  
  
  // Text to use for when loading has finished
  //var bt_text_finished = 'Done';
  
  // Text to prefix the percentage
  var bt_text_prefix = ' ';
  
  
  function bt_done() {
    // stub function called when script is finished, put your JS here.
    // (you could use a javascript to redirect the user)
		//alert('klar');
		

    }
    
    


// Simple DHTML Image Loader 
// by Glen Murphy. Script located at http://bodytag.org/

function bt_forcedone() {
	//document.getElementById('bt_container').innerHTML = '';
	document.getElementById("bt_container").style.display="none";
	bt_done();
	}

function bt_arrived(o) {
	bt_loaded += bt_preimages[o][1];
	var bt_percentage = Math.round((bt_loaded/bt_total)*100);
	document.getElementById('bt_container').innerHTML = bt_text_prefix+bt_percentage+'%';
		if(bt_percentage == 100) {
			bt_forcedone();
		}
		//if (o>12) alert(o);
		
	}
	

if(bt_timeout > 0) {
	setTimeout('bt_forcedone()',bt_timeout*1000);
	}

var bt_total = 0;
var bt_loaded = 0;
var bt_out = '';

bt_out += '<div id="bt_container"></div>';

for(i = 0; i < bt_preimages.length; i++) {
	
	bt_total += bt_preimages[i][1];
	bt_out += '<img src="img/'+bt_preimages[i][0]+'" width="1" height="1" onload="bt_arrived('+i+');" style="position:absolute; top:-1000px;" />';
	}

document.write(bt_out);