// JavaScript Document

var globSection='installations';
var globImg='1';

function pageSelect(){
		
var splitter=document.title;
var pageName=splitter.split(" ");
var changeIt=pageName[5].toLowerCase();

if (changeIt=="home" || changeIt=="services" || changeIt=="photo" || changeIt=="contact"){
var theTag=document.getElementById(changeIt);
theTag.style.color='#512651';
}

if (changeIt=="photo"){
subSelect('installations');
}
}


function subSelect(section){

document.getElementById('installations').style.color='#b2a342';
document.getElementById('container').style.color='#b2a342';
document.getElementById('before').style.color='#b2a342';

if (section=="installations" || section=="container" || section=="before"){
var theSection=document.getElementById(section);
theSection.style.color='#512651';
}

initGallery(section);

}



function initGallery(section){

switch (section){

case "installations":
var count=12;
break;
	
case "container":
var count=11;
break;
	
case "before":
var count=8;
break;
}//end switch
//set main image to the first image in the series
document.getElementById('mainImg').src='images/gallery/'+section+'/'+section+'_1.jpg';
//generate the thumbs
var thePicNav=document.getElementById('picNav');
thePicNav.innerHTML='view images &gt; ';
for (i=1;i<=count;i++){
thePicNav.innerHTML+='<img src="images/inactiveDot.gif" id="'+i+'" onclick="switchPic(this.id);" /> ';
}//end for loop

//switch first square to solid
document.getElementById('1').src='images/activeDot.gif';
globSection=section;
globImg='1';
if (section=='before'){
	switchCaption();
} else {
	document.getElementById('caption').innerHTML='';
}
}

function switchPic(picNum){
	
	document.getElementById('mainImg').src='images/gallery/'+globSection+'/'+globSection+'_'+picNum+'.jpg';
	
	document.getElementById(globImg).src='images/inactiveDot.gif';
	document.getElementById(picNum).src='images/activeDot.gif';
	globImg=picNum;
	if (globSection=='before'){
	switchCaption();	
	}
}

function switchCaption(){
	switch (globImg){
		case "1":
			document.getElementById('caption').innerHTML='BEFORE - Lakeview Patio';
		break;
		case "2":
			document.getElementById('caption').innerHTML='AFTER - Lakeview Patio';
		break;
		case "3":
			document.getElementById('caption').innerHTML='BEFORE - Lakeview Yard';
		break;
		case "4":
			document.getElementById('caption').innerHTML='AFTER - Lakeview Yard';
		break;
		case "5":
			document.getElementById('caption').innerHTML='BEFORE - Lakeview Yard';
		break;
		case "6":
			document.getElementById('caption').innerHTML='AFTER - Lakeview Yard';
		break;
		case "7":
			document.getElementById('caption').innerHTML='BEFORE - Lakeview Yard';
		break;
		case "8":
			document.getElementById('caption').innerHTML='AFTER - Lakeview Yard';
		break;
		default:
			document.getElementById('caption').innerHTML='No Caption';
		break;
	}// ends switch statement
}

function goSplash(){
	
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="300" height="200" id="splash" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="mm/home.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#FFFFFF" />');


document.write('<embed src="mm/home.swf" quality="high" bgcolor="#FFFFFF" width="300" height="200" name="splash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');	

}