///// Plugin variables
playspeed=5000;// The playspeed determines the delay for the "Play" button in ms
dotrans=1; // if value = 1 then there are transitions played in IE
transtype='blendTrans';// 'blendTrans' or 'revealtrans'
transattributes='duration=1,transition=23';// duration=seconds,transition=#<24
randomorder=0;
linksperline=4; // For the text links
playdiffernce=1000; // The speed that the autplay speed is changed by
autostart=1;
preloadslides=1;
// <!-- end of configurable script -->
// <!-- plugin scripts -->
var loaded = 0;
var total = theimage.length;-1
var cPercent = 0;
var barLayer = null;
var percentLayer = null;
var statLayer = null;
var doneMsgLayer = null;

function getLayer(layerID) {
    if (document.getElementById)
	     return document.getElementById(layerID);
    else if (document.all)
	     return document.all[layerID];
    else 
	return null;
}

//function imgLoaded() {
//    loaded++;
//    if (loaded>theimage.length)
//    return
//    updateBar();
//}

function updateBar() {
    statLayer.innerHTML = "<font face=\"Arial\" color=\"#808080\"> <small><b>Preloaded " +loaded+ " / " +total+ " files </b></small></font>";
    var percent = Math.round(loaded/total * 100);
    if (cPercent != percent)
	{
	cPercent = percent;
	barLayer.style.width = (cPercent*2.9) +"px";
	percentLayer.innerHTML = "<font color=\"#80808\"><small><b> Preload " +cPercent+ "% Completed</b></small></font>";
	}
    if (loaded == total)
	{
	statLayer.innerHTML = "<font face=\"Arial\" color=\"#808080\"> <small><b>Preload   " +loaded+ " / " +total+ " files completed </b></small></font>";
	if(window.autostart)slidePlay();
	}
}
// Preloader
function preloadSlide() {
   if (document.getElementById || document.all)
     {
      barLayer = getLayer("bar");
      percentLayer = getLayer("percent");
      statLayer = getLayer("stat");
      doneMsgLayer = getLayer("doneMsg");
       }
    for(k=0;k<til;k++) {theimage[k][1]=new Image().src=theimage[k][1];
   // imgLoaded();
      loaded++;
      if (loaded>theimage.length)
      return
      updateBar();
}}
    
// Add extra functions between the {} if you need other functions that require the onload
window.onload=function(){if(window.preloadslides)preloadSlide();}


// NS4 resize handler
window.onresize=function(){
if(document.layers)this.location=this.location;}

// <!-- end of plugin scripts -->

