<!--

var picHolder;
var barNumber = 22;     	// amount of images in loading bar
var loadComplete = 0;	

var picsLoad = new Array(

"img/sections/loading/default.gif" , 8, 15,	// loading bar
"img/sections/loading/indi_01.gif" , 10, 15,	
"img/sections/loading/indi_02.gif" , 8, 15,	
"img/sections/loading/indi_03.gif" , 10, 15,	
"img/sections/loading/lb_bot.gif" , 181, 6,
"img/sections/loading/lb_left.gif" , 9, 30,
"img/sections/loading/lb_mid.gif" , 181, 16,
"img/sections/loading/lb_right.gif" , 10, 30,
"img/sections/loading/lb_top.gif" , 181, 8,
"img/sections/loading/leftdef.gif" , 10, 15

);

var bigLoad = new Array(

"img/sections/home/cob_ban.jpg", 16, 500, 375,
"img/sections/home/cob_ban0.jpg", 18, 500, 375, 
"img/sections/home/disk1.gif", 3, 65, 65,
"img/sections/home/disk2.gif", 2, 65, 65, 
"img/sections/home/disk3.gif", 2, 65, 65,
"img/sections/home/disko1.gif", 3, 65, 65, 
"img/sections/home/disko2.gif", 3, 65, 65,
"img/sections/home/disko3.gif", 3, 65, 65,
"img/sections/about/splatban.gif", 9, 190, 60, 
"img/sections/contact/splatban.gif", 10, 190, 60, 
"img/sections/copy/splatban.gif", 10, 190, 60, 
"img/sections/links/splatban.gif", 9, 190, 60, 
"img/sections/products/splatban.gif", 10, 190, 60, 
"img/sections/services/splatban.gif", 10, 190, 60, 
"img/art/nopic.gif", 4, 250, 62, 
"img/art/popban.jpg", 10, 150, 113, 
"img/shared/textbox/bottom.gif", 4, 95, 45, 
"img/shared/textbox/cornerlb.gif", 3, 45, 45, 
"img/shared/textbox/cornerlt.gif", 3, 45, 60,
"img/shared/textbox/cornerrb.gif", 3, 45, 45, 
"img/shared/textbox/cornerrt.gif", 3, 45, 60, 
"img/shared/textbox/left.gif", 4, 45, 95, 
"img/shared/textbox/right.gif", 4, 45, 95, 
"img/shared/textbox/top.gif", 4, 95, 60, 
"img/shared/bg.gif", 6, 1372, 94,
"img/shared/cob_bans.jpg", 10, 300, 98, 
"img/shared/menu/mabout.gif", 7, 122, 47,
"img/shared/menu/mabouto.gif", 6, 122, 47,
"img/shared/menu/mcont.gif", 8, 122, 49,
"img/shared/menu/mconto.gif", 6, 122, 49,
"img/shared/menu/mhome.gif", 8, 122, 56,	
"img/shared/menu/mhomeo.gif", 7, 122, 56,
"img/shared/menu/mlink.gif", 7, 122, 50,
"img/shared/menu/mlinko.gif", 6, 122, 50,
"img/shared/menu/mprod.gif", 7, 122, 47,
"img/shared/menu/mprodo.gif", 6, 122, 47,
"img/shared/menu/mserv.gif", 8, 122, 49,
"img/shared/menu/mservo.gif", 7, 122, 49,
"img/shared/menu/mside.gif", 5, 28, 298,
"img/shared/menu/trans.gif", 1, 1, 1

);

var picCounter = 0;
var totalSize = 0;
var curLoaded = 0;
var done = false;

function doLoad()
{
	sumSize();
	loadImages("pL");
	loadImages();
}


// sum total size of images to be preloaded
function sumSize()
{
	var a;	//counter  

	for(a = 1; a < bigLoad.length; a += 4)
	{
		totalSize += bigLoad[a];
	}
}


//	preload images in parameterized array  
function loadImages(useArray)
{
	var i, j;			// counter variables
	
	if(useArray == "pL")
	{
		for(i = 0; i < picsLoad.length; i += 3)
		{
			picHolder = new Image(picsLoad[i + 1], picsLoad[i + 2]);	 
			picHolder.src = picsLoad[i];
		}
	}
	else
	{
		if(picCounter < bigLoad.length)
		{
			picHolder = new Image(bigLoad[picCounter + 2], bigLoad[picCounter + 3]); 
			picHolder.src = bigLoad[picCounter];
			waitLoad();
		}
	}
}
function waitLoad()
{
	
		
		if(picHolder.complete == false)
		{
			loadComplete++;
			
				if(loadComplete == 30)
				{
					alert("Picture " + picHolder.src + " not found");
					contLoading();
				}				
				else
				{
					setTimeout("waitLoad()", 500);
				}
		}
		else
		{
			contLoading();
		}
}

function contLoading()
{ 
		countLoading(bigLoad[picCounter + 1]);
		picCounter += 4;
		loadComplete = 0;
		loadImages();
}

function countLoading(sizeKB)
{
	var percentage = 0;	// kb's loaded so far converted to /100	


	curLoaded += sizeKB;
	
	percentage = parseInt(curLoaded / totalSize * 100);

	if(document.all)
	{
		perIndicator.innerHTML   = percentage + "% loaded";	// indicates the percentage loaded below the bar
	}
	if(document.layers)
	{
		document.netIndicator.document.write("<CENTER>" + "<B>");
		document.netIndicator.document.write("<FONT SIZE='2' FACE='ARIAL, HELVETICA, SANS SERIF' COLOR='#285C00'>");  
		document.netIndicator.document.write(percentage + "% loaded");
		document.netIndicator.document.write("</CENTER>" + "</B>");
		document.netIndicator.document.close()
	}		
	


	if(curLoaded == totalSize)
	{
		done = true;
	}
		
//begin image swapping
	var barCountdes = percentage / (100 / barNumber);	
	var barCount = parseInt(percentage / (100 / barNumber));	
	var swapCounter;
	var totalOne = 0;

		if(barCount == 1)
		{
			document.bar1.src="img/sections/loading/indi_01.gif";
			totalOne++;
		}

		else if(barCount > 1 && barCount < barNumber)
		{
			for(swapCounter = 1; swapCounter < barCount; barCount--)
			{		
				if(totalOne == 0)
				{
					document.bar1.src="img/sections/loading/indi_01.gif";
				}
		
					document.images[("bar" + barCount)].src = "img/sections/loading/indi_02.gif";
							
						if(done == true)
						{
							document.bar22.src = "img/sections/loading/indi_03.gif";		
							setTimeout("endOfSchlep()",0);
						}
			}
		}
		else if(barCount == barNumber)
		{
				document.bar22.src = "img/sections/loading/indi_03.gif";			
				setTimeout("endOfSchlep()",4000);
		}		 


}

function endOfSchlep()
{
	document.location = "htm/home.html";
}

//-->
	
