﻿var timetmp = new Date();
var timetmpa = timetmp.getTime();
var timetmpb = timetmp.getTime();
var imgpath1 = "1/";
var imgpath2 = "2/";
var imgpath3 = "3/";
var loadnext = 5000;
//var whichimg1 = 0;//moved these to index.html
//var whichimg2 = 0;
//var whichimg3 = 0;
var	picsize = 150
var wbtmp = 0;
function imgtime(){
	var timetmp2 = new Date();
	timetmpb = timetmp2.getTime();
	var diff = (timetmpb - timetmpa)/100;
	if (confirm("Plese read this.\nIt took " + Math.round(diff)/10 + " seconds to load this image.  If the other images load at about the same speed, it will take between " + Math.round(diff/4)/10 + " and " + Math.round(diff*1.5)/10+ " seconds to load each of the HIGH RES slide show images.  It will take between " + Math.round(diff/20)/10 + " and " + Math.round(diff/6)/10 + " seconds to load each of the LOW RES slide show images.\nPress OK to view the HIGH RES slide show, or Cancel to view the LOW RES slide show")){
		imgpath = "";
		loadimage();
	}else{
		imgpath = "smaller/";
		loadimage();
	}
}
function doImages(){
    loadimage2();
    loadimage1();
    setTimeout("loadimage3()",500);
//    document.getElementById("wb_Html2").innerHTML='<iframe src="http://www.google.com/calendar/embed?title=Upcoming%20Events&amp;showNav=0&amp;showDate=0&amp;showPrint=0&amp;showTabs=0&amp;showCalendars=0&amp;showTz=0&amp;mode=AGENDA&amp;height=400&amp;wkst=1&amp;hl=en&amp;bgcolor=%23FFFFFF&amp;src=website%40webbervilleumc.org&amp;color=%23A32929&amp;ctz=America%2FNew_York" style=" border:solid 1px #777 " width="300" height="400" frameborder="0" scrolling="no"></iframe</div>'
}
function showCal(){
    document.getElementById("wb_Html2").innerHTML='<iframe src="http://www.google.com/calendar/embed?title=Upcoming%20Events&amp;showNav=0&amp;showDate=0&amp;showPrint=0&amp;showTabs=0&amp;showCalendars=0&amp;showTz=0&amp;mode=AGENDA&amp;height=400&amp;wkst=1&amp;hl=en&amp;bgcolor=%23FFFFFF&amp;src=website%40webbervilleumc.org&amp;color=%23A32929&amp;ctz=America%2FNew_York" style=" border:solid 1px #777 " width="300" height="400" frameborder="0" scrolling="no"></iframe</div>'
}
function reset(which){
//    alert(which);
    if (which==1){
        top.whichimg1 = 0
        loadimage1()
        }
    if (which==2){
        top.whichimg2 = 0
        loadimage2()
        }
    if (which==3){
        top.whichimg3 = 0
        loadimage3()
        }
}
function loadimage1(){
		top.whichimg1 = top.whichimg1 + 1;
		//document.getElementById("Images1").innerHTML ='<img src="'+imgpath1+whichimg1+'.JPG"  title = "'+imgpath1+whichimg1+'.jpg"  height = "'+picsize+'"onload="if(this.width > 320) this.width=320;top.wbtmp = setTimeout(top.loadimage1,'+ loadnext+');" onerror="top.reset(1);" align="right">';
		document.getElementById("Images1").innerHTML ='<img src="'+imgpath1+top.whichimg1+'.JPG" height = "'+picsize+'"  title = "'+imgpath1+top.whichimg1+'.jpg" onload="top.wbtmp = setTimeout(loadimage1,'+ loadnext+');" onerror="reset(1);" valign="center" align="right">';
}
function loadimage2(){
		top.whichimg2 = top.whichimg2 + 1;
		document.getElementById("Images2").innerHTML ='<img src="032.JPG" alt="Welcome" title="Welcome" height = "'+picsize+'" align="center">';
}
function loadimage3(){
		top.whichimg3 = top.whichimg3 + 1;
//		document.getElementById("Images3").innerHTML ='<img src="'+imgpath3+whichimg3+'.JPG"   title = "'+imgpath3+whichimg3+'.jpg"   height = "'+picsize+'"onload="if(this.width > 320) this.width=320;top.wbtmp = setTimeout(top.loadimage3,'+ loadnext+');" onerror=";top.reset(3);" align="left">';
		document.getElementById("Images3").innerHTML ='<img src="'+imgpath3+top.whichimg3+'.JPG"  height = "'+picsize+'"  title = "'+imgpath3+top.whichimg3+'.jpg"   onload="top.wbtmp = setTimeout(loadimage3,'+ loadnext+');" onerror="reset(3);"  valign="center" align="left">';
}

