var y = 3500; //delay in ms
var z = .5; //transition duration

project = new Object();

//project.owner = new Array();
project.name = new Array();
project.location = new Array();
//project.value = new Array();
//project.architect = new Array();
project.description = new Array();

//project.owner[0] = "0 owner";
project.name[0] = "Southwest Basswood Self Storage";
project.location[0] = "Ft. Worth TX";
//project.value[0] = "0 value";
//project.architect[0] = "0 architect";
project.description[0] = "Multi Story Self Storage";

// Set the name attribute of the image tag to be the same as baseName
// In <body>, use onLoad="loadImages(baseName,howMany,imageOnly (or inlcude the project details))"
// Put images in the images/ directory as baseName_#.jpg where # is 0 indexed
function loadImages(bn,howMany,io) {
	x = 0;
	baseName = bn; // To make bn global
	imagesOnly = 0;
	imagesOnly = io;
	plpix = new Array(); // global
	for (i=0; i < howMany; i++) {
		plpix[i] = 'images/' + baseName + '_' + i + '.jpg';
	}

	pl = new Array(); //preloader, global
	for (i = 0; i < plpix.length; i++){
	   pl[i] = new Image();
	   pl[i].src = plpix[i];
	}
	slide();
}

function slide() {
	var hx = eval('document.images.' + baseName); //find img name attributes from page using img names from plpix array
	if (document.all){
		hx.style.filter="blendTrans(duration=" + z + ")";
		hx.filters.blendTrans.Apply();
	}

	hx.src = pl[x].src;
	
	if (!imagesOnly) {
		//theOwner.innerHTML = project.owner[x];
		theName.innerHTML = project.name[x];
		theLocation.innerHTML = project.location[x];
		//theValue.innerHTML = project.value[x];
		//theArchitect.innerHTML = project.architect[x];
		theDescription.innerHTML = project.description[x];
	}

	if (document.all){
		hx.filters.blendTrans.Play();
	}
	x += 1;
	if (x > (plpix.length-1)) {x=0;}
	setTimeout('slide()', y);
}

function loadImages2(bn,howMany) {
	x2 = 0;
	baseName2 = bn; // To make bn global
	plpix2 = new Array(); // global
	for (i=0; i < howMany; i++) {
		plpix2[i] = 'images/' + baseName2 + '_' + i + '.jpg';
	}

	pl2 = new Array(); //preloader, global
	for (i = 0; i < plpix2.length; i++){
	   pl2[i] = new Image();
	   pl2[i].src = plpix2[i];
	}
	slide2();
}

function slide2() {
	var hx = eval('document.images.' + baseName2); //find img name attributes from page using img names from plpix array
	if (document.all){
		hx.style.filter="blendTrans(duration=" + z + ")";
		hx.filters.blendTrans.Apply();
	}

	hx.src = pl2[x2].src;
	
	if (document.all){
		hx.filters.blendTrans.Play();
	}
	x2 += 1;
	if (x2 > (plpix2.length-1)) {x2=0;}
	setTimeout('slide2()', y);
}