<!-- Begin
/*----------------------------------------------------------------------------------------
|
|        Random Main Picture Script by Josh Miller
|        written for City of Elmira Website
|        @ http://www.cityofelmira.net
|
-------------------------------------------------------------------------------------------*/ 

picture	=new Array();			//the file name of the picture
plink	=new Array();			//the location to send the user when the picture is clicked on
ratitle	=new Array();			//the text in the tooltip to display when hovering over the picture
caption	=new Array();			//the text that will appear beneath the image
target	=new Array();			//the target window of the link- use "_blank" for offsite links
pexpire	=new Array();			//the date to expire the image- use "" to never expire
x=0;

//picture[x]=	"main_satc.jpg";
//plink[x]=	"../benchbuilder/";
//ratitle[x]=	"Come join us in the exciting new project that is sweeping Downtown Elmira...";
//caption[x]=	"<i><b><font face='Times'><center>Downtown Elmira's Exciting Public Bench Art Project</center></font></b></i>";
//target[x]=	"";		//"_blank";
//pexpire[x]=	"";
//x++;

//picture[x]=	"main_kroc.jpg";
//plink[x]=	"../pressroom/coe_2005_08_31_kroc.html";
//ratitle[x]=	"Find out what you can do to make the Kroc Community Center a reality.";
//caption[x]=	"";
//target[x]=	"";		//"_blank";
//pexpire[x]=	new Date("September 19, 2005");
//x++;

//picture[x]=	"main_southern_tier.jpg";
//plink[x]=	"#";
//ratitle[x]=	"A view from Jerusalem Hill, Baseball at Dunn Field, the Clock in Wisner Park, a concert at Brand Park";
//caption[x]=	"";
//target[x]=	"";		//"_blank";
//pexpire[x]=	"";
//x++;

picture[x]=	"main_mayorswelcome.jpg";
plink[x]=	"index/video-welcome.html";
ratitle[x]=	"View the Welcome from Mayor John Tonello";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;


picture[x]=	"main_enjoy.jpg";
plink[x]=	"index/video-enjoy.html";
ratitle[x]=	"The Chemung River is a great way to Enjoy Elmira!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_enjoy2.jpg";
plink[x]=	"index/video-enjoy.html";
ratitle[x]=	"Click here to see other ways to enjoy Elmira!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_enjoy3.jpg";
plink[x]=	"index/video-enjoy.html";
ratitle[x]=	"The Eldridge Park Carousel is a great place to spend a day in Elmira!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_enjoy4.jpg";
plink[x]=	"index/video-enjoy.html";
ratitle[x]=	"A Pioneers game is a great way to enjoy summer in Elmira!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_mayorswelcome.jpg";
plink[x]=	"index/video-welcome.html";
ratitle[x]=	"View the Welcome from Mayor John Tonello";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_learn.jpg";
plink[x]=	"index/video-learn.html";
ratitle[x]=	"Elmira is a great place to learn and earn a degree!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_learn2.jpg";
plink[x]=	"index/video-learn.html";
ratitle[x]=	"Elmira is a great place to learn and earn a degree!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_learn3.jpg";
plink[x]=	"index/video-learn.html";
ratitle[x]=	"Elmira is a great place to learn and earn a degree!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_learn4.jpg";
plink[x]=	"index/video-learn.html";
ratitle[x]=	"Elmira is a great place to learn and earn a degree!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_mayorswelcome.jpg";
plink[x]=	"index/video-welcome.html";
ratitle[x]=	"View the Welcome from Mayor John Tonello";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_live.jpg";
plink[x]=	"index/video-live.html";
ratitle[x]=	"Elmira is a great place to live!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_live2.jpg";
plink[x]=	"index/video-live.html";
ratitle[x]=	"Elmira is a great place to live!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_live3.jpg";
plink[x]=	"index/video-live.html";
ratitle[x]=	"Elmira is a great place to live!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_live4.jpg";
plink[x]=	"index/video-live.html";
ratitle[x]=	"Elmira is a great place to live!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_mayorswelcome.jpg";
plink[x]=	"index/video-welcome.html";
ratitle[x]=	"View the Welcome from Mayor John Tonello";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_work.jpg";
plink[x]=	"index/video-work.html";
ratitle[x]=	"Elmira is a great place to work!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_work2.jpg";
plink[x]=	"index/video-work.html";
ratitle[x]=	"Open a business in Downtown Elmira!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_work3.jpg";
plink[x]=	"index/video-work.html";
ratitle[x]=	"Begin a career in Elmira today!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_work4.jpg";
plink[x]=	"index/video-work.html";
ratitle[x]=	"Elmira is a great place to work!";
caption[x]=	"";
target[x]=	"_video";		//"_blank";
pexpire[x]=	"";
x++;


picture[x]=	"main_wisner_market.jpg";
plink[x]=	"../about/attractions_annual.html";
ratitle[x]=	"Join us in Downtown Elmira every Thursday  from 10am to 2pm for Wisner Market.";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	new Date("September 27, 2007");
x++;

//picture[x]=	"main_historical.jpg";
//plink[x]=	"../history/index.html";
//ratitle[x]=	"The new sign at the entrance to the city off Exit 56 showcases Elmira's most historical residents.";
//caption[x]=	"";
//target[x]=	"";		//"_blank";
//pexpire[x]=	"";
//x++;



//picture[x]=	"main_downtown.jpg";
//plink[x]=	"../offices/projects.html";
//ratitle[x]=	"Projects that are currently underway like the South Main Street Urban Renewal and a CCC Branch Campus aim to strengthen the heart and soul of Elmira, the downtown district.";
//caption[x]=	"";
//target[x]=	"";		//"_blank";
//pexpire[x]=	"";
//x++;

/*
picture[x]=	"";
ratitle[x]=	"";
plink[x]=	"#";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"";
plink[x]=	"#";
ratitle[x]=	"";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"";
plink[x]=	"#";
ratitle[x]=	"";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	"";
x++;
*/


function printMainPic(){
	var a=document.location.toString();		
	x=a.length;							
	y=a.lastIndexOf("html");				
	y=y+5;	
	var image=a.substring(y,x);
		if( image!="" && y!="4"){
			printImage(image);
		}
		else{
			image=[Math.round(Math.random()*(picture.length-1))]
			today=new Date();
			if(pexpire[image]==""){
				printImage(image);
			}
			else{
				if(pexpire[image]-today >= -86400000){
					printImage(image);
				}
				else{
					printImage(0);
				}				
			}
		}
}

function printImage(image){
	document.write("	<table border='0' cellpadding='0' cellspacing='0' width='384'>");
	if (target[image]==""){
		document.write("	<tr><td align='center' valign='top'><a href='../"+plink[image]+"'>");
	}
	else{
		document.write("	<tr><td align='center'><a href='../"+plink[image]+"' target='"+target[image]+"'>");
	}
	document.write("	<img src='../index/pics/"+picture[image]+"' border='0' alt='"+ratitle[image]+"'></a></td></tr>");
	if (caption[image]!=""){
		document.write("	<tr><td align='left'>"+caption[image]+"</td></tr>");
	}
	document.write("</table>");
}


