galleryPhotos = new Array();
//photobaseurl="http://emedia105.chron.com";
var titletemplate="Gallery";
var decktemplate = " ";
var setSpeedHeretemplate=2000;
var timingtemplate=false;
var whichtemplate=1;
var preactivendx=0;
var totaltemplate=galleryPhotos.length-1;
var startphotondx=1; //next link block start point
//var lkblocklen=5;
var timerstartndx=1; //for play/stop nav
//var lkblockcurrentlen=0;
function PhotoTemplate(imgaddress, imgtitle, imgcaption,imgbyline,imgcredit){
this.iurl = imgaddress;
this.ititle = imgtitle;
this.icaption = imgcaption;
this.ibyline = '' + imgbyline + '';
this.icredit = imgcredit;
}
function everytemplate(){
document.images.photoslidertemplate.src=galleryPhotos[whichtemplate].iurl;
document.getElementById("captiontemplate").innerHTML=galleryPhotos[whichtemplate].icaption;
var dele = (galleryPhotos[whichtemplate].ibyline && galleryPhotos[whichtemplate].icredit)?': ':'';
document.getElementById("credittemplate").innerHTML= galleryPhotos[whichtemplate].ibyline + dele + galleryPhotos[whichtemplate].icredit;
}
function backwardtemplate(){
if (whichtemplate>=0){ whichtemplate--;}
if (whichtemplate<1){whichtemplate=galleryPhotos.length-1;}
everytemplate();
}
function forwardtemplate(){
if (whichtemplate<=totaltemplate){whichtemplate++;}
if (whichtemplate>totaltemplate){whichtemplate=1;}
everytemplate();
}
function timertemplate(){
timingtemplate=true;
forwardtemplate();
slideshowtemplate=setTimeout("timertemplate()",setSpeedHeretemplate);
}
function babbletemplate(){
if(timingtemplate==false){
document.getElementById("arrow_square_img").src="/images/icn-stop.gif";
document.getElementById("ps_txt").innerHTML="STOP";
whichtemplate = timerstartndx; //start from last stop point or first photo
timertemplate();
}else{
document.getElementById("arrow_square_img").src="/images/icn-next.gif";
document.getElementById("ps_txt").innerHTML="PLAY";
timerstartndx = whichtemplate;
clearTimeout(slideshowtemplate);
timingtemplate=false
}
}