// JavaScript Document
<!-- begin hiding

/*
Preload Image With Update Bar Script (By Marcin Wojtowicz [one_spook@hotmail.com])
Submitted to and permission granted to Dynamicdrive.com to feature script in it's archive
For full source code to this script and 100's more, visit http://dynamicdrive.com
*/

// You may modify the following:
	var locationAfterPreload = "show.php" // URL of the page after preload finishes
	var lengthOfPreloadBar = 150 // Length of preload bar (in pixels)
	var heightOfPreloadBar = 15 // Height of preload bar (in pixels)
	// Put the URLs of images that you want to preload below (as many as you want)
	var yourImages = new Array("../IMG/paper2.png", "../IMG/paper.png", "../IMG/linen.png", "/IMG/over.png" )

// Do not modify anything beyond this point!
if (document.images) {
	var dots = new Array() 
	dots[0] = new Image(1,1)
	dots[0].src = "../IMG/green.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size)
	dots[1] = new Image(1,1)
	dots[1].src = "../IMG/pink.gif" // color of bar as preloading progresses (same note as above)
	var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0
	var loaded = new Array(),i,covered,timerID
	var leftOverWidth = lengthOfPreloadBar%coverage
}
function loadImages() { 
	for (i = 0; i < yourImages.length; i++) { 
		preImages[i] = new Image()
		preImages[i].src = yourImages[i]
	}
	for (i = 0; i < preImages.length; i++) { 
		loaded[i] = false
	}
	checkLoad()
}
function checkLoad() {
	if (currCount == preImages.length) { 
		flipImages();
		//moveImage();
		//location.replace(locationAfterPreload)
		return
	}
	for (i = 0; i <= preImages.length; i++) {
		if (loaded[i] == false && preImages[i].complete) {
			loaded[i] = true
			eval("document.img" + currCount + ".src=dots[1].src")
			currCount++
		}
	}
	timerID = setTimeout("checkLoad()",10) 
}
// end hiding -->


function flipImages(){
	document.getElementById("COVER").style.visibility = 'hidden';
	document.getElementById("loader").style.visibility = 'hidden';
	//document.getElementById("MENU").style.visibility = 'visible';
	//document.getElementById("KNIFE").style.visibility = 'visible';
}

var x = 0; //Starting Location - left
var y = 0; //Starting Location - top
var dest_x = 0;  //Ending Location - left
var dest_y = -5000;  //Ending Location - top
var interval = 60; //Move 10px every initialization

function moveImage() {
	//Keep on moving the image till the target is achieved
	if(x != dest_x) x = x + interval; 
	if(y != dest_y) y = y + interval;
	
	//Move the image to the new location
	document.getElementById("COVER").style.top  = y+'px';
	document.getElementById("loader").style.top  = y+'px';
	
	

	if ((x+interval < dest_x) || (y+interval < dest_y)) {
		//Keep on calling this function every 100 microsecond 
		//	till the target location is reached
		window.setTimeout('moveImage()',100);
	}
}
