var MESSAGES = { "format.date": "MM/dd/yyyy", "format.time": "h:mm a", "photoviewer.toolbar.first": "First Photo (Home)", "photoviewer.toolbar.prev": "Previous Photo (Left arrow)", "photoviewer.toolbar.slideShow": "Start/Pause Slide Show (Space)", "photoviewer.toolbar.next": "Next Photo (Right arrow)", "photoviewer.toolbar.last": "Last Photo (End)", "photoviewer.toolbar.email": "Email Photo", "photoviewer.toolbar.permalink": "Link to Photo", "photoviewer.toolbar.close": "Exit (Esc)", "photoviewer.email.subject.photo": "Photo", "gallery.nophotos": "No photos", "gallery.thumbs.start": "Start", "gallery.thumbs.end": "End", "gallery.toolbar.first": "First Photo", "gallery.toolbar.prev": "Previous Photo", "gallery.toolbar.view": "View Photo", "gallery.toolbar.next": "Next Photo", "gallery.toolbar.last": "Last Photo", "gallery.view.full": "Maximize Window", "gallery.view.photo": "Show Photo Only", "gallery.view.text": "Show Description Only", "gallery.view.close": "Close Window" }; var agent=navigator.userAgent.toLowerCase();var IE=(agent.indexOf("msie")!=-1&&agent.indexOf("opera")==-1);var IE7=(agent.indexOf("msie 7")!=-1);var IE8=(agent.indexOf("msie 8")!=-1);var OPERA=(agent.indexOf("opera")!=-1);var SAFARI=(agent.indexOf("safari")!=-1);var FIREFOX=(agent.indexOf("gecko")!=-1);var STRICT_MODE=(document.compatMode=="CSS1Compat");var _DOMAIN=undefined;var GALLERY_W=650;var GALLERY_H=530;if(USE_GOOGLE_MAPS==undefined){var USE_GOOGLE_MAPS=true;} var USE_OLD_MAPS=!USE_GOOGLE_MAPS;var TESTING=false;var log=getLogger();if(document.location.href.indexOf("#jslog")!=-1) log.enable();function Logger(){this.enable=loggerEnable;this.clear=loggerClear;this.log=loggerLog;this.debug=loggerDebug;this.info=loggerInfo;this.error=loggerError;var console=undefined;try{console=document.createElement("textarea");console.style.display="none";console.style.position="absolute";console.style.right="2px";console.style.bottom="2px";console.style.width="23em";console.style.height="40em";console.style.fontFamily="monospace";console.style.fontSize="9px";console.style.color="#000000";setOpacity(console,0.7);console.border="1px solid #808080";console.ondblclick=clearLogger;}catch(e){} this.console=console;this.enabled=false;this.logTimeStart=getTimeMillis();} function getLogger(){var log=undefined;var win=window;while(log==undefined){try{log=win.document.log;}catch(e){break;} if(win==win.parent) break;win=win.parent;} if(log==undefined){log=new Logger();document.log=log;} return log;} function clearLogger(){getLogger().clear();} function loggerEnable(){if(this.enabled||this.console==undefined) return;if(window.document.body!=undefined){window.document.body.appendChild(this.console);this.console.style.display="";this.enabled=true;}} function loggerDebug(msg){this.log("DEBUG",msg);} function loggerInfo(msg){this.log("INFO",msg);} function loggerError(msg,e){this.log("ERROR",msg,e);} function loggerLog(level,msg,e){if(!this.enabled||this.console==undefined) return;var millis=(getTimeMillis()-this.logTimeStart)+"";while(millis.length<6) millis+=" ";var m=millis+" ";if(msg!=undefined) m+=msg+" ";if(e!=undefined) m+=e.name+": "+e.message;this.console.value+=m+"\n";} function loggerClear(){if(!this.enabled||this.console==undefined) return;this.console.value="";} function getTimeMillis(){var t=new Date();return Date.UTC(t.getFullYear(),t.getMonth(),t.getDay(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());} function getEvent(event){return(event!=undefined?event:window.event);} function preventDefault(event){if(event.stopEvent) event.stopEvent();if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}} function getEventTarget(event){if(event==undefined) return undefined;if(event.srcElement!=undefined) return event.srcElement;else return event.target;} function getMousePosition(event){event=getEvent(event);var scrollLeft=window.pageXOffset;if(scrollLeft==undefined||scrollLeft===0) scrollLeft=window.document.documentElement.scrollLeft;if(scrollLeft==undefined||scrollLeft===0) scrollLeft=window.document.body.scrollLeft;var scrollTop=window.pageYOffset;if(scrollTop==undefined||scrollTop===0) scrollTop=window.document.documentElement.scrollTop;if(scrollTop==undefined||scrollTop===0) scrollTop=window.document.body.scrollTop;var x=event.clientX+scrollLeft;var y=event.clientY+scrollTop;return{x:x,y:y};} function getResponse(url,async,getXML,callback,data){var req=undefined;try{req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){req=new XMLHttpRequest();}} if(req==undefined){log.error("Failed to initialize XML/HTTP");return undefined;} req.open("GET",url,async);if(!async){req.send(undefined);if(req.readyState!=4){log.error("Request failed: "+req.readyState);return undefined;} if(!getXML) return req.responseText;else return req.responseXML;}else{pollResponse(req,callback,data);req.send(undefined);return undefined;}} function pollResponse(req,callback,data){if(req.readyState!=4) window.setTimeout(function(){pollResponse(req,callback,data);},100);else callback(req,data);} function getDOMLocation(node){var x=node.offsetLeft;var y=node.offsetTop;while(node.offsetParent){x=x+node.offsetParent.offsetLeft;y=y+node.offsetParent.offsetTop;if(node==document.getElementsByTagName('body')[0]){break;}else{node=node.offsetParent;}} return{x:x,y:y};} function getElementsByTagName(node,tag){if(node==undefined) return undefined;if(IE){return node.getElementsByTagName(tag);} if(tag.indexOf(":")!=-1){tag=tag.split(":")[1];} return node.getElementsByTagNameNS("*",tag);} function getFirstElementsValue(node,tag){if(node==undefined) return undefined;var nodes=getElementsByTagName(node,tag);if(nodes.length===0) return undefined;else return getElementValue(nodes[0]);} function findDOMElement(id){var el=undefined;var win=window;while(el==undefined){try{el=win.document.getElementById(id);}catch(e){break;} if(win===win.parent){break;} win=win.parent;} return el;} function getElementValue(node){var i;var val="";for(i=0;ilen){str=str.substring(0,len)+"...";} return str;} function getRootWindow(){var win=window;while(win!=undefined){try{if(win===win.parent){break;}else if(win.parent!=undefined&&win.parent.document.location.href.indexOf("/selenium-server/")!=-1){break;} win=win.parent;}catch(e){win.permissionDenied=true;break;}} return win;} function getURLParams(){var i,params=[];var url=window.location.search;if(url==undefined||url.length===0) return undefined;url=url.substring(1);var namevals=url.replace(/\+/g," ").split("&");for(i=0;i0){for(i=0;i0){for(i=0;i90||Math.abs(lon)>180){return false;} if(lat===0.0&&lon===0.0){return false;} return true;} function isHosted(){var host=document.location.host;if(host==undefined) host="";return((host.indexOf("iranskin.com/gallery/")==-1||host.indexOf("iranskin.com/gallery/")!=-1)&&host.indexOf("rtvslo.si")==-1&&host!="localhost"&&!checkDomain());} function checkDomain(){try{if(_DOMAIN==undefined) return false;var protocol=document.location.protocol;if(protocol==undefined) protocol="http:";var host=document.location.host;if(host==undefined) host="";host=host.toLowerCase();if(protocol.toLowerCase().indexOf("file")===0){return true;} var pos=host.lastIndexOf(":");if(pos!=-1){host=host.substring(0,pos);} if(host.indexOf("www.")===0){host=host.substring(4);} if(host===""||host=="localhost"||host=="127.0.0.1") return true;var domain=_DOMAIN.toLowerCase();pos=domain.indexOf("://");if(pos!=-1){domain=domain.substring(pos+3);} pos=domain.indexOf("/");if(pos!=-1){domain=domain.substring(0,pos);} if(domain.indexOf("www.")===0){domain=domain.substring(4);} if(host==domain){return true;}else if(new RegExp(domain).test(host)){return true;} return false;}catch(e){return true;}} function getWindowSize(win){var availW=win.innerWidth;if(availW==undefined||availW===0||isNaN(availW)) availW=win.document.documentElement.clientWidth;if(availW==undefined||availW===0||isNaN(availW)) availW=win.document.body.clientWidth;var availH=win.innerHeight;if(availH==undefined||availH===0||isNaN(availH)) availH=win.document.documentElement.clientHeight;if(availH==undefined||availH===0||isNaN(availH)) availH=win.document.body.clientHeight;return{w:availW,h:availH};} function getDocumentSize(win){var winSize=getWindowSize(win);var scrollPos=getScrollPos(win);var w=winSize.w+scrollPos.left;var h=winSize.h+scrollPos.top;w=Math.max(w,win.document.body.offsetWidth);h=Math.max(h,win.document.body.offsetHeight);w=Math.max(w,win.document.body.scrollWidth);h=Math.max(h,win.document.body.scrollHeight);return{w:w,h:h};} function getScrollPos(win){var scrollTop=win.pageYOffset;if(scrollTop==undefined||scrollTop===0) scrollTop=win.document.documentElement.scrollTop;if(scrollTop==undefined||scrollTop===0) scrollTop=win.document.body.scrollTop;var scrollLeft=win.pageXOffset;if(scrollLeft==undefined||scrollLeft===0) scrollLeft=win.document.documentElement.scrollLeft;if(scrollLeft==undefined||scrollLeft===0) scrollLeft=win.document.body.scrollLeft;return{top:scrollTop,left:scrollLeft};} var CLEAR_EVENTS=["onclick","ondblclick","onkeydown","onkeypress","onmousedown","onmouseup","onmousemove","onmouseover","onmouseout","onmousewheeldown","oncontextmenu"];function clearEvents(){var i,j;var count=0;if(document.all==undefined) return;for(i=0;i=this.photos.length){log.error("Invalid photo index");return true;} var doc=this.win.document;var firstShow=false;if(!this.shown){firstShow=true;doc.viewer=this;try{this.hideOverlappingElements();}catch(e){}} var zIndex=16384;var winSize=getWindowSize(this.win);var availW=winSize.w-(this.nopadding?this.borderWidth*2:20);var availH=winSize.h-(this.nopadding?this.borderWidth*2:20);var scrollPos=getScrollPos(this.win);var scrollLeft=scrollPos.left;var scrollTop=scrollPos.top;this.addBackShade(zIndex);this.addByLine(zIndex);this.addBylineCaption();if(this.showToolbar){this.addToolbar(availW,zIndex);this.addCaptions();} var photo=this.photos[this.index];if(isNaN(photo.w)||isNaN(photo.h)){if(photo.preloadImage!=undefined){if(isNaN(photo.w)&&photo.preloadImage.width>0) photo.w=photo.preloadImage.width;if(isNaN(photo.h)&&photo.preloadImage.height>0) photo.h=photo.preloadImage.height;}else{this.index--;this.next();return false;}} if(isNaN(photo.w)||isNaN(photo.h)){this.index--;this.next();return false;} this.shown=true;var offset=(this.nopadding?0:20);var pw=-1;var ph=-1;if(parseInt(photo.w)>availW||parseInt(photo.h)>availH){if(parseInt(photo.w)/availW>parseInt(photo.h)/availH){pw=availW-offset;ph=parseInt(pw*photo.h/photo.w);}else{ph=availH-offset;pw=parseInt(ph*photo.w/photo.h);}}else{pw=parseInt(photo.w);ph=parseInt(photo.h);} if(pw<=0||ph<=0){if(!this.showToolbar) throw"Missing photo dimension";} if(cropWidth==undefined) cropWidth=0;var photoDiv=doc.createElement("div");photoDiv.id=VIEWER_ID_PHOTO;photoDiv.style.visibility="hidden";photoDiv.style.position="absolute";photoDiv.style.zIndex=zIndex;photoDiv.style.overflow="hidden";photoDiv.style.border=this.borderWidth+"px solid "+this.borderColor;photoDiv.style.textAlign="center";photoDiv.style.backgroundColor=this.backgroundColor;var photoElt=doc.createElement("img");photoElt.style.visibility="hidden";photoElt.style.position="relative";photoElt.style.backgroundColor=this.backgroundColor;photoElt.style.border="none";photoElt.style.cursor="pointer";photoElt.style.zIndex=(parseInt(photoDiv.style.zIndex)+1)+"";photoElt.onclick=this.photoOnClickEvent?this.photoOnClickEvent:onClickEvent;photoElt.oncontextmenu=onContextMenuEvent;if(opacity!=undefined&&this.fadePhotos){var fadeElt=(FADE_BORDER?photoDiv:photoElt);setOpacity(fadeElt,opacity);} var left=parseInt((availW-pw)/2)+(this.nopadding?0:OFFSET_LEFT);photoDiv.style.left=(left+scrollLeft+cropWidth/2)+"px";var top=parseInt((availH-ph)/2)+(this.nopadding?0:OFFSET_TOP);photoDiv.style.top=(top+scrollTop)+"px";photoElt.style.visibility="hidden";photoDiv.style.width=(pw-cropWidth>0?pw-cropWidth:pw)+"px";photoDiv.style.height=ph+"px";photoElt.style.width=pw+"px";photoElt.style.height=ph+"px";photoElt.src=photo.src;photoDiv.style.visibility="visible";photoElt.style.visibility="visible";photoDiv.appendChild(photoElt);doc.body.appendChild(photoDiv);if(this.photoDiv!=undefined){try{doc.body.removeChild(this.photoDiv);}catch(e){}} this.photoDiv=photoDiv;this.photoImg=photoElt;this.setLoading(false);if(this.showCallback!=undefined) this.showCallback(this.index);if(firstShow&&this.autoPlay){this.slideShow(true);} return false;} function isPhotoShown(){return this.shown;} function closeViewer(){getViewer().close();} function onPhotoLoad(event){var viewer=getViewer();if(viewer!=undefined){if(flickrHack(viewer,viewer.index)){viewer.setLoading(false);viewer.index--;viewer.next();return;} viewer.show();}} function closePhoto(){var win=this.win;if(win==undefined) win=window;var doc=win.document;var elt=this.photoDiv;if(elt!=undefined) doc.body.removeChild(elt);elt=doc.getElementById(VIEWER_ID_TOOLBAR);if(elt!=undefined) doc.body.removeChild(elt);elt=doc.getElementById(VIEWER_ID_BYLINE);if(elt!=undefined) doc.body.removeChild(elt);elt=doc.getElementById(VIEWER_ID_BACK);if(elt!=undefined) doc.body.removeChild(elt);this.shown=false;this.slideShowRunning=false;this.slideShowPaused=false;try{this.showOverlappingElements();}catch(e){log.error(e);} if(this.toolbarAnimator!=undefined){this.toolbarAnimator.reset();} if(this.closeCallback!=undefined) this.closeCallback(this.index);if(this.contextMenu!=undefined) this.contextMenu.hide();} function nextPhoto(n){if(this.contextMenu!=undefined&&this.contextMenu.visible) this.contextMenu.hide();if(this.isLoading) return;if(n==undefined) n=1;var oldIndex=this.index;if(this.index+n>=this.photos.length){if(this.loop&&n!=this.photos.length){this.index=0;}else{this.index=this.photos.length-1;}}else if(this.index+n<0){if(n<-1) this.index=0;else if(this.loop) this.index=this.photos.length-1;else return;}else{this.index+=n;} if(this.index==oldIndex) return;this.slideShowStop();var img=new Image();this.photos[this.index].preloadImage=img;this.setLoading(true);img.onload=onPhotoLoad;img.onerror=onPhotoLoad;if(this.photos[this.index].src!=undefined){img.src=this.photos[this.index].src;}else{onPhotoLoad();}} function prevPhoto(n){if(this.contextMenu!=undefined&&this.contextMenu.visible) this.contextMenu.hide();if(n==undefined) n=1;this.next(-n);} function firstPhoto(){if(this.contextMenu!=undefined&&this.contextMenu.visible) this.contextMenu.hide();this.prev(this.photos.length);} function lastPhoto(){if(this.contextMenu!=undefined&&this.contextMenu.visible) this.contextMenu.hide();this.next(this.photos.length);} function startSlideShow(){if(this.contextMenu!=undefined&&this.contextMenu.visible) this.contextMenu.hide();getViewer().slideShow(true);} var slideTimeout;var slidePreloadImageLoaded=false;var slidePreloadTime=undefined;function slideShow(start){if(this.toolbarAnimator!=undefined) this.toolbarAnimator.slideshowAction();var nextIndex=this.index+1;if(nextIndex>=this.photos.length){if(this.loop) nextIndex=0;else if(!this.slideShowPaused&&!this.slideShowRunning){this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);return;}} var doc=this.win.document;var viewer=this;var photoElt=this.photoImg;if(photoElt==undefined) return;var photoDiv=this.photoDiv;var fadeElt=(FADE_BORDER?photoDiv:photoElt);if(start!=undefined&&start===true){if(this.slideShowPaused){this.slideShowPaused=false;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG_RUNNING);if(this.contextMenu!=undefined&&this.contextMenu.visible) this.contextMenu.hide();return;}else if(this.slideShowRunning){this.slideShowPaused=true;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);return;}else{if(this.contextMenu!=undefined&&this.contextMenu.visible) this.contextMenu.hide();this.slideShowRunning=true;this.slideShowPaused=false;this.slideFirstPhoto=true;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG_RUNNING);} if(this.isLoading||this.index>this.photos.length-1){return;}}else if(this.slideShowPaused){window.setTimeout(function(){viewer.slideShow(false);},200);return;}else if(!this.slideShowRunning){this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);return;} var left=0;if(photoElt.leftOffset!=undefined){left=parseFloat(photoElt.leftOffset);} if(left===0){if(nextIndex-SLIDE_OFFSET){left-=MOVE_STEP;if(-left<=FADE_STEPS){if(fadeElt.style.opacity!=undefined&&parseFloat(fadeElt.style.opacity)<1){if(this.fadePhotos&&this.photos[this.index].src!=undefined) setOpacity(fadeElt,-left/FADE_STEPS);}}else if(left+SLIDE_OFFSETPRELOAD_TIMEOUT) slidePreloadImageLoaded=true;left++;this.setLoading(true);}else{if(nextIndex=this.photos.length){this.slideShowRunning=false;this.slideShowPaused=false;this.setToolbarImage(P_IMG_ROOT+"/"+TOOLBAR_IMG);if(this.toolbarAnimator!=undefined) this.toolbarAnimator.reset();if(this.endCallback!=undefined) this.endCallback();return;} this.index=nextIndex;this.slideFirstPhoto=false;this.show(undefined,(this.panPhotos?SLIDE_OFFSET:0),0);fadeElt=(FADE_BORDER?this.photoDiv:this.photoImg);if(this.fadePhotos) setOpacity(fadeElt,0);this.photoImg.leftOffset=0;if(this.panPhotos) this.photoImg.style.left="0px";} var pause=this.slideDuration/SLIDE_OFFSET;if(this.slideFirstPhoto){pause/=2;} slideTimeout=window.setTimeout(function(){viewer.slideShow(false);},pause);} function onSlideLoad(event){var viewer=getViewer();if(viewer!=undefined){if(flickrHack(viewer,viewer.index+1)){var slidePreloadImage=viewer.photos[viewer.index+1].preloadImage;slidePreloadImage.src=viewer.photos[viewer.index+1].src;slidePreloadTime=getTimeMillis();return;} slidePreloadImageLoaded=true;viewer.setLoading(false);}} function slideShowStop(){this.slideShowRunning=false;this.slideShowPaused=false;var doc=this.win.document;var photoElt=this.photoImg;if(photoElt!=undefined){if(this.fadePhotos){var fadeElt=(FADE_BORDER?this.photoDiv:photoElt);setOpacity(fadeElt,1);} photoElt.style.left="0px";}} function addBackShade(zIndex){var doc=this.win.document;if(doc.getElementById(VIEWER_ID_BACK)!=undefined){return;} var photoBack=doc.createElement("div");photoBack.id=VIEWER_ID_BACK;photoBack.style.top="0px";photoBack.style.left="0px";photoBack.style.bottom="0px";photoBack.style.right="0px";photoBack.style.margin="0";photoBack.style.padding="0";photoBack.style.border="none";photoBack.style.cursor="pointer";if(IE&&!(IE7&&STRICT_MODE)){photoBack.style.position="absolute";var docSize=getDocumentSize(this.win);photoBack.style.width=(docSize.w-21)+"px";photoBack.style.height=(docSize.h-4)+"px";}else{photoBack.style.position="fixed";photoBack.style.width="100%";photoBack.style.height="100%";} photoBack.style.zIndex=zIndex-1;photoBack.style.backgroundColor=this.shadeColor;if(this.backgroundShade) setOpacity(photoBack,this.shadeOpacity);else setOpacity(photoBack,0.0);photoBack.onclick=onClickEvent;doc.body.appendChild(photoBack);} function addToolbar(availW,zIndex){var doc=this.win.document;var i;if(doc.getElementById(VIEWER_ID_TOOLBAR)!=undefined) return;var photoToolbar=doc.createElement("div");photoToolbar.id=VIEWER_ID_TOOLBAR;setOpacity(photoToolbar,TOOLBAR_OPACITY);photoToolbar.style.zIndex=zIndex+1;var imgBack=TOOLBAR_IMG_BACK;if(!isHosted()){imgBack+="-nologo";} if(IE&&!IE7){imgBack+="-indexed";} imgBack+=".png";if(!this.overrideToolbarStyles){var bottom=10;if(IE&&!(IE7&&STRICT_MODE)){photoToolbar.style.position="absolute";if(IE7||IE8){var top=getWindowSize(this.win).h+getScrollPos(this.win).top;photoToolbar.style.top=(top-TOOLBAR_H-10)+"px";}else{photoToolbar.style.bottom=bottom+"px";}}else{photoToolbar.style.position="fixed";photoToolbar.style.bottom=bottom+"px";} photoToolbar.style.left=(availW-TOOLBAR_W+10)/2+"px";photoToolbar.style.width=TOOLBAR_W+"px";photoToolbar.style.height=TOOLBAR_H+"px";photoToolbar.style.textAlign="center";photoToolbar.style.backgroundImage="url('"+P_IMG_ROOT+"/"+imgBack+"')";photoToolbar.style.backgroundPosition="50% 0%";photoToolbar.style.backgroundRepeat="no-repeat";photoToolbar.style.lineHeight=LINE_HEIGHT;photoToolbar.style.border="none";} var toolbarMask=undefined;if(!this.enableEmailLink&&TOOLBAR_IMG_MASK!=undefined){toolbarMask=doc.createElement("img");toolbarMask.style.position="absolute";toolbarMask.style.width=44;toolbarMask.style.height=44;toolbarMask.style.left="289px";toolbarMask.style.top="0px";toolbarMask.style.border="none";toolbarMask.src=P_IMG_ROOT+"/"+TOOLBAR_IMG_MASK;photoToolbar.appendChild(toolbarMask);} if(!this.isEnablePhotoLink&&TOOLBAR_IMG_MASK!=undefined){toolbarMask=doc.createElement("img");toolbarMask.style.position="absolute";toolbarMask.style.width=44;toolbarMask.style.height=44;toolbarMask.style.left="339px";toolbarMask.style.top="0px";toolbarMask.style.border="none";toolbarMask.src=P_IMG_ROOT+"/"+TOOLBAR_IMG_MASK;photoToolbar.appendChild(toolbarMask);} var imgMap=this.customImageMap;if(imgMap===undefined){imgMap=doc.createElement("map");var ssl=false;try{ssl=(window.parent.document.location.protocol=="https:");}catch(ex){} var areas=[];areas.push(["getViewer().first()","17",getMessage("photoviewer.toolbar.first")]);areas.push(["getViewer().prev()","68",getMessage("photoviewer.toolbar.prev")]);areas.push(["getViewer().slideShow(true)","122",getMessage("photoviewer.toolbar.slideShow")]);areas.push(["getViewer().next()","175",getMessage("photoviewer.toolbar.next")]);areas.push(["getViewer().last()","227",getMessage("photoviewer.toolbar.last")]);if(this.enableEmailLink) areas.push(["getViewer().email()","300",getMessage("photoviewer.toolbar.email")]);if(this.isEnablePhotoLink) areas.push(["getViewer().permalink()","350",getMessage("photoviewer.toolbar.permalink")]);areas.push(["getViewer().close()","402",getMessage("photoviewer.toolbar.close")]);for(i=0;iTITLE_MAX_LENGTH){photoTitle.title=title;photoTitle.alt=title;title=title.substring(0,TITLE_MAX_LENGTH)+" ...";} if(title.indexOf("\n")!==0){title=title.replace("\n","
");photoTitle.innerHTML=title;}else{photoTitle.nodeValue=title;}} function addBylineCaption(){var photo=this.photos[this.index];var doc=this.win.document;var photoByline=doc.getElementById(VIEWER_ID_BYLINE);if(photo.byline!=undefined&&photo.byline.length>0){photoByline.firstChild.nodeValue=photo.byline;}else{photoByline.firstChild.nodeValue="";}} function setCloseCallback(callback){this.closeCallback=callback;} function setShowCallback(callback){this.showCallback=callback;} function setEndCallback(callback){this.endCallback=callback;} function emailPhoto(){var photo=this.photos[this.index];var doc=this.win.document;var title=(photo.title!=undefined?photo.title:getMessage("photoviewer.email.subject.photo"));var emailAddress=this.emailAddress!==undefined?this.emailAddress:"";var mailtoLink="mailto:"+emailAddress+"?subject="+title+"&body="+ getPhotoURL(photo.src);doc.location.href=mailtoLink;} function getPhotoURL(url){var loc=document.location;if(/\w+:\/\/.+/.test(url)){return url;}else if(url.indexOf("/")===0){return loc.protocol+"//"+loc.host+url;}else{var path=loc.pathname;var pos=path.lastIndexOf("/");if(pos!=-1){path=path.substring(0,pos);} return loc.protocol+"//"+loc.host+path+"/"+url;}} function linkPhoto(){var photo=this.photos[this.index];window.open(photo.link?photo.link:photo.src);} function favoritePhoto(){var photo=this.photos[this.index];var doc=this.win.document;var restURL=REST_URL+"markfeatured?id"+photo.id;try{var res=getResponse(restURL,false,true);}catch(e){return;}} function hideOverlappingElements(node){if(node==undefined){node=this.win.document.body;this.hideOverlappingElements(node);return;} if(node.style!=undefined&&node.style.visibility!="hidden"){var nodeName=node.nodeName.toLowerCase();if((node.className!=undefined&&node.className.indexOf("SlideshowDoHide")!=-1)||((IE||FIREFOX)&&(nodeName=="select"||nodeName=="object"||nodeName=="embed"))){node.style.visibility="hidden";if(this.hiddenElements==undefined) this.hiddenElements=[];this.hiddenElements.push(node);}} if(node.childNodes!=undefined){var i;for(i=0;i0?opacity:0);this.hidden=true;this.hiderID=window.setTimeout(function(){_this.hideToolbar();},100);};ToolbarAnimator.prototype.showToolbar=function(){var toolbar=findDOMElement(VIEWER_ID_TOOLBAR);if(toolbar!=undefined){toolbar.style.display="block";setOpacity(toolbar,TOOLBAR_OPACITY);} this.hidden=false;};function addContextMenu(contextMenu){if(isHosted()||getViewer().contextMenu!=undefined){return;} this.contextMenu=contextMenu;this.contextMenu.initialize();} function PhotoViewerCtxMenuItem(text,callback){this.text=text;this.callback=callback;} function PhotoViewerCtxMenu(cssClass){this.cssClass=cssClass;this.items=[];this.ctxSubMenus=[];} PhotoViewerCtxMenu.prototype.mouseover=function(e){var viewer=getViewer();var ctxMenu=viewer.contextMenu;if(!ctxMenu.visible){return;} for(var i=0;i