// 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( 
'regular/aovlogo.jpg',
'pictures/amar0001.jpg',
'pictures/amar0002.jpg',
'pictures/amar0003.jpg',
'pictures/amar0004.jpg',
'pictures/amar0005.jpg',
'pictures/amar0006.jpg',
'pictures/amar0007.jpg',
'pictures/aapr0001.jpg',
'pictures/aapr0002.jpg',
'pictures/aapr0003.jpg',
'pictures/aapr0004.jpg',
'pictures/aapr0005.jpg',
'pictures/aapr0006.jpg',
'pictures/aapr0007.jpg',
'pictures/aapr0008.jpg',
'pictures/aapr0009.jpg',
'pictures/aapr0010.jpg',
'megga/meggapictures/t-mg01.jpg',
'megga/meggapictures/t-mg02.jpg',
'megga/meggapictures/t-mg03.jpg',
'megga/meggapictures/t-mg04.jpg',
'megga/meggapictures/t-mg05.jpg',
'megga/meggapictures/t-mg06.jpg',
'megga/meggapictures/t-mg07.jpg',
'megga/meggapictures/t-mg08.jpg',
'megga/meggapictures/t-mg09.jpg',
'megga/meggapictures/t-mg10.jpg',
'megga/meggapictures/t-mg11.jpg',
'megga/meggapictures/t02-mg0201.jpg',
'megga/meggapictures/t02-mg0202.jpg',
'megga/meggapictures/t02-mg0203.jpg',
'megga/meggapictures/t02-mg0204.jpg',
'megga/meggapictures/t02-mg0205.jpg',
'megga/meggapictures/t02-mg0206.jpg',
'megga/meggapictures/t02-mg0207.jpg',
'megga/meggapictures/t02-mg0208.jpg',
'megga/meggapictures/t02-mg0209.jpg',
'megga/meggapictures/t02-mg0210.jpg',
'megga/meggapictures/t02-mg0211.jpg',
'megga/meggapictures/t02-mg0212.jpg',
'megga/meggapictures/t03-mg0201.jpg',
'megga/meggapictures/t03-mg0202.jpg',
'megga/meggapictures/t03-mg0203.jpg',
'megga/meggapictures/t03-mg0204.jpg',
'megga/meggapictures/t03-mg0205.jpg',
'megga/meggapictures/t03-mg0206.jpg',
'megga/meggapictures/t03-mg0207.jpg',
'megga/meggapictures/t03-mg0208.jpg',
'megga/meggapictures/t03-mg0209.jpg',
'megga/meggapictures/t03-mg0210.jpg',
'megga/meggapictures/t03-mg0211.jpg',
'megga/meggapictures/t03-mg0212.jpg',
'megga/meggapictures/t03-mg0213.jpg',
'megga/meggapictures/t-mg0401.jpg',
'megga/meggapictures/t-mg0402.jpg',
'megga/meggapictures/t-mg0403.jpg',
'megga/meggapictures/t-mg0404.jpg',
'megga/meggapictures/t-mg0405.jpg',
'megga/meggapictures/t-mg0406.jpg',
'megga/meggapictures/t-mg0407.jpg',
'megga/meggapictures/t-mg0408.jpg',
'megga/meggapictures/t-mg0501.jpg',
'megga/meggapictures/t-mg0502.jpg',
'megga/meggapictures/t-mg0503.jpg',
'megga/meggapictures/t-mg0504.jpg',
'megga/meggapictures/t-mg0505.jpg',
'megga/meggapictures/t-mg0506.jpg',
'megga/meggapictures/t-mg0507.jpg',
'megga/meggapictures/t-mg0508.jpg',
'megga/meggapictures/t-mg0509.jpg',
'megga/meggapictures/t-mg0510.jpg',
'megga/meggapictures/t-mg0511.jpg',
'megga/meggapictures/t-mg0601.jpg',
'megga/meggapictures/t-mg0602.jpg',
'megga/meggapictures/t-mg0603.jpg',
'megga/meggapictures/t-mg0604.jpg',
'megga/meggapictures/t-mg0605.jpg',
'megga/meggapictures/t-mg0606.jpg',
'megga/meggapictures/t-mg0607.jpg',
'megga/meggapictures/t-mg0608.jpg',
'megga/meggapictures/t-mg0701.jpg',
'megga/meggapictures/t-mg0702.jpg',
'megga/meggapictures/t-mg0703.jpg',
'megga/meggapictures/t-mg0704.jpg',
'megga/meggapictures/t-mg0705.jpg',
'megga/meggapictures/t-mg0706.jpg',
'megga/meggapictures/t-mg0707.jpg',
'megga/meggapictures/t-mg0708.jpg'
'megga/meggapictures/t-mg0709.jpg',
'megga/meggapictures/t-mg0710.jpg',
'megga/meggapictures/t-mg0711.jpg',
'megga/meggapictures/t-mg0712.jpg',
'megga/meggapictures/t-mg0713.jpg',
'megga/meggapictures/t-mg0714.jpg',
'megga/meggapictures/t-mg0715.jpg',
'megga/meggapictures/t-mg0716.jpg',
'megga/meggapictures/t-mg08-01.jpg',
'megga/meggapictures/t-mg08-02.jpg',
'megga/meggapictures/t-mg08-03.jpg',
'megga/meggapictures/t-mg08-04.jpg',
'megga/meggapictures/t-mg08-05.jpg',
'megga/meggapictures/t-mg08-06.jpg',
'megga/meggapictures/t-mg08-07.jpg',
'megga/meggapictures/t-mg08-08.jpg'
'megga/meggapictures/t-mg08-09.jpg',
'megga/meggapictures/t-mg08-10.jpg',
'megga/meggapictures/t-mg08-11.jpg',
'megga/meggapictures/t-mg08-12.jpg',
'megga/meggapictures/t-mg08-13.jpg',
'megga/meggapictures/t-mg08-14.jpg',
'megga/meggapictures/t-mg09-01.jpg',
'megga/meggapictures/t-mg09-02.jpg',
'megga/meggapictures/t-mg09-03.jpg',
'megga/meggapictures/t-mg09-04.jpg',
'megga/meggapictures/t-mg09-05.jpg',
'megga/meggapictures/t-mg09-06.jpg',
'megga/meggapictures/t-mg09-07.jpg',
'megga/meggapictures/t-mg09-08.jpg'
'megga/meggapictures/t-mg09-09.jpg',
'megga/meggapictures/t-mg09-10.jpg',
'megga/meggapictures/t-mg09-11.jpg',
'megga/meggapictures/t-mg09-12.jpg',
'megga/meggapictures/t-mg09-13.jpg',
'megga/meggapictures/t-mg09-14.jpg'


);

var yposition=1650;
var loadedcolor='#000080';
var unloadedcolor='white';
var barheight=25;
var barwidth=350;
var bordercolor='black';

//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;
