<!-- 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
ptitle	=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_vision.jpg";
plink[x]=	"new.html";
ptitle[x]=	"Welcome to the Downtown District!";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_services.jpg";
plink[x]=	"about.html";
ptitle[x]=	"EDD provides businesses in the downtown district services to give them the keys to success";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	"";
x++;

picture[x]=	"main_market.jpg";
plink[x]=	"events.html";
ptitle[x]=	"Enjoy lunch in the park every Thursday from 10 to 2pm.";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	new Date("September 27, 2007");
x++;

picture[x]=	"main_market.jpg";
plink[x]=	"events.html";
ptitle[x]=	"Enjoy lunch in the park every Thursday from 10 to 2pm.";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	new Date("September 27, 2007");
x++;

picture[x]=	"main_market.jpg";
plink[x]=	"events.html";
ptitle[x]=	"Enjoy lunch in the park every Thursday from 10 to 2pm.";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	new Date("September 27, 2007");
x++;

picture[x]=	"main_market.jpg";
plink[x]=	"events.html";
ptitle[x]=	"Enjoy lunch in the park every Thursday from 10 to 2pm.";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	new Date("September 27, 2007");
x++;

picture[x]=	"main_market.jpg";
plink[x]=	"events.html";
ptitle[x]=	"Enjoy lunch in the park every Thursday from 10 to 2pm.";
caption[x]=	"";
target[x]=	"";		//"_blank";
pexpire[x]=	new Date("September 27, 2007");
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='424'>");
	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='../edd/pics/"+picture[image]+"' border='0' alt='"+ptitle[image]+"'></a></td></tr>");
	if (caption[image]!=""){
		document.write("	<tr><td align='left'>"+caption[image]+"</td></tr>");
	}
	document.write("</table>");
}


