var slideShowObj=null;var slideShowToggleObj=null;var slideShowTimer=null;var slideShowCurTime=0;var slideShowMaxTimePerPhoto=5;var continueSlideShow=false;if(document.images){blogOver='/img/button-blog.gif';blogOut='/img/button-blog1.gif';galleriesOver='/img/button-galleries.gif';galleriesOut='/img/button-galleries1.gif';photographyOver='/img/button-photography.gif';photographyOut='/img/button-photography1.gif';graphicOver='/img/button-graphic-design.gif';graphicOut='/img/button-graphic-design1.gif';servicesOver='/img/button-services.gif';servicesOut='/img/button-services1.gif';}
function myOn(aa,ba){document.getElementById("but_"+ba).setAttribute("src",eval(ba+'Out'));}
function myOut(ca,da){document.getElementById("but_"+da).setAttribute("src",eval(da+'Over'));}
function jsonp(ea,fa){if(fa)ea+="&"+fa;ea+="&"+new Date().getTime().toString();$(document).ready(function(){$.getJSON(ea+"&jsoncallback=?",function(ga){});});}
function nextPhoto(){if((curPhoto*1)+1<=maxPhoto){doPhoto(setUrl,(curPhoto*1)+1);}
else{stopSlideshow();}}
function prevPhoto(){if((curPhoto*1)-1>0){doPhoto(setUrl,(curPhoto*1)-1);}}
function toggleSlideShow(){if(!slideShowToggleObj){slideShowToggleObj=document.getElementById("slideToggle");}
if(slideShowTimer){stopSlideshow();slideShowToggleObj.innerHTML='<a href="javascript:void(0)" onClick="toggleSlideShow();">Start Slideshow</a>';}
else{startSlideshow();slideShowToggleObj.innerHTML='<a href="javascript:void(0)" onClick="toggleSlideShow();">Stop Slideshow</a>';}}
function startSlideshow(){slideShowTimer=setInterval("doSlideShow()",1000);remainingSlideShowTime();}
function stopSlideshow(){if(slideShowTimer){clearInterval(slideShowTimer);slideShowTimer=null;slideShowCurTime=0;if(!slideShowObj){slideShowObj=document.getElementById("photoCounter");}
slideShowObj.innerHTML="&nbsp;";}}
function doSlideShow(){slideShowCurTime+=1;if(slideShowCurTime>=slideShowMaxTimePerPhoto){slideShowCurTime=0;nextPhoto();}
else{remainingSlideShowTime();}}
function remainingSlideShowTime(){var ha=slideShowMaxTimePerPhoto-slideShowCurTime;if(!slideShowObj){slideShowObj=document.getElementById("photoCounter");}
if((curPhoto*1)+1<=maxPhoto){slideShowObj.innerHTML="next in "+ha+" secs...";}}
function doPhoto(ia,id){var ja=$('#photoObj');ja.attr("src","/img/blank.gif");var ka=ja.attr("style");var la=$('#photoBack');la.attr("style","background:url(/img/load.gif) center center no-repeat;");if(!slideShowObj){slideShowObj=document.getElementById("photoCounter");}
slideShowObj.innerHTML="Loading...";if(slideShowTimer){stopSlideshow();continueSlideShow=true;}
jsonp("/photos/"+ia+"/view-"+id,"");}
function doPhotoResults(ma){if(ma.status==200){slideShowObj.innerHTML="&nbsp;";var na=$('#photoObj');curPhoto=ma.photo.id;na.attr("style","width: "+ma.photo.wd+"px; height: "+ma.photo.ht+"px;");na.attr("src",ma.photo.url);var oa=document.getElementById("h3Viewing");oa.innerHTML="Viewing Photo "+ma.photo.id+" of "+ma.gallery.total;var pa=$('#nextPhoto');var qa=$('#nextButton');var ra=$('#prevButton');var sa=document.getElementById("photoTitle");sa.innerHTML=ma.photo.title;var ta="Ocala Photography, Photographer Photos";if(ma.photo.title!=ma.gallery.title){ta=ma.gallery.title;}
var ua=document.getElementById("galleryTitle");ua.innerHTML=ta;if(ma.gallery.pagiPrev){ra.attr("onClick","doPhoto('"+ma.gallery.url+"', "+((ma.photo.id*1)-1)+");");ra.attr("class","");}
else{ra.attr("onClick","");ra.attr("class","disable");}
if(ma.gallery.pagiNext){qa.attr("class","");pa.attr("onClick","doPhoto('"+ma.gallery.url+"', "+((ma.photo.id*1)+1)+");");pa.attr("class","");pa.attr("title","Click to go to Next Photo");}
else{qa.attr("class","disable");pa.attr("onClick","");pa.attr("class","disable");pa.attr("title","");}
if(continueSlideShow){startSlideshow();continueSlideShow=false;}
var va=$('#fbLike');va.attr("src","http://www.facebook.com/widgets/like.php?href=http://beger.com/photos/"+ma.gallery.url+"/photo-"+ma.photo.id);doPhotoTrack("/ajax/photos/"+ma.gallery.url+"/photo-"+ma.photo.id);}}
function doPhotoTrack(wa){try{if(pageTracker){pageTracker._trackPageview(wa);}}
catch(err){}}

function showFbLike(){
	$(document).ready(function(){
		var e = document.createElement('script'); e.async = true;
		e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js#xfbml=1';
		$("#fb-root").html('<' + 'fb:like-box href="http://www.facebook.com/BegerProductions" stream="false" header="false" width="630"></fb:like-box' + '>');
		document.getElementById('fb-root').appendChild(e);
	});
}

