<!-- Begin
/*----------------------------------------------------------------------------------------
|
|        Download Files Script by Josh Miller
|        written for City of Elmira Website
|        @ http://www.cityofelmira.net
|
-------------------------------------------------------------------------------------------*/ 
dlname=new Array();
dlfile=new Array();
dltype=new Array();
dlsize=new Array();

dlname[0]="Downtown Matters: 8/5/04"
dlfile[0]="../edd/docs/downtown_matters.pdf"
dltype[0]="pdf"
dlsize[0]="250"

dlname[1]="Downtown CleanUp Registration Form"
dlfile[1]="../edd/docs/downtown_cleanup.pdf"
dltype[1]="pdf"
dlsize[1]="57"

dlname[2]="Signage Program Guidelines"
dlfile[2]="../edd/docs/signage_guidelines.pdf"
dltype[2]="pdf"
dlsize[2]="1240"

dlname[3]="Signage Program Brochure"
dlfile[3]="../edd/docs/signage_brochure.pdf"
dltype[3]="pdf"
dlsize[3]="732"

dlname[4]="Signage Program Application"
dlfile[4]="../edd/docs/signage_application.pdf"
dltype[4]="pdf"
dlsize[4]="164"

dlname[5]="Facade Program Brochure"
dlfile[5]="../edd/docs/facade_brochure.pdf"
dltype[5]="pdf"
dlsize[5]="644"

dlname[6]="Facade Program Guidelines"
dlfile[6]="../edd/docs/facade_guidelines.pdf"
dltype[6]="pdf"
dlsize[6]="1050"

dlname[7]="Facade Program Application"
dlfile[7]="../edd/docs/facade_application.pdf"
dltype[7]="pdf"
dlsize[7]="207"

dlname[8]="Downtown Elmira: A Fresh Vision, A New Foundation -Edition 1"
dlfile[8]="../edd/docs/fresh_vision_edition1.pdf"
dltype[8]="pdf"
dlsize[8]="2000"




function AddNum(Time,Out,Sep) {			//function from http://www.numion.com/Calculators/Time.html
	if (Time < 10) Out += "0";
	Out += Time;
	Out += Sep;
	return(Out);
}

function SpeedCalc(x, speed){			//function adapted from http://www.numion.com/Calculators/Time.html
	with (Math) {
		TotalTime = ((1.5 * x * 8000) / speed);
		TotalHours = floor((TotalTime / 3600));
		TotalHoursMod = (TotalTime % 3600);
		TotalMin = floor(TotalHoursMod / 60);
		TotalMinMod = (TotalHoursMod % 60);
		TotalSec = floor(TotalMinMod);
		out = "";
		out = AddNum(TotalHours,"",":");
		out = AddNum(TotalMin,out,":");
		out = AddNum(TotalSec,out,"");
		if (out == "") out = "00:00:00";
		return out
	}
}

function download(x){
	req=""
	if (dltype[x]=="pdf")
		req="You need the Adobe Acrobat Reader to view this file."+'\n'+'\n'
	if (dltype[x]=="job")
		req="These descriptions may or may not be current.  Contact the Regional Civil Service Commission for current job descriptions."+'\n'+'\n'+"You need the Adobe Acrobat Reader to view this file."+'\n'+'\n'
	if (dltype[x]=="ppt")
		req="You need Microsoft PowerPoint or the PowerPoint Viewer to view this file."+'\n'+'\n'+"You can download the free PowerPoint 2003 Viewer at http://www.microsoft.com."+'\n'+'\n'

	msg=dlname[x].toUpperCase()+'\n'+'\n'+"File Size: "+dlsize[x]+"kb"+'\n'+"Approximate download times:"+'\n'+"  "+SpeedCalc(dlsize[x],56000)+" @ 56k dialup"+'\n'+"  "+SpeedCalc(dlsize[x],1024000)+" @ cable"+'\n'+'\n'+req+"Click OK to continue download."
	var flag=confirm(msg);
	if (flag){
//		window.open(dlfile[x],"", "toolbar=no,scrollbars=no,menubar=no" )
		window.open(dlfile[x],"")

	}
}



