// Controls the Design Gallery Viewer page(s)
// Holds all the strings needed for swapping. No images are stored in memory. 
var UseGallery;
var galleryPath;
var gCurrIndex = 1;
var gArray = new Array();
// Start at gArray[1] for consistancy, gArray[0] as placeholder
// Image Path | Image Title | Image SubText A | Image SubText B

if (UseGallery == "carpet") {
	var galleryPath="images/gallery/carpet/";
	gArray[0] = "Image Path|Image Title|Image SubText A|Image SubText B";
	gArray[1] = "Shaw_1.jpg|Shaw|Total Eclipse|";
	gArray[2] = "Shaw_2.jpg|Shaw|Outwest|";
	gArray[3] = "Mohawk_1.jpg|Mohawk|Plush Garden|Sand";
	gArray[4] = "Mohawk_2.jpg|Mohawk|Oregon Trail|Classic Silk";
	gArray[5] = "Mohawk_3.jpg|Mohawk|Feather River|Camelot Beige";
	
} else if (UseGallery == "ceramictile"){
	var galleryPath="images/gallery/tile/";
	gArray[0] = "Image Path|Image Title|Image SubText A|Image SubText B";
	gArray[1] = "Shaw_1.jpg|Shaw|Tremont|";
	gArray[2] = "Shaw_2.jpg|Shaw|Classico|";
	gArray[3] = "Shaw_3.jpg|Shaw|Caprice|";
	gArray[4] = "Mohawk_1.jpg|Mohawk|Serengeti|Slate";
	gArray[5] = "Mohawk_2.jpg|Mohawk|Ricotta|";
	
} else if (UseGallery == "hardwood"){
	var galleryPath="images/gallery/hardwood/";
	gArray[0] = "Image Path|Image Title|Image SubText A|Image SubText B";
	gArray[1] = "Shaw_1.jpg|Shaw|Charisma|Sable";
	gArray[2] = "Mullican_1.jpg|Mullican|Oak|Bordeux";
	gArray[3] = "Mullican_2.jpg|Mullican|Oak|Coffee";
	gArray[4] = "Mullican_3.jpg|Mullican|Oak|Gunstock";
	gArray[5] = "Mullican_4.jpg|Mullican|Walnut|Natural";
	gArray[6] = "Mullican_5.jpg|Mullican|Red Oak|Natural";
	gArray[7] = "Mullican_6.jpg|Mullican|Maple|Natural";
	gArray[8] = "Mohawk_1.jpg|Mohawk|Santa Barbara Plank|Dark Auburn Maple";

} else if (UseGallery == "vinylflooring"){
	var galleryPath="images/gallery/vinyl/";
	gArray[0] = "Image Path|Image Title|Image SubText A|Image SubText B";
	gArray[1] = "Ultima_1.jpg|Congoleum|Ultima|Random Paver";
	gArray[2] = "Ultima_2.jpg|Congoleum|Ultima|Brookside";
	gArray[3] = "Prelude_1.jpg|Congoleum|Prelude|RS";
	gArray[4] = "Prelude_2.jpg|Congoleum|Prelude|RS";
	gArray[5] = "PaceSetter_1.jpg|Congoleum|PaceSetter|Symphony";
	gArray[6] = "PaceSetter_2.jpg|Congoleum|PaceSetter|Renown";
	gArray[7] = "PaceSetter_3.jpg|Congoleum|PaceSetter|Indiana Maple";
	gArray[8] = "PaceSetter_4.jpg|Congoleum|PaceSetter|Celebration";
	gArray[9] = "Concepts_1.jpg|Congoleum|Concepts|RS";


} else if (UseGallery == "modelhome"){
	var galleryPath="images/gallery/model/";
	gArray[0] = "Image Path|Image Title|Image SubText A|Image SubText B";
	gArray[1] = "2003_MasterBedroom.jpg|Parade of Homes 2003|Master Bedroom|";
	
	gArray[2] = "2004_BoysBedroom.jpg|Parade of Homes 2004|Boy's Bedroom|";
	gArray[3] = "2004_DiningRoom.jpg|Parade of Homes 2004|Dining Room|";
	gArray[4] = "2004_GirlsBath.jpg|Parade of Homes 2004|Girls Bath|";
	gArray[5] = "2004_GirlsBedroom.jpg|Parade of Homes 2004|Girls Bedroom|";
	gArray[6] = "2004_KitchenBreakfast.jpg|Parade of Homes 2004|Kitchen and Breakfast|";
	gArray[7] = "2004_LivingRoom.jpg|Parade of Homes 2004|Living Room|";
	gArray[8] = "2004_LivingRoom2.jpg|Parade of Homes 2004|Living Room|";
	gArray[9] = "2004_LivingRoom3.jpg|Parade of Homes 2004|Living Room|";
	gArray[10] = "2004_MasterBedroom.jpg|Parade of Homes 2004|Master Bedroom|";
	
	gArray[11] = "2005_BonusRoom.jpg|Parade of Homes 2005|Bonus Room|";
	gArray[12] = "2005_BoysBedroom.jpg|Parade of Homes 2005|Boy's Bedroom|";
	gArray[13] = "2005_DiningRoom.jpg|Parade of Homes 2005|Dining Room|";
	gArray[14] = "2005_GirlsBedroom.jpg|Parade of Homes 2005|Girl's Bedroom|";
	gArray[15] = "2005_Kitchen.jpg|Parade of Homes 2005|Kitchen|";		
	gArray[16] = "2005_MasterBath.jpg|Parade of Homes 2005|Master Bath|";
	gArray[17] = "2005_MasterBedroom.jpg|Parade of Homes 2005|Master Bedroom|";		
	gArray[18] = "2005_Nursery.jpg|Parade of Homes 2005|Nursery|";
	
	gArray[19] = "RexThompsonSendler.jpg|Rex Thompson and Sendler Contruction||";		
	gArray[20] = "Sendler_MasterBedroom.jpg|Sendler Contruction Centennial Place|Master Bedroom|";
	gArray[21] = "Sendler_MasterBath.jpg|Sendler Contruction|Master Bath|";	
		
	gArray[22] = "Wellstone_Kitchen.jpg|Wellstone|Kitchen|";
	gArray[23] = "Wellstone_LivingRoom.jpg|Wellstone|LivingRoom|";		
	gArray[24] = "Wellstone3.jpg|Wellstone||";
	gArray[25] = "Wellstone4.jpg|Wellstone||";		
}



function galleryImage(inIndex) {
	gCurrIndex = inIndex
	imgInfoArray=gArray[inIndex].split("|");
	document.getElementById('gImage').src = galleryPath + imgInfoArray[0];
	document.getElementById('gImageTitle').innerHTML = imgInfoArray[1];
	document.getElementById('gImageSubTextA').innerHTML = imgInfoArray[2];
	document.getElementById('gImageSubTextB').innerHTML = imgInfoArray[3];
	
	document.getElementById('gGalleryCurrentCount').innerHTML = inIndex + " of " + (gArray.length-1);

}

function galleryInc(inDirection) {
	switch (inDirection)
	{
		case 'PREV': { if (gCurrIndex > 1) galleryImage(gCurrIndex - 1); break }
		case 'NEXT': { if (gCurrIndex < (gArray.length - 1)) galleryImage(gCurrIndex + 1); break }
		default: { break }
	}
}