
var THUMBNAILS_DIR="/AllPhotos/thumbnails/";var FULL_SIZE_PHOTOS_DIR="/AllPhotos/fullsize/";var LARGER_PHOTOS_DIR="/AllPhotos/large/";var REGULAR_PHOTOS_DIR="/AllPhotos/regular/";var MEDIUM_PHOTOS_DIR="/AllPhotos/medium/";var VIDEO_DIR="/AllPhotos/video/";var SCRIPTS_SOURCE_DIR="/BobbyCommonCode/";var PER_SITE_SCRIPTS="/BobbyPerSiteCode/";var PHOTO_TAGS_DIR="/Photo_Main/"
var D_QUOTE='"';var S_QUOTE="'";var DEBUG_ME=false;var TIME_OF_LAST_COMMENT=0;function getXMLdata(xmlFileNameToLoad,FunctionToProcessXML,requestNumber){if(DEBUG_ME)log("getXMLdata: xmlFileNameToLoad = ["+xmlFileNameToLoad+"]");var XMLhttp=null;if(window.XMLHttpRequest){XMLhttp=new XMLHttpRequest();}else if(window.ActiveXObject){XMLhttp=new ActiveXObject("Microsoft.XMLHTTP");}
if(XMLhttp!=null){XMLhttp.onreadystatechange=function(){if((XMLhttp.readyState==4)&&(XMLhttp.status==200))FunctionToProcessXML(XMLhttp,requestNumber);}
XMLhttp.open("GET",xmlFileNameToLoad,true);XMLhttp.send(null);}else{alert("Your browser does not support XMLHTTP.");}}
function log(message){if(!log.window_||log.window_.closed){var logWin=window.open("",null,"width=600,height=800,"+"scrollbars=yes,resizable=yes,status=no,"+"location=no,menubar=no,toolbar=no");if(!logWin)return;var doc=logWin.document;doc.write("<html><head><STYLE TYPE='text/css'><!--BODY{color:white;background-color:black;font-family:sans-serif;}--></STYLE><title>Debug Log</title></head>"+"<body></body></html>");doc.close();log.window_=logWin;}
var logLine=log.window_.document.createElement("div");logLine.appendChild(log.window_.document.createTextNode(message));log.window_.document.body.appendChild(logLine);}
function pageComments(myMode,myUsername,myEmail,myComment){var theUrl=window.location.href;var photo_fn='';var i=theUrl.lastIndexOf("/")
var j=theUrl.lastIndexOf("#")
if((i>-1)&&(j>-1)){var temp=theUrl.substring(i+1);if(temp.length==8){if(isNumeric(temp)){photo_fn=temp;}}}
var url=SCRIPTS_SOURCE_DIR+"getComments.php";url=url+"?comment_mode="+myMode+"&comment_username="+myUsername+"&photo_fn="+photo_fn+"&comment_email="+myEmail+"&comment_page="+encodeURIComponent(theUrl)+"&comment_comment="+encodeURIComponent(myComment);url=url+"&sid="+Math.random();document.getElementById("commentsDisplay").innerHTML="<br><br><b>Loading Comments ...</b>";getXMLdata(url,processPageCommentsXML,1);}
function processPageCommentsXML(pageCommentsXmlHttp,requestNumber){document.getElementById("commentsDisplay").innerHTML=pageCommentsXmlHttp.responseText;}
function getRecentChanges(){getXMLdata(SCRIPTS_SOURCE_DIR+"getRecentChanges.php?&sid="+Math.random(),displayRecentChanges,1);}
function displayRecentChanges(XMLhttp,requestNumber){document.getElementById("recentChanges").innerHTML=XMLhttp.responseText;}
function submitComments(){var d=new Date();var secondsSince1970=(d.getTime()/1000);if((d==0)||((secondsSince1970-TIME_OF_LAST_COMMENT)>10)){TIME_OF_LAST_COMMENT=secondsSince1970;}else{alert("You must wait 10 seconds between each comment!");}
if(window.document.commentInputForm.commentName.value==""){alert("You must enter some value for your name!");return;}
var email=window.document.commentInputForm.commentEmail.value;if((email=="")||(!isValidEmailAddress(email))){alert("You must enter a valid email address!");return;}
var cmt=window.document.commentInputForm.commentText.value;if(cmt==""){alert("You must enter some value for the comments!");return;}
if(cmt.length>1000){alert("Limit your comments to 1000 characters. You typed "+
cmt.length+" characters!");return;}
if((cmt.indexOf("<")>-1)||(cmt.indexOf(">")>-1)||(cmt.indexOf("http")>-1)||(cmt.indexOf("www")>-1)){alert("To prevent spammers adding comments containing links to their websites you are not "+"allowed to enter '<' '>' 'http' or 'www' in your comments as these are part of "+"the syntax for linking to other web sites.");return;}
pageComments('PUT',window.document.commentInputForm.commentName.value,window.document.commentInputForm.commentEmail.value,window.document.commentInputForm.commentText.value);}
function sendMail(emailAddr,mySubject){var str=emailAddr.replace(/=/g,'');str=str.replace(/;/g,'@');document.location.href="mailto"+":"+str+"?subject="+mySubject;}
function isValidEmailAddress(s){var filter=/^.+@.+\..{2,4}$/;if(filter.test(s))return true;return false;}
function isNumeric(s){var validChars="0123456789.";var isNumber=true;var aChar;for(var i=0;i<s.length&&isNumber==true;i++){aChar=s.charAt(i);if(validChars.indexOf(aChar)==-1)isNumber=false;}
return isNumber;}
function StringBuffer(){this.buffer=[];}
StringBuffer.prototype.append=function append(string){this.buffer.push(string);return this;};StringBuffer.prototype.toString=function toString(){return this.buffer.join("");};var tooltip=function(){var top=-50;var left=15;var tt,h;var ie=document.all?true:false;var img="";var width;var height;return{show:function(v,s){if(s=="M"){width=readCookie("bobby_medium_tooltip_width");height=readCookie("bobby_medium_tooltip_height");img=readCookie("bobby_medium_tooltip_fn");}
if(s=="S"){width=readCookie("bobby_small_tooltip_width");height=readCookie("bobby_small_tooltip_height");img=readCookie("bobby_small_tooltip_fn");}
if(s=="L"){width=readCookie("bobby_large_tooltip_width");height=readCookie("bobby_large_tooltip_height");img=readCookie("bobby_large_tooltip_fn");}
if(s=="XL"){width=readCookie("bobby_xlarge_tooltip_width");height=readCookie("bobby_xlarge_tooltip_height");img=readCookie("bobby_xlarge_tooltip_fn");}
if(img==""){alert("Cookies are not enabled on your computer so I can not display tooltip help. "+"Please consider enabling cookies.");return;}
top=-(parseInt(height));v="<div style='background: url("+img+");width:"+((parseInt(width)+12)+"")+"px;height:"
+((parseInt(height)+12)+"")+"px;'>"+"<p style='padding:12px 20px 12px 12px;'>"+v+"</p></div>";if(tt==null){tt=document.createElement('div');tt.setAttribute('id','tt');document.body.appendChild(tt);document.onmousemove=this.pos;}
tt.style.display="inline";tt.innerHTML=v;h=parseInt(tt.offsetHeight)+top;},pos:function(e){var u=ie?event.clientY+document.documentElement.scrollTop:e.pageY;var l=ie?event.clientX+document.documentElement.scrollLeft:e.pageX;if(u>400)tt.style.top=(u-h-height)+'px';else tt.style.top=(u-h)+'px';if(l>550)tt.style.left=(l-left-width-12)+'px';else tt.style.left=(l+left)+'px';},hide:function(){if(tt!=null){tt.style.display='none';}}};}();function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else expires="";document.cookie=name+"="+value+expires+"; path=/";self.location=self.location;}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return unescape(c.substring(nameEQ.length,c.length));}
return"";}