// Progressbar - Version 2.0
// Author: Brian Gosselin of http://scriptasylum.com
// Featured on Dynamic Drive (http://www.dynamicdrive.com)
// PUT THE NAMES OF ALL YOUR IMAGES THAT NEED TO BE "CACHED" IN THE "imagenames" ARRAY.
// DONT FORGET THE COMMA BETWEEN EACH ENTRY, OR THE TICK MARKS AROUND EACH NAME.
// WHEN ALL THE IMAGES ARE DONE LOADING, THE "imagesdone" VARIABLE IS SET TO "TRUE"

var imagenames=new Array( 
'Foto/brack_eu_0000.jpg' , 'Foto/brack_eu_0015.jpg' , 'Foto/brack_eu_0030.jpg' , 'Foto/brack_eu_0045.jpg' , 
'Foto/brack_eu_0100.jpg' , 'Foto/brack_eu_0115.jpg' , 'Foto/brack_eu_0130.jpg' , 'Foto/brack_eu_0145.jpg' , 
'Foto/brack_eu_0200.jpg' , 'Foto/brack_eu_0215.jpg' , 'Foto/brack_eu_0230.jpg' , 'Foto/brack_eu_0245.jpg' , 
'Foto/brack_eu_0300.jpg' , 'Foto/brack_eu_0315.jpg' , 'Foto/brack_eu_0330.jpg' , 'Foto/brack_eu_0345.jpg' , 
'Foto/brack_eu_0400.jpg' , 'Foto/brack_eu_0415.jpg' , 'Foto/brack_eu_0430.jpg' , 'Foto/brack_eu_0445.jpg' , 
'Foto/brack_eu_0500.jpg' , 'Foto/brack_eu_0515.jpg' , 'Foto/brack_eu_0530.jpg' , 'Foto/brack_eu_0545.jpg' , 
'Foto/brack_eu_0600.jpg' , 'Foto/brack_eu_0615.jpg' , 'Foto/brack_eu_0630.jpg' , 'Foto/brack_eu_0645.jpg' , 
'Foto/brack_eu_0700.jpg' , 'Foto/brack_eu_0715.jpg' , 'Foto/brack_eu_0730.jpg' , 'Foto/brack_eu_0745.jpg' , 
'Foto/brack_eu_0800.jpg' , 'Foto/brack_eu_0815.jpg' , 'Foto/brack_eu_0830.jpg' , 'Foto/brack_eu_0845.jpg' , 
'Foto/brack_eu_0900.jpg' , 'Foto/brack_eu_0915.jpg' , 'Foto/brack_eu_0930.jpg' , 'Foto/brack_eu_0945.jpg' , 
'Foto/brack_eu_1000.jpg' , 'Foto/brack_eu_1015.jpg' , 'Foto/brack_eu_1030.jpg' , 'Foto/brack_eu_1045.jpg' ,
'Foto/brack_eu_1100.jpg' , 'Foto/brack_eu_1115.jpg' , 'Foto/brack_eu_1130.jpg' , 'Foto/brack_eu_1145.jpg' ,
'Foto/brack_eu_1200.jpg' , 'Foto/brack_eu_1215.jpg' , 'Foto/brack_eu_1230.jpg' , 'Foto/brack_eu_1245.jpg' ,
'Foto/brack_eu_1300.jpg' , 'Foto/brack_eu_1315.jpg' , 'Foto/brack_eu_1330.jpg' , 'Foto/brack_eu_1345.jpg' ,
'Foto/brack_eu_1400.jpg' , 'Foto/brack_eu_1415.jpg' , 'Foto/brack_eu_1430.jpg' , 'Foto/brack_eu_1445.jpg' ,
'Foto/brack_eu_1500.jpg' , 'Foto/brack_eu_1515.jpg' , 'Foto/brack_eu_1530.jpg' , 'Foto/brack_eu_1545.jpg' ,
'Foto/brack_eu_1600.jpg' , 'Foto/brack_eu_1615.jpg' , 'Foto/brack_eu_1630.jpg' , 'Foto/brack_eu_1645.jpg' ,
'Foto/brack_eu_1700.jpg' , 'Foto/brack_eu_1715.jpg' , 'Foto/brack_eu_1730.jpg' , 'Foto/brack_eu_1745.jpg' ,
'Foto/brack_eu_1800.jpg' , 'Foto/brack_eu_1815.jpg' , 'Foto/brack_eu_1830.jpg' , 'Foto/brack_eu_1845.jpg' ,
'Foto/brack_eu_1900.jpg' , 'Foto/brack_eu_1915.jpg' , 'Foto/brack_eu_1930.jpg' , 'Foto/brack_eu_1945.jpg' ,
'Foto/brack_eu_2000.jpg' , 'Foto/brack_eu_2015.jpg' , 'Foto/brack_eu_2030.jpg' , 'Foto/brack_eu_2045.jpg' ,
'Foto/brack_eu_2100.jpg' , 'Foto/brack_eu_2115.jpg' , 'Foto/brack_eu_2130.jpg' , 'Foto/brack_eu_2145.jpg' ,
'Foto/brack_eu_2200.jpg' , 'Foto/brack_eu_2215.jpg' , 'Foto/brack_eu_2230.jpg' , 'Foto/brack_eu_2245.jpg' ,
'Foto/brack_eu_2300.jpg' , 'Foto/brack_eu_2315.jpg' , 'Foto/brack_eu_2330.jpg' , 'Foto/brack_eu_2345.jpg'

);

var yposition=390;                                  //POSITION OF LOAD BAR FROM TOP OF WINDOW, IN PIXELS
var loadedcolor='red' ;                // PROGRESS BAR COLOR
var unloadedcolor='white';                   // BGCOLOR OF UNLOADED AREA
var barheight=25;                                 // HEIGHT OF PROGRESS BAR IN PIXELS (MIN 25)
var barwidth=400;                                // WIDTH OF THE BAR IN PIXELS  
var bordercolor='black';                       // COLOR OF THE BORDER

//DO NOT EDIT BEYOND THIS POINT 
var NS4 = (navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
var IE4 = (document.all)? true : false;
var NS6 = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var imagesdone=false;
var blocksize=barwidth/(imagenames.length);
barheight=Math.max(barheight,25);
var loaded=0, perouter, perdone, images=new Array();
var txt=(NS4)?'<layer name="perouter" bgcolor="'+bordercolor+'" visibility="hide">' : '<div id="perouter" style="position:absolute; visibility:hidden; background-color:'+bordercolor+'">';
txt+='<table cellpadding="0" cellspacing="1" border="0"><tr><td width="'+barwidth+'" height="'+barheight+'" valign="center">';
if(NS4)txt+='<ilayer width="100%" height="100%"><layer width="100%" height="100%" bgcolor="'+unloadedcolor+'" top="0" left="0">';
txt+='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="center" width="'+barwidth+'" height="'+barheight+'" bgcolor="'+unloadedcolor+'"><center><font color="'+loadedcolor+'" size="3" face="verdana">Loading Images...</font></center></td></tr></table>';
if(NS4) txt+='</layer>';
txt+=(NS4)? '<layer name="perdone" width="100%" height="'+barheight+'" bgcolor="'+loadedcolor+'" top="0" left="0">' : '<div id="perdone" style="position:absolute; top:1px; left:1px; width:'+barwidth+'px; height:'+barheight+'px; background-color:'+loadedcolor+'; z-index:100">';
txt+='<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="center" width="'+barwidth+'" height="'+barheight+'" bgcolor="'+loadedcolor+'"><center><font color="'+unloadedcolor+'" size="3" face="verdana">Loading Images...</font></center></td></tr></table>';
txt+=(NS4)? '</layer></ilayer>' : '</div>';
txt+='</td></tr></table>';
txt+=(NS4)?'</layer>' : '</div>';
document.write(txt);
function loadimages(){
if(NS4){
perouter=document.perouter;
perdone=document.perouter.document.layers[0].document.perdone;
}
if(NS6){
perouter=document.getElementById('perouter');
perdone=document.getElementById('perdone');
}
if(IE4){
perouter=document.all.perouter;
perdone=document.all.perdone;
}
cliplayer(perdone,0,0,barheight,0);
window.onresize=setouterpos;
setouterpos();
for(n=0;n<imagenames.length;n++){
images[n]=new Image();
images[n].src=imagenames[n];
setTimeout('checkload('+n+')' ,n*100);
}}
function setouterpos(){
var ww=(IE4)? document.body.clientWidth : window.innerWidth;
var x=(ww-barwidth)/2;
if(NS4){
perouter.moveTo(x,yposition);
perouter.visibility="show";
}
if(IE4||NS6){
perouter.style.left=x+'px';
perouter.style.top=yposition+'px';
perouter.style.visibility="visible";
}}
function dispbars(){
loaded++;
cliplayer(perdone, 0, blocksize*loaded, barheight, 0);
if(loaded>=imagenames.length)setTimeout('hideperouter()', 800);
}
function checkload(index){
(images[index].complete)? dispbars() : setTimeout('checkload('+index+')', 100);
}
function hideperouter(){
(NS4)? perouter.visibility="hide" : perouter.style.visibility="hidden";
imagesdone=true;
}
function cliplayer(layer, ct, cr, cb, cl){
if(NS4){
layer.clip.left=cl;
layer.clip.top=ct;
layer.clip.right=cr;
layer.clip.bottom=cb;
}
if(IE4||NS6)layer.style.clip='rect('+ct+' '+cr+' '+cb+' '+cl+')';
}
window.onload=loadimages;