var place = "../../Images/JobPhotos/Warehouse"
var type = "jpg"
var start = "1"
var delay = 7000
var lock = false
var run
var image=new Image();
var msg=new Array(12);
var img=new Array(24);
msg[1]="Rite Aid.  Aberdeen, MD"
msg[2]="Rite Aid.  Aberdeen, MD"
msg[3]="Fry Communications, Inc.  Cumberland County, PA"
msg[4]="Fry Communications, Inc.  Cumberland County, PA"
msg[5]="Michel Distribution Services.  Aberdeen, MD"
msg[6]="Toys R Us.  Elizabeth, NJ"
msg[7]="Amp Integrated Manufacturing Facility.  Lickdale, PA"
msg[8]="Amp Integrated Manufacturing Facility.  Lickdale, PA"
msg[9]="Family Dollar.  Front Royal, VA"
msg[10]="Family Dollar.  Front Royal, VA"
msg[11]="Fore Systems.  Warrendale, PA"
msg[12]="Nichia.  Columbia, PA"
var lastpic = "12";
var loadpic = "24";
var firstpic = "1";
function next() {
	text = document.all ? document.all["Descript"] : document.getElementById ? document.getElementById("Descript") : document["Descript"];
	if (lastpic == start) {
		start = firstpic;
		image.src = place + firstpic + 'Up.' + type;
		document["picholder"].src = image.src
		text.innerHTML=msg[firstpic]
	}
	else {
		start++
		image.src = place + start + 'Up.' + type;
		document["picholder"].src = image.src
		text.innerHTML=msg[start]
	}
}
function back() {
	text = document.all ? document.all["Descript"] : document.getElementById ? document.getElementById("Descript") : document["Descript"];
	if (firstpic == start) {
		start = lastpic;
		image.src = place + lastpic + 'Up.' + type;
		document["picholder"].src = image.src
		text.innerHTML=msg[lastpic]
	}
	else {
		start--
		image.src = place + start + 'Up.' + type;
		document["picholder"].src = image.src
		text.innerHTML=msg[start]
	}
}
function auto()
{
	if (lock == true)
	{
		lock = false;
		window.clearInterval(run);
	}
	else if (lock == false)
	{
		lock = true;
                next();
		run = setInterval("next()", delay);
	}
}
function openIt()
{
	myWindow=window.open("", "popup", "channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=580,width=788,top=0,left=0");
	myWindow.document.open();
	myWindow.document.write("<html><head><Title>" + msg[start] + "</Title><STYLE type='text/css'>BODY{SCROLLBAR-BASE-COLOR: #990000;SCROLLBAR-ARROW-COLOR: #CC9966;}</STYLE></head><body background='../../Images/ConcreteTexture.jpg'><center><img src='" + place + start + "L." + type + "' border='0'></center></body></html>");
	myWindow.document.close();
}
function preloadSS()
{
for(n=1;n<=lastpic;n++){
img[n]=new Image();
img[n].src=place + n + "Up." + type;
}
for(n=n;n<=loadpic;n++){
img[n]=new Image();
img[n].src=place + (parseInt(n) - parseInt(lastpic)) + "Down." + type;
}
}
