// 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( 'images/showers/Inline/resized/images/ILS1.jpg',//0
			'images/showers/Inline/resized/images/ILS2.jpg' , //1
			'images/showers/Inline/resized/images/ILS3.jpg' ,   //2
			'images/showers/Inline/resized/images/ILS4.jpg' , //3
			'images/showers/Inline/resized/images/ILS5.jpg' ,  //4
			'images/showers/Inline/resized/images/ILS6.jpg' ,  //5
			'images/showers/Inline/resized/images/ILS7.jpg' ,  //6
			'images/showers/Inline/resized/images/ILS8.jpg' ,  //7
			'images/showers/Inline/resized/images/ILS9.jpg' ,  //8
			'images/showers/NeoAngle/resized/images/NEO1.jpg' , //9
			'images/showers/NeoAngle/resized/images/NEO2.jpg' , //10
			'images/showers/NeoAngle/resized/images/NEOS2.jpg' , //11
			'images/showers/NeoAngle/resized/images/NEOS3.jpg', //12
			'images/showers/NeoAngle/resized/images/NEOS4.jpg', //13
			'images/showers/NeoAngle/resized/images/NEOS5.jpg', //14
			'images/showers/RightAngle/resized/images/RA1.jpg', //15
			'images/showers/RightAngle/resized/images/RA2.jpg', //16
			'images/showers/RightAngle/resized/images/RA3.jpg', //17
			'images/showers/RightAngle/resized/images/RA4.jpg', //18
			'images/showers/RightAngle/resized/images/RA5.jpg', //19
			'images/showers/RightAngle/resized/images/RA6.jpg', //20
			'images/showers/RightAngle/resized/images/RA7.jpg', //21
			'images/showers/RightAngle/resized/images/RAH1.jpg', //22
			'images/showers/Sliding/resized/images/STE1.jpg', //23
			'images/showers/Sliding/resized/images/STE2.jpg', //24
			'images/showers/Sliding/resized/images/STE3.jpg', //25
			'images/showers/Sliding/resized/images/STE4.jpg', //26
			'images/showers/Sliding/resized/images/STE5.jpg', //27
			'images/showers/Steam/resized/images/STS1.jpg', //28
			'images/showers/Steam/resized/images/STS2.jpg', //29
			'images/showers/Steam/resized/images/STS3.jpg', //30
			'images/showers/Steam/resized/images/STS4.jpg', //31
			'images/mirrors/resized/images/MB1.jpg', //32
			'images/mirrors/resized/images/MB2.jpg', //33
			'images/mirrors/resized/images/MB3.jpg', //34
			'images/mirrors/resized/images/MB4.jpg', //35
			'images/mirrors/resized/images/MB5.jpg', //36
			'images/mirrors/resized/images/MCM1.jpg', //37
			'images/mirrors/resized/images/MCM2.jpg', //38
			'images/mirrors/resized/images/MCM3.jpg', //39
			'images/mirrors/resized/images/MirrorWall.jpg', //40
			'images/mirrors/resized/images/MTR1.jpg', //41
			'images/showers/Art/resized/images/ARTS1.jpg', //42
			'images/showers/Art/resized/images/ARTS2.jpg', //43
			'images/showers/Art/resized/images/ARTS3.jpg', //44
			'images/showers/Art/resized/images/CST1.jpg', //45
			'images/showers/Handles/resized/images/Pic_381.jpg', //46
			'images/showers/Handles/resized/images/Pic_182.jpg', //47
			'images/showers/Handles/resized/images/Pic_184.jpg', //48
			'images/showers/Handles/resized/images/Pic_192.jpg', //49
			'images/showers/Handles/resized/images/Pic_196.jpg', //50
			'images/showers/Handles/resized/images/Pic_203.jpg', //51
			'images/showers/Handles/resized/images/Pic_207.jpg', //52
			'images/showers/Handles/resized/images/HN8.jpg', //53
			'images/showers/Handles/resized/images/HN9.jpg', //54
			'images/showers/Handles/resized/images/HN10.jpg'); //55

var yposition=250;                                  //POSITION OF LOAD BAR FROM TOP OF WINDOW, IN PIXELS
var loadedcolor='gray' ;                // PROGRESS BAR COLOR
var unloadedcolor='white';                   // BGCOLOR OF UNLOADED AREA
var barheight=15;                                 // HEIGHT OF PROGRESS BAR IN PIXELS (MIN 25)
var barwidth=350;                                // 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="1" face="sans-serif">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="1" face="sans-serif">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;