window.onload = initLinks;

var myPhoto = new Array(
"photo/form.jpg",
"photo/marius.jpg",
"photo/jess.jpg",
"photo/damask.jpg",
"photo/reg1.jpg",
"photo/reg2.jpg",
"photo/reg3.jpg",
"photo/wash.jpg",
"photo/gris.jpg",
"photo/kiln.jpg",
"photo/tumbler.jpg",
"photo/francisco.jpg",
"photo/sadler.jpg");


var myText = new Array(
"Architerra was begun in 1990 as an architectural restoration workshop. Here we see an early sample created specifically for the historic Southwestern Bell Building in San Antonio.",
"In 1997, we turned to Marius Pana to sculp our moulds. Trained in Romania to do plaster restoration, Marius continues to lend his unequalled talents to this day.",
"The model for our Jessinian Crown sculpted in plasticene and wood.",
"A urethane master is cast from the model and is used to create the individual plaster moulds in which each piece of tile is hand-pressed. This is no. 5 of 12 required for our Pearl Damask.",
"Step one of creating a Romanesque Crown. Our signature handpress technique allows for the creation of the fissures seen in much of our line.",
"Next, the clay is allowed to sit for several minutes. During this time, a portion of the moisture in the clay is absorbed by the plaster, causing it to shrink prior to release.",
"The final product will be carefully shelved to dry overnight in preparation for color washing.",
"Once dry, the pieces are taken outside for the washing process. Each tile is carefully covered with a coat of wash and allowed to dry.",
"In the case of mulitcolored orders, each tile is meticulously painted by a talented and patient team of artisans. Here, Griselda puts the finishing touches on a piece of Damask, using the same earth oxide washes found in our basecoat.",
"Once the pieces are dried, they are carefully stacked in our programmable kilns. Our single-fire process takes three days.",
"After the pieces have cooled, they are loaded into our tumblers along with water and media and tumbled for up to an hour.",
"Each piece is checked for proper weathering, then unloaded and washed off prior to drying. Francisco has been assuring the quality finish of our tile for eight years.",
"Finally, each piece is inspected for quality before being carefully packaged for shipment.");

var thisPhoto = 0;

function initLinks() {
	document.getElementById("previous").onclick = processPrevious;
	document.getElementById("next").onclick = processNext;
}


function processPrevious() {
	changeOpac(0)
	if (thisPhoto == 0) {
		thisPhoto = myPhoto.length;
	}
	thisPhoto--;
	document.getElementById("myPicture").src = myPhoto[thisPhoto];
	if (document.getElementById("myPicture").src.indexOf("v") != -1)
	{
		document.getElementById("myPicture").style.marginTop = 10 + "px";
	}
	else {
		document.getElementById("myPicture").style.marginTop = 50 + "px";
	}
	document.getElementById('pictureText').innerHTML = myText[thisPhoto];
	opacityShow()
	return false;
}

function processNext() {
	changeOpac(0)
	thisPhoto++;
	if (thisPhoto == myPhoto.length) {
		thisPhoto = 0;
	}
	document.getElementById("myPicture").src = myPhoto[thisPhoto];
	if (document.getElementById("myPicture").src.indexOf("v") != -1)
	{
		document.getElementById("myPicture").style.marginTop = 10 + "px";
	}
	else {
		document.getElementById("myPicture").style.marginTop = 50 + "px";
	}
	document.getElementById('pictureText').innerHTML = myText[thisPhoto];
	opacityShow()
	return false;
}


function opacityFade() {
	timer = 100;
	for(i = 100; i >= 0; i--) {
		setTimeout("changeOpac(" + i + ")",(timer));
		timer=timer+2;
	}
}
function opacityShow() {
	timer = 400;
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ")",(timer));
	timer=timer+2;
	}
}

function changeOpac(opacity) {
	var object = document.getElementById('myPicture').style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

