<!-- begin hiding
// (C) 2000 Marcin P Wojtowicz [one_spook@hotmail.com]. All rights reserved.
// Obtain permission before selling/redistributing in any medium.

startingColor = new Array() // <-- Do not modify!
endingColor = new Array() // <-- Do not modify!

// YOU MAY MODIFY THE FOLLOWING:
var yourImages = new Array("images/apsa_bullet.gif", 
"images/apsa_hnav_bg.gif",
"images/apsa_hnavbar.gif",
"images/apsa_hnavbar_b1.gif",
"images/apsa_hnavbar_b1_over.gif",
"images/apsa_hnavbar_b2.gif",
"images/apsa_hnavbar_b2_over.gif",
"images/apsa_hnavbar_b3.gif",
"images/apsa_hnavbar_b3_over.gif",
"images/apsa_leftcolumn_bg.gif",
"images/apsa_leftcolumn_bottom2.gif",
"images/apsa_logo.gif",
"images/apsa_mid_left.gif",
"images/apsa_mid_right.gif",
"images/apsa_spacer.gif",
"images/apsa_subheading.gif",
"images/apsa_topstrip.gif",
"images/apsa_topstrip_corner.gif",
"images/apsa_image1am.gif",
"images/apsa_image2am.gif",
"images/apsa_image3am.gif",
"images/cinta_c.jpg",
"images/corrugado.jpg",
"images/engomado.jpg",
"images/esquineros_c.jpg",
"images/folders.jpg",
"images/guia.jpg",
"images/kraft.jpg",
"images/leftborder.jpg",
"images/lustre_c.jpg",
"images/micro.jpg",
"images/tubos_c.jpg")
// Fill this array with the images you wish to preload
var locationAfterPreload = "inicio.htm" // The script will redirect here when the preloading finishes *successfully*
var preloadbarWidth =600  // The length of the preload bar. Should be greater than total amount of images you want to preload!
var preloadbarHeight = 35 // The height of the gradient/preload bar
var backgroundOfGradient = "#000000" // Default color while the preload bar is "filling up"

// Color the preloadbar is starting with - enter 1st, 3rd and 5th numbers/letters of color code
startingColor[0] = "f" 
startingColor[1] = "f"
startingColor[2] = "e"

// Color the preloadbar is going to end up with - enter the 1st, 3rd and 5th numbers/letters of color code
endingColor[0] = "0"
endingColor[1] = "6"
endingColor[2] = "b"

// FOR TROUBLESHOOTING:
var gap = 4 // PLAY AROUND WITH THIS SETTING IF YOU GET A JAVASCRIPT ERROR!!! 2 is the minumum value!!!


// DO NOT MODIFY ANYTHING BEYOND THIS POINT!!!

if (!document.all) location.replace(locationAfterPreload)
var a = 10, b = 11, c = 12, d = 13, e = 14, f=15, i, j, ones = new Array(), sixteens = new Array(), diff = new Array();
var convert = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"), imgLen = yourImages.length;
var loaded = new Array(), preImages = new Array(), currCount = 0, pending = 0, h = 0, hilite = new Array(), cover = new Array();
var num = Math.floor(preloadbarWidth/gap);
for (i = 0; i < 3; i++) {
	startingColor[i] = startingColor[i].toLowerCase();
	endingColor[i] = endingColor[i].toLowerCase();
	startingColor[i] = eval(startingColor[i]);
	endingColor[i] = eval(endingColor[i]);
	diff[i] = (endingColor[i]-startingColor[i])/num;
	ones[i] = Math.floor(diff[i]);
	sixteens[i] = Math.round((diff[i] - ones[i])*15);
}
endingColor[0] = 0;
endingColor[1] = 0;
endingColor[2] = 0;
i = 0, j = 0;
while (i <= num) {
	hilite[i] = "#";
	while (j < 3) {
		hilite[i] += convert[startingColor[j]];
		hilite[i] += convert[endingColor[j]];
		startingColor[j] += ones[j];
		endingColor[j] += sixteens[j];
		if (endingColor[j] > 15) {
			endingColor[j] -= 15;
			startingColor[j]++;
		}
		j++;
	}
	j = 0;
	i++;
}
function loadImages() {
	for (i = 0; i < imgLen; i++) {
		preImages[i] = new Image();
		preImages[i].src = yourImages[i];
		loaded[i] = 0;
		cover[i] = Math.floor(num/imgLen)*(i+1)
	}
	cover[cover.length-1] += num%imgLen
	checkLoad();
}
function checkLoad() {
	if (pending) { changeto(); return }
	if (currCount == imgLen) { location.replace(locationAfterPreload); return }
	for (i = 0; i < imgLen; i++) {
		if (!loaded[i] && preImages[i].complete) {
			loaded[i] = 1; pending++; currCount++;
			checkLoad();
			return;
		}
	}
	setTimeout("checkLoad()",10);
}
function changeto() {
	if (h+1 > cover[currCount-1]) {
		var percent = Math.round(100/imgLen)*currCount;
		if (percent > 100) while (percent != 100) percent--;
		if (currCount == imgLen && percent < 100) percent = 100;
		defaultStatus = "Loaded " + currCount + " out of " + imgLen + " images [" + percent + "%].";
		pending--;
		checkLoad();
		return;
	}
	eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]");;
	h++;
	setTimeout("changeto()",1);
}
defaultStatus = "Loaded 0 out of " + imgLen + " images [0%]."
// end hiding -->
