var PhotoNoteView=function(C){this.mainImgId=C;this.mainImg=null;var B=document.getElementById(this.mainImgId);if(B){this.mainImg=B;}this.wrapper=null;var A=document.getElementById("photo_layovers_wrapper");if(A){this.wrapper=A;}this.boxes=[];this.imgCoor={x:0,y:0};this.imgPrefix="/images/photonotes/";this.getAbsoluteCoordinates=function(H){var F=document.getElementById(H);if(!F){return false;}var D=F.offsetLeft;var G=F.offsetTop;var E=F.offsetParent;while(E){D+=E.offsetLeft;G+=E.offsetTop;E=E.offsetParent;}this.imgCoor.x=D;this.imgCoor.y=G;return{x:D,y:G};};this.getAbsoluteCoordinates(this.mainImgId);this.setPhotoLayover=function(P,E,R,G,D,Q,T){if(!Q){Q="tt_blue";}if(!T){T="bottom";}var O=this.imgPrefix;var K=this.imgCoor;var J="tt_out_box_"+Math.floor(Math.random()*1000000);var S="tt_in_box_"+Math.floor(Math.random()*1000000);var I=this.wrapper;var N=document.createElement("DIV");N.className="ttbox_out";N.id=J;N.style.left=K.x+P+"px";N.style.top=K.y+E+"px";N.style.width=R+"px";N.style.height=G+"px";I.appendChild(N);var U=document.createElement("IMG");U.className="ttbox_in";U.id=S;U.setAttribute("src",O+"width.gif");U.style.height=G-2+"px";U.style.width=R-2+"px";N.appendChild(U);var F=document.createElement("DIV");F.className="ttconteiner_in "+Q;F.innerHTML=D;F.style.visibility="hidden";F.style.left=K.x+P+(R/2)-40+"px";I.appendChild(F);if(T=="bottom"){F.style.top=K.y+E+G+25+"px";}else{F.style.top=K.y+E-F.offsetHeight-25+"px";}var H=Q+"_"+T;var M;switch(H){case"tt_blue_bottom":M="blue_top.gif";break;case"tt_blue_top":M="blue_bottom.gif";break;case"tt_red_bottom":M="red_top.gif";break;case"tt_red_top":M="red_bottom.gif";break;}var L=document.createElement("img");L.setAttribute("src",O+M);L.className="tt_arrows";L.style.position="absolute";L.style.zIndex=10;L.style.left=K.x+P+(R/2)-12+"px";L.style.visibility="hidden";I.appendChild(L);if(T=="bottom"){L.style.top=K.y+E+G+14+"px";}else{L.style.top=K.y+E-27+"px";}var V=this;N.onmouseover=function(){F.style.visibility="visible";L.style.visibility="visible";V.mainImgMouseover();};N.onmouseout=function(){F.style.visibility="hidden";L.style.visibility="hidden";V.mainImgMouseout();};this.boxes.push({outbox_id:J,inbox_id:S});return true;};this.mainImgMouseover=function(){var F=this.boxes;for(var E=0,D=F.length;E<D;E++){if(!(F[E].outbox_id&&F[E].inbox_id)){continue;}var H=document.getElementById(F[E].outbox_id);if(H){H.style.border="1px solid black";}var G=document.getElementById(F[E].inbox_id);if(G){G.style.border="1px solid white";}}};this.mainImgMouseout=function(){var F=this.boxes;for(var E=0,D=F.length;E<D;E++){if(!(F[E].outbox_id&&F[E].inbox_id)){continue;}var H=document.getElementById(F[E].outbox_id);if(H){H.style.border="none";}var G=document.getElementById(F[E].inbox_id);if(G){G.style.border="none";}}};this.setImageHandler=function(){if(!this.mainImg){return false;}var D=this;this.mainImg.onmouseout=function(){D.mainImgMouseout();};this.mainImg.onmouseover=function(){D.mainImgMouseover();};};};var PhotoNoteView_photos=[];var PhotoNoteView_eval_code=[];