function mouseOverNav(changeCell)
{
	
	cell = document.getElementById(changeCell)
	
	
	cell.style.background='darkorange';
	
	cell.style.color='white';
	cell.style.fontWeight='bold';
	cell.style.fontFamily='sans-serif';
	cell.style.fontSize='11px';
	cell.style.paddingLeft='24px';
	cell.style.borderBottom='1px solid rgb(150,155,150)';
	//cell.style.borderTop='1px solid darkorange';
	cell.style.borderRight='1px solid rgb(150,155,150)';
	cell.style.borderLeft='1px solid rgb(150,155,150)'; 
	

	
}

function mouseOutNav(changeCell)
{

	cell = document.getElementById(changeCell)
	
	
	cell.style.background='rgb(245,245,245)';
	cell.style.color='rgb(0,44,0)';
	cell.style.fontWeight='normal';
	cell.style.fontFamily='sans-serif';
	cell.style.fontSize='11px';
	cell.style.paddingLeft='24px';
	cell.style.borderBottom='1px solid rgb(150,155,150)';
	//cell.style.borderTop='1px solid white';
	cell.style.borderRight='1px solid rgb(150,155,150)';
	cell.style.borderLeft='1px solid rgb(150,155,150)'; 
	
	
}

function gotoLink(cell)
{
	
	
	switch(cell)
	{
		case 'nav1':
			mouseOutNav(cell);
			window.location="index.htm";
			break;
			
		case 'nav2':
			mouseOutNav(cell);
			window.location="history.htm";
			break;
			
		
		case 'nav3':
			mouseOutNav(cell);
			window.location="contactUs.htm";
			break;
		
		case 'nav4':
			mouseOutNav(cell);
			window.location="design.htm";
			break;
		case 'nav5':
			mouseOutNav(cell);
			window.location="pre.htm";
			break;
		case 'nav6':
			mouseOutNav(cell);
			window.location="construction.htm";
			break;
		case 'nav6.5':
			mouseOutNav(cell);
			window.location="development.htm";
			break;	
		case 'nav7':
			mouseOutNav(cell);
			window.location="homePortfolio.htm";
			break;
			
		case 'nav8':
			mouseOutNav(cell);
			window.location="renoPortfolio.htm";
			break;
		
		case 'nav9':
			mouseOutNav(cell);
			window.location="boston.htm";
			break;
		
		case 'nav10':
			mouseOutNav(cell);
			window.location="NewYork.htm";
			break;
		case 'nav11':
			mouseOutNav(cell);
			window.location="CapeCod.htm";
			break;
		
		case 'featured':
			window.location="60west.htm";
			break;
			
		case 'custom1':
			window.location="custom1.htm";
			break;
			
		case 'custom2':
			window.location="custom2.htm";
			break;
		case 'custom3':
			window.location="custom3.htm";
			break;
			
		case 'custom4':
			window.location="custom4.htm";
			break;
		case 'custom5':
			window.location="custom5.htm";
			break;
			
		case 'custom6':
			window.location="custom6.htm";
			break;
			
		case 'custom7':
			window.location="custom7.htm";
			break;
			
		case 'custom8':
			window.location="custom8.htm";
			break;
		
		case 'custom9':
			window.location="custom9.htm";
			break;

			
		case 'reno1':
			window.location="reno1.htm";
			break;
	
			
	}

}

function changeImage()
{

	
	if (pauseImage == false)
	{

		var newImage = 'images/home/home' + imageCount + '.jpg';
		document.getElementById('homeImage').src = newImage;
		
		
		switch(imageCount)
		{
			case 1:
				imageCount = 2;
				t1=setTimeout("changeImage()",2000);
				break;
				
			case 11:
				imageCount = 12;
				t1=setTimeout("changeImage()",2000);
				break;
		
			case 21:
				imageCount = 22;
				t1=setTimeout("changeImage()",2000);
				break;
		
			case 8:
				imageCount = 11;
				t1=setTimeout("changeImage()",4000);
				break;
			
			case 18:
				imageCount = 21;
				t1=setTimeout("changeImage()",4000);
				break;
			
			case 28:
				imageCount = 1;
				t1=setTimeout("changeImage()",4000);
				break;
			
			default:
				imageCount = imageCount + 1;
				t1=setTimeout("changeImage()",300);
				break;
		
		}
		

	}
	
}



var t1;
var imageCount;
var pauseImage;

function toggleButton()
{
	if (pauseImage==true)
	{
	
		homePlay();
	}
	else
	{
		
		homePause();
	}
}

function homePause()
{
	pauseImage=true;
	
	var newImage = 'images/play22.png';
	document.getElementById('btnPausePlay').src = newImage;
	
}



function homePlay()
{
	
	pauseImage=false;
	document.getElementById('btnPausePlay').src = 'images/pause22.png';
	changeImage();
		
}



function homeNext()
{
	var pauseFlagHolder = pauseImage;
	
	pauseImage=false;
	switch(imageCount)
	{
		
		case 8:
			imageCount = 11;
			break;
		
		case 18:
			imageCount = 21;
			break;
		
		case 28:
			imageCount = 1;
			break;
		
		default:
			imageCount = imageCount + 1;
			break;
	}

	
	
	var newImage = 'images/home/home' + imageCount + '.jpg';

	document.getElementById('homeImage').src = newImage;
	pauseImage = pauseFlagHolder;
}



function homeBack()
{
	var pauseFlagHolder = pauseImage;
	
	pauseImage=false;
	
	switch(imageCount)
	{
		
		case 1:
			imageCount = 28;
			break;
		
		case 11:
			imageCount = 8;
			break;
		
		case 21:
			imageCount = 18;
			break;
		
		default:
			imageCount = imageCount - 1;
			break;
	}

	var newImage = 'images/home/home' + imageCount + '.jpg';


	document.getElementById('homeImage').src = newImage;

	
	pauseImage = pauseFlagHolder;
}


function changePortfolioPicture(newImageNumber,imageDir)
{
	var newMainImage = imageDir + newImageNumber + '.jpg';
	var newThumbImage = 'thumb' + newImageNumber;
	
	clearCurrentPortfolio();
	imageCount = newImageNumber;
	
	document.getElementById('homeImage').src = newMainImage;
	document.getElementById(newThumbImage).style.border = '2px solid rgb(255,75,0)';
}


function showBeforeAfterPicture(imageDir)
{
	var newMainImage = imageDir + imageCount + '.jpg';
	document.getElementById('homeImage').src = newMainImage;
}



function portfolioPictureForward(lower, upper, imageDir)
{
	clearCurrentPortfolio();
	
	if (imageCount == upper)
	{
		imageCount = lower;
	}
	else
	{
	
		imageCount = imageCount + 1;
	}
	
	
	changePortfolioPicture(imageCount, imageDir);

}



function clearCurrentPortfolio()
{

	var thumbImage = 'thumb' + imageCount;
	document.getElementById(thumbImage).style.border = '2px solid black';
}


function portfolioPictureBack(lower, upper, imageDir)
{
	clearCurrentPortfolio();
	
	if (imageCount == lower)
	{
		imageCount = upper;
	}
	else
	{
	
		imageCount = imageCount - 1;
	}
	
	
	changePortfolioPicture(imageCount, imageDir);

}



