// JavaScript Document
var currentpos=0;
var currentthumbpos=0;
var moveamount=106;
var thumbnailnum;
var maxthumbvisible = 1; //Define how many thumbnails will be visible at one time in the thumbbox--for now this should only be 3 since it's actually the css that controls the size of the viewable box
var current_imgid=0;
var moving = false;
var finishedsizing=0;
var preloadimg="no"//Preload images ("yes" or "no"):
var myloadedimage = new Array();
myloadedimage[0]=1;
var imggallery=new Array()
var firstimagestart=1;
var nextorprev=0;
var fadeout=1;
var autodelay=7; //For time of pictures to appear. Set in seconds. (e.g.: 5 == 5 Seconds)
var auto=true; //set to true or false, if true it will run this as a slideshow
var total=tempgallery.length-1;
function loadinfo(){
if(fadeout==0){
var fademe = new Fx.Style('iptc_info','opacity', {duration:transspeed });
fademe.set(0);
fadeout=1;
}else{
var fademe = new Fx.Style('iptc_info','opacity', {duration:transspeed });
fademe.set(.75,0);
fadeout=0;
}
}
function areweready(loadarea, imgindex, img_id){
if ( finishedsizing++ ) {
modifyimage(loadarea, imgindex, img_id);
finishedsizing = 0;
}
}
function modifyimage(loadarea, imgindex, img_id ){
function loadimagenow(){
//alert("Load Image Now Called");
if (document.getElementById) {
if(current_imgid!=img_id){
var imgobj=document.getElementById(loadarea);
var iptch=document.getElementById('iptc_info');
var photonum=document.getElementById('photocount')
var phototitle=document.getElementById('imgtitle')
imgobj.innerHTML=returnimgcode(imggallery[imgindex]);
iptch.innerHTML=returniptc(imggallery[imgindex]);
photonum.innerHTML=(Number(imgindex)+1)+" of "+imggallery.length+" Photos";
phototitle.innerHTML=""+tempgallery[img_id][4]+" "+tempgallery[img_id][7];
initImage(loadarea);
current_imgid=img_id;
myloadedimage[imgindex]=1;
}
}
return false
}
if(myloadedimage[imgindex]==null){
//var mynewimage=new Image()
//alert(imggallery[imgindex][0]);
//var newHTML = "";
//$('imgloader').setHTML(newHTML);
new Asset.image(imggallery[imgindex][0], {onload: loadimagenow});
/*mynewimage.src=imggallery[imgindex][0]
mynewimage.onload=function(){alert("myloadedimage");
loadimagenow();
}*/
}else{
//alert("calling Load Image Now Called");
loadimagenow();
}
}
function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml=''
imghtml+='
'
if (theimg[1]!="")
imghtml+=''
return imghtml
}
function returniptc(theimg){
var iptchtml = ''+
'