function stopError() {return true;}
window.onerror=stopError;
/* CALL TO CORRECT DIRECTORY */
var imgdir;
var layoutdir;
if(window.homepage)
{imgdir="images/";
layoutdir="https://www.fnbhutchonline2.com/layout/"
}
else if(window.absolutepage)
{imgdir="http://www.fnbhutchonline2.com/images/"
layoutdir="https://www.fnbhutchonline2.com/layout/"
}
else if(window.securepage)
{imgdir="https://www.fnbhutchonline2.com/images/"
layoutdir="https://www.fnbhutchonline2.com/layout/"
}
else
{imgdir="../images/";
layoutdir="../layout/"
}
//Start Photo Gallery
function gallery(){

	//page variables
	var page_bgcolor="#2859B7";
	var border_color="#cc0000";
	//content creation
	var content=new Array();
	var index=0;
	content[index++]='<html>';
	content[index++]='<head>';
	content[index++]='<title>Photo Gallery</title>';
	content[index++]='<link href="' + layoutdir + 'styles.css" rel="stylesheet" type="text/css" />';
	content[index++]='<scr'+'ipt type="text/javascript" src="' + layoutdir + '_slideShow.js">';
	content[index++]='  </scr'+'ipt>';
	content[index++]='</head>';
	content[index++]='<body bgcolor="#FFFFFF">';
	content[index++]='<table bgcolor="' + border_color + '" align="center" width="300" cellspacing="2" cellpadding="0" border="0">';
	content[index++]='	<tr>';
	content[index++]='	    <td>';
	content[index++]='		<table width="100%" border="0" cellspacing="5" cellpadding="2" align="center" background="'+imgdir+'leavingsite-bg.jpg">';
	content[index++]='			<tr>';
	content[index++]='	    		<td colspan="3">';
	content[index++]='				 <font face="Arial,Verdana,Helvetica" style="font-size:16pt" color="#FFFFFF">';
    content[index++]='                               <div align="center">17th Street Branch</div>';
	content[index++]='				</td>';
	content[index++]='			</tr>';
	content[index++]='<tr>';
	content[index++]='	<td align="center" colspan="3">';
	content[index++]='	<img src="' + imgdir + 'slideshow/1.jpg" width="224" height="224" border="0" alt="" name="slide">';
	content[index++]='	</td>';
	content[index++]='</tr>';
	content[index++]='<tr>';
	content[index++]='		<td align="left" class="gallerylink" width="50%" style="font-size:14pt">';
	content[index++]='			<a href="javascript:changeSlide(-2);" class="gallerylink">Previous</a>';
	content[index++]='		</td>';
	content[index++]='		<td align="right" class="gallerylink" width="50%" style="font-size:14pt">';
	content[index++]='			<a href="javascript:changeSlide(0);" class="gallerylink">Next</a>';
	content[index++]='		</td>';
	content[index++]='</tr>';
	content[index++]='<tr>';
	content[index++]='<td style="font-size:8pt;font-family:Arial,Verdana,Helvetica;color:#ffffff" align="center" id=galleryLink class=gallerylink width="100%" colspan="3">';
	content[index++]=firstLinks;
	content[index++]='</tr>';	
	content[index++]='		</table>';
	content[index++]='		</td>';
	content[index++]='	</tr>';
	content[index++]='</table>';
	content[index++]='<table width="100%" height="20%">';
	content[index++]='<tr valign="middle" height="100%">';
	content[index++]='<td style="font-size:10pt" id=descriptionBox class=descriptionText align="center" width="100%" colspan="3">';
	content[index++]='This sign was displayed in September 2003 at the site announcing the new branch opening.';	
	content[index++]='</td></tr>';	
	content[index++]='</table>';
	content[index++]=' ';
	content[index++]='</body>';
	content[index++]='</html>';
	//actual centering popup code
	var pWidth=((parseInt(screen.width) - 340) / 2); 
	var pHeight=((parseInt(screen.height) - 570) / 2);
	newwin=window.open("","newwin", "width=350,height=450,left="+pWidth+",top="+pHeight+", scrollbars=0");
 	newwin.document.open('text/html','replace');
	newwin.document.write(content.join(""));
	newwin.document.close();
	return;
}
//Slideshow Code
var imgTotal=36
var directory='https://www.fnbhutchonline2.com/images/slideshow/'
var imgType='.jpg'
//offsets array elements by 1
slideset=new Array();
	for (i=1; i<imgTotal+1; i++){
		slideset[i]=directory + i + imgType
		}
var numSlides=1
var newImg=slideset[numSlides]
var description=new Array();
var index=0;
description[index++]="This sign was displayed in September 2003 at the site announcing the new branch opening.";
description[index++]="The building before construction.  The architects plan on using the existing exterior circular element within the design of the interior.";
description[index++]="The building before construction.  The architects plan on using the existing exterior circular element within the design of the interior.";
description[index++]="A 3D model of the new design. Shown on the right are the drive-thru teller lanes.";
description[index++]="Another angle view of the architects' 3D model with the drive-thru teller lanes.";
description[index++]="Construction on the site began in October 2003 with the parking lot.";
description[index++]="The first step was to tear up the concrete  and level the lot for parking and drive-thru lanes.";
description[index++]="The first step was to tear up the concrete and level the lot for parking and drive-thru lanes.";
description[index++]="The first step was to tear up the concrete and level the lot for parking and drive-thru lanes.";
description[index++]="In February 2004, the construction began on the teller lanes.";
description[index++]="Concrete was poured for the eight pillars as the basis for the drive-up lanes";
description[index++]="Concrete was poured for the eight pillars as the basis for the drive-up lanes";
description[index++]="Eventually, the drive-up lane roof was added.";
description[index++]="Here are the drive-up lanes looking towards the building.";
description[index++]="The drive-up lanes from inside the building.";
description[index++]="Sheetrock was put up on the inside.  This view shows the east side of the branch.";
description[index++]="Sheetrock was put up on the inside.  This view shows the east side of the branch.";
description[index++]="The teller stations will be located on the right side of the building once you walk in the door.";
description[index++]="The existing skylights were left intact.  ";
description[index++]="Work rapidly progressed during the spring.";
description[index++]="The front entrance structure was installed.";
description[index++]="The brick ledge was formed around the commercial lane.";
description[index++]="Brick pavers for the front entrance were installed.";
description[index++]="The teller line cover began.";
description[index++]="The concrete was poured and bricks were laid.";
description[index++]="In April, the drive-throu tubes were installed.  The system is similar to the new tubes at the North Main branch.";
description[index++]="In April, the drive-throu tubes were installed.  The system is similar to the new tubes at the North Main branch.";
description[index++]="The first layer of asphalt was poured.";
description[index++]="There are a total of five drive-throu lanes: 1 commercial lane, 3 retail lanes and an ATM lane.";
description[index++]="There are a total of five drive-throu lanes: 1 commercial lane, 3 retail lanes and an ATM lane.";
description[index++]="Painting and trim work on the interior also started.";
description[index++]="Painting and trim work on the interior also started.";
description[index++]="Painting and trim work on the interior also started.";
description[index++]="Painting and trim work on the interior also started.";
description[index++]="The front atrium of the building was being designed.";
description[index++]="Preparation for the pyramid structures began.";
description[index++]="The 17th staff:  (pictured left to right) <br> Stacy (teller), Jamie (teller), Elizabeth (business development), Carol (branch manager)";
description[index++]="The 17th staff:  (pictured left to right) <br> Rose (teller), DeeDee (teller), Jennifer (assistant branch manager), Alycia (teller), Heather (teller)";

var links=new Array();
var index;
links[0]='<p align="center"><br>';
var firstLinks=links[0];
for(index=1; index<=imgTotal; index++)
{
	links[index]='  <a href="javascript:changeSlide('+index+');" class="gallerylink" id="pic'+index+'">'+index+'</a>&nbsp;&nbsp;&nbsp;&nbsp;';
	if(index<=10){firstLinks=firstLinks + links[index];}
}
links[index]='</p></font>';
firstLinks=firstLinks + links[index];

//used for all links
function changeSlide(whichWay)
{
	switch(whichWay)
	{
		case 0://next
			numSlides++;
			if (numSlides>=slideset.length){//resets length if at end
				numSlides=1;
			} 
		break;
		case -2://previous
			numSlides--;
			if (numSlides<=0){//resets length if at beginning
				numSlides=(slideset.length-1);
			}		
		break;
		default:
			numSlides=whichWay;
	}
	if (document.slide){//changes image
		document.slide.src= slideset[numSlides];}
	if (document.getElementById){//changes description
		document.getElementById("descriptionBox").innerHTML= description[numSlides-1];}

	changeLinks(numSlides);
	currentPic=numSlides;
	underlineNumber(numSlides);
}


function underlineNumber(picNum)  //Done by Seth 10/2/03
{
//	var picObjects=new Array(document.all.pic1,document.all.pic2,document.all.pic3,document.all.pic4,document.all.pic5,document.all.pic6,document.all.pic7,document.all.pic8,document.all.pic9,pic10,pic11,pic12,pic13,pic14,pic15,pic16,pic17,pic18,pic19,pic20,pic21,pic22,pic23,pic24,pic25,pic26,pic27,pic28,pic29,document.all.pic30,document.all.pic31,document.all.pic32,document.all.pic33,document.all.pic34,document.all.pic35,document.all.pic36,document.all.pic37,document.all.pic38,document.all.pic39,document.all.pic40);
//	alert(picNum);
	//alert(this.valueOf());
//	picNum.style.textDecoration='none';
//	alert(toSource(picObjects[picNum]));
//	alert(picObjects);
	if(picNum >=1 && picNum <=10)
	{
		document.all.pic1.style.textDecoration='none';
		document.all.pic2.style.textDecoration='none';
		document.all.pic3.style.textDecoration='none';
		document.all.pic4.style.textDecoration='none';
		document.all.pic5.style.textDecoration='none';
		document.all.pic6.style.textDecoration='none';
		document.all.pic7.style.textDecoration='none';
		document.all.pic8.style.textDecoration='none';
		document.all.pic9.style.textDecoration='none';
		document.all.pic10.style.textDecoration='none';
	}
	else if(picNum >=11 && picNum <=20)
	{
		document.all.pic11.style.textDecoration='none';
		document.all.pic12.style.textDecoration='none';
		document.all.pic13.style.textDecoration='none';
		document.all.pic14.style.textDecoration='none';
		document.all.pic15.style.textDecoration='none';
		document.all.pic16.style.textDecoration='none';
		document.all.pic17.style.textDecoration='none';
		document.all.pic18.style.textDecoration='none';
		document.all.pic19.style.textDecoration='none';
		document.all.pic20.style.textDecoration='none';
	}	
	else if(picNum >=21 && picNum <=30)
	{
		document.all.pic21.style.textDecoration='none';
		document.all.pic22.style.textDecoration='none';
		document.all.pic23.style.textDecoration='none';
		document.all.pic24.style.textDecoration='none';
		document.all.pic25.style.textDecoration='none';
		document.all.pic26.style.textDecoration='none';
		document.all.pic27.style.textDecoration='none';
		document.all.pic28.style.textDecoration='none';
		document.all.pic29.style.textDecoration='none';
		document.all.pic30.style.textDecoration='none';
	}
	else
	{
		document.all.pic31.style.textDecoration='none';
		document.all.pic32.style.textDecoration='none';
		document.all.pic33.style.textDecoration='none';
		document.all.pic34.style.textDecoration='none';
		document.all.pic35.style.textDecoration='none';
		document.all.pic36.style.textDecoration='none';
		//document.all.pic37.style.textDecoration='none';
		//document.all.pic38.style.textDecoration='none';
	}
	
	switch(picNum)
	{
		case 1:	
			document.all.pic1.style.textDecoration='underline';
		break;
		case 2:	
			document.all.pic2.style.textDecoration='underline';
		break;
		case 3:
			document.all.pic3.style.textDecoration='underline';
		break;
		case 4:	
			document.all.pic4.style.textDecoration='underline';
		break;
		case 5:
			document.all.pic5.style.textDecoration='underline';
		break;
		case 6:
			document.all.pic6.style.textDecoration='underline';
		break;
		case 7:
			document.all.pic7.style.textDecoration='underline';
		break;
		case 8:
			document.all.pic8.style.textDecoration='underline';
		break;
		case 9:
			document.all.pic9.style.textDecoration='underline';
		break;
		case 10:
			document.all.pic10.style.textDecoration='underline';
		break;
		case 11: 
			document.all.pic11.style.textDecoration='underline';
		break;
		case 12: 
			document.all.pic12.style.textDecoration='underline';
		break;
		case 13: 
			document.all.pic13.style.textDecoration='underline';
		break;
		case 14: 
			document.all.pic14.style.textDecoration='underline';
		break;
		case 15: 
			document.all.pic15.style.textDecoration='underline';
		break;
		case 16: 
			document.all.pic16.style.textDecoration='underline';
		break;
		case 17: 
			document.all.pic17.style.textDecoration='underline';
		break;
		case 18: 
			document.all.pic18.style.textDecoration='underline';
		break;
		case 19: 
			document.all.pic19.style.textDecoration='underline';
		break;
		case 20:	
			document.all.pic20.style.textDecoration='underline';
		break;
		case 21:	
			document.all.pic21.style.textDecoration='underline';
		break;
		case 22:	
			document.all.pic22.style.textDecoration='underline';
		break;
		case 23:	
			document.all.pic23.style.textDecoration='underline';
		break;
		case 24:	
			document.all.pic24.style.textDecoration='underline';
		break;
		case 25:	
			document.all.pic25.style.textDecoration='underline';
		break;
		case 26:	
			document.all.pic26.style.textDecoration='underline';
		break;
		case 27:	
			document.all.pic27.style.textDecoration='underline';
		break;
		case 28:	
			document.all.pic28.style.textDecoration='underline';
		break;
		case 29:	
			document.all.pic29.style.textDecoration='underline';
		break;
		case 30:	
			document.all.pic30.style.textDecoration='underline';
		break;
		case 31:	
			document.all.pic31.style.textDecoration='underline';
		break;
		case 32:	
			document.all.pic32.style.textDecoration='underline';
		break;
		case 33:	
			document.all.pic33.style.textDecoration='underline';
		break;
		case 34:	
			document.all.pic34.style.textDecoration='underline';
		break;
		case 35:	
			document.all.pic35.style.textDecoration='underline';
		break;
		case 36:	
			document.all.pic36.style.textDecoration='underline';
		break;
		case 37:	
			document.all.pic37.style.textDecoration='underline';
		break;
		case 38:	
			document.all.pic38.style.textDecoration='underline';
		break;
	}
	//alert(picObjects[picNum-1]);
//	document.all.picObjects[picNum-1].style.textDecoration='underline';
//	alert(document.all.picObjects[picNum-1].style.textDecoration);
}

//switches out the links at the bottom of the window if switching to the next or previous ten
function changeLinks(picNum)
{
	var linkNumbers;
	var switchLink=false;
	var start=0;
	var end = 10;
	if(picNum%10==0)//if picNum is end of set
	{	
		switchLink=true;
		start=picNum-9;
	}
	if(picNum%10==1)//if picNum is beginning of set
	{
		switchLink=true;
		start=picNum;
	}
	if(picNum==imgTotal || imgTotal-picNum<imgTotal%10)//accounts for last slideset
	{
		switchLink=true; 
		end=imgTotal%10; 
		start=imgTotal-end+1; 
	}
	if(switchLink)
	{
		linkNumbers=links[0];
		for(i=0; i<end;i++)
		{
			linkNumbers=linkNumbers + links[start+i];
		}
		linkNumbers=linkNumbers + links[imgTotal+1];
		document.getElementById("galleryLink").innerHTML=linkNumbers;	
	}
}

//End Slideshow Code
