var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
}
else if( document.documentElement && ( document.documentElement.clientWidth) ) {
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth) ) {
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
}

var height_preloadbar=350
var images_toload=new Array (
	"gfx/room1.gif",
	"gfx/room2.gif",
	"gfx/logo.gif",
	"gfx/de.gif",
	"gfx/fr.gif",
	"gfx/uk.gif",
	"gfx/eu.gif",
	"gfx/cb1.gif",
	"gfx/cb2.gif",
	"gfx/impr.gif",
	"gfx/map.gif",
	"gfx/next.gif",
	"gfx/next2.gif",
	"gfx/back.gif",
	"gfx/back2.gif",
	"gfx/menue/about_de_0.gif",
	"gfx/menue/about_de_1.gif",
	"gfx/menue/about_fr_0.gif",
	"gfx/menue/about_fr_1.gif",
	"gfx/menue/about_uk_0.gif",
	"gfx/menue/about_uk_1.gif",
	"gfx/menue/home_de_0.gif",
	"gfx/menue/home_de_1.gif",
	"gfx/menue/home_fr_0.gif",
	"gfx/menue/home_fr_1.gif",
	"gfx/menue/home_uk_0.gif",
	"gfx/menue/home_uk_1.gif",
	"gfx/menue/contact_de_0.gif",
	"gfx/menue/contact_de_1.gif",
	"gfx/menue/contact_fr_0.gif",
	"gfx/menue/contact_fr_1.gif",
	"gfx/menue/contact_uk_0.gif",
	"gfx/menue/contact_uk_1.gif",
	"gfx/menue/gallery_de_0.gif",
	"gfx/menue/gallery_de_1.gif",
	"gfx/menue/gallery_fr_0.gif",
	"gfx/menue/gallery_fr_1.gif",
	"gfx/menue/gallery_uk_0.gif",
	"gfx/landscape.gif",
	"gfx/landscape2.jpg",
	"gfx/stills.gif",
	"gfx/stills2.jpg",
	"gfx/interieur.gif",
	"gfx/interieur2.jpg",
	"gfx/sketches.gif",
	"gfx/sketches2.jpg",	
	"gfx/abstract.gif",
	"gfx/abstract2.jpg",
	"gfx/interieur.gif",
	"gfx/interieur2.jpg",
	"gfx/misc.gif",
	"gfx/misc2.jpg",
	"gfx/menue/gallery_uk_1.gif"
)
var url="start.htm"
var width_preloadbar=560

if(document.images){
	var c=0
	var cover=Math.floor(width_preloadbar/images_toload.length)
	var gfx=new Array()
	gfx[0]=new Image(1,1)
	gfx[0].src="gfx/loading1.gif"
	gfx[1]=new Image(1,1)
	gfx[1].src="gfx/loading2.gif"
	var i
	var images_pre=new Array()
	var loaded=new Array()
	var t
	var width_spare=width_preloadbar%cover
}

function loadImages(){
 for(i=0;i<images_toload.length;i++){
  images_pre[i]=new Image()
  images_pre[i].src=images_toload[i]
 }
 for(i=0;i<images_pre.length;i++){
  loaded[i]=false
 }
 checkLoad()
}

function checkLoad(){
	if(c==images_pre.length){
		// location.replace(url)
		hoehe = 500;
		breite = 700;
		output= "width=" + breite;
		output += ",height=" + hoehe;
		output += ",left = " + ((screen.width - breite) / 2);
		output += ",top = " + ((screen.height - hoehe) / 2);
		//w=window.open(url,'popup',output);
		//w.focus();
		//w.opener.blur();
		return;
	}
	for(i=0;i<=images_pre.length;i++){
		if(loaded[i]==false&&images_pre[i].complete){
			loaded[i]=true
			eval("document.img"+c+".src=gfx[1].src")
			c++
		}
	}
	t=setTimeout("checkLoad()",10)
}
