var loadet=true;
var showAll=false;
var pop;
//CHECK BROWSER-VERSION
function checkBrowser(){
    this.ver=navigator.appVersion;
    this.dom=document.getElementById?1:0;
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;        
    this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1;
    this.ie5mac=this.ie5 && navigator.userAgent.indexOf("Mac")>-1;
    this.ie55=(this.ver.indexOf("MSIE 5.5")>-1 && this.dom)?1:0; 
    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie5mac);
    return this;
}
var bw=new checkBrowser();

var img = new Array(36);
for(i=0; i<36; i++) img[i] = new Image();		
img[0].src='images/noPic.gif';

img[1].src='images/a1.jpg';
img[2].src='images/b1.jpg';
img[3].src='images/c1.jpg';
img[4].src='images/d1.jpg';
img[5].src='images/e1.jpg';

img[6].src='images/a2.jpg';	
img[7].src='images/b2.jpg';
img[8].src='images/c2.jpg';
img[9].src='images/d2.jpg';
img[10].src='images/e2.jpg';

img[11].src='images/a3.jpg';	
img[12].src='images/b3.jpg';
img[13].src='images/c3.jpg';
img[14].src='images/d3.jpg';
img[15].src='images/e3.jpg';

img[16].src='images/a4.jpg';	
img[17].src='images/b4Text.jpg';
img[18].src='images/c4Text.jpg';
img[19].src='images/d4Text.jpg';
img[20].src='images/e4.jpg';

img[21].src='images/a5.jpg';	
img[22].src='images/b5.jpg';
img[23].src='images/c5.jpg';
img[24].src='images/d5.jpg';
img[25].src='images/e5.jpg';

img[26].src='images/a6.jpg';	
img[27].src='images/b6.jpg';
img[28].src='images/c6.jpg';
img[29].src='images/d6.jpg';
img[30].src='images/e6.jpg';

img[31].src='images/a7Sky.jpg';	
img[32].src='images/b7.jpg';
img[33].src='images/c7.jpg';
img[34].src='images/d7.jpg';
img[35].src='images/e7.jpg';

function viewAll(){	
	showAll=true;
	document.a1.src=img[1].src;
	document.b1.src=img[2].src;
	document.c1.src=img[3].src;
	document.d1.src=img[4].src;
	document.e1.src=img[5].src;
	document.a2.src=img[6].src;
	document.b2.src=img[7].src;
	document.c2.src=img[8].src;
	document.d2.src=img[9].src;
	document.e2.src=img[10].src;
	document.a3.src=img[11].src;
	document.b3.src=img[12].src;
	document.c3.src=img[13].src;
	document.d3.src=img[14].src;
	document.e3.src=img[15].src;
	document.a4.src=img[16].src;
	document.b4.src=img[17].src;
	document.c4.src=img[18].src;
	document.d4.src=img[19].src;
	document.e4.src=img[20].src;
	document.a5.src=img[21].src;
	document.b5.src=img[22].src;
	document.c5.src=img[23].src;
	document.d5.src=img[24].src;
	document.e5.src=img[25].src;
	document.a6.src=img[26].src;
	document.b6.src=img[27].src;
	document.c6.src=img[28].src;
	document.d6.src=img[29].src;
	document.e6.src=img[30].src;
	document.a7.src=img[31].src;
	document.b7.src=img[32].src;
	document.c7.src=img[33].src;
	document.d7.src=img[34].src;
	document.e7.src=img[35].src;
	
}

function init(){
	var page=new makePageCoords();
	scrollerLeft = Math.round((page.x2-775)/2);
	scrollerTop = Math.round((page.y2-400)/2);
	alert(scrollerTop);
}

function makePageCoords(){	
	this.x=0;this.x2=(bw.ns4 || bw.ns5)?innerWidth:document.body.offsetWidth;
	this.y=0;this.y2=(bw.ns4 || bw.ns5)?innerHeight:document.body.offsetHeight;	
	return this;
}

function newWindow(){
	window.open('site.php','new','width='+screen.width+',height='+screen.height+',left=0,top=0,resizable=yes,location=no,directories=no,menubar=no,scrollbars=yes,status=no');	
}
function openWSize(file,header,width,height){
	if(pop)pop.close();
	pop=window.open(file,header,'width='+width+',height='+height+',left='+Math.round(Math.random()*400)+',top='+Math.round(Math.random()*400)+';resizable=no,location=no,directories=no,menubar=no,scrollbars=no,status=no');
	pop.focus()	
}
function openWSizeWithScrollbars(file,header,width,height){
	if(pop)pop.close();
	pop=window.open(file,header,'width='+width+',height='+height+',left='+Math.round(Math.random()*400)+',top='+Math.round(Math.random()*400)+';resizable=yes,location=no,directories=no,menubar=no,scrollbars=yes,status=no');
	pop.focus()	
}
function showIMG(element){	
	if(element.style.visibility=='visible'){
	     element.style.visibility='hidden';
	     element.style.display="none";
	}
	else{
	     element.style.visibility='visible';
	     element.style.display="";
	}
}
