﻿var dec_pb=function(args){var EL=args[0];EL.EXT=new pbCnt(args[0],args[1],args[2],args[3]);return EL;};pbCnt=function(el,imgId){var EL=this.EL=el;var thisObj=this;var baseName=thisObj.base_name=el.id.split(el.className+'_').join('');thisObj.lock_down=0;thisObj.p_id=imgId;thisObj.on=new Image();EL.style.cursor=(document.all)?'hand':'pointer';EL.onmouseover=function(){if(window.notesEdit){return;}this.EXT.isOver=1;};EL.onmouseout=function(){this.EXT.isOver=0;if(!this.EXT.lock_down){this.EXT.isDown=0;}};EL.onmousedown=function(){if(window.notesEdit){return;}if(this.EXT.disabled){this.EXT.enableRest();this.EXT.enableSelf();}this.EXT.isDown=1;this.EXT.isOver=1;var el_d=_ge('pNts');};EL.onmouseup=function(){if(window.notesEdit){return;}if(this.EXT.disabled){return;}var thisAction=this.EXT['note_action']();this.EXT.isOver=1;if(thisAction==1){this.EXT.isDown=1;this.EXT.lock_down=1;}else{this.EXT.isDown=0;}};this.disableRest=function(){var all=document.getElementsByClass('pb','IMG');for(var i=0;i<all.length;i++){if(all[i].EXT.base_name!=thisObj.base_name){all[i].EXT.disableSelf();}}var eId=_ge('pNts');if(eId&&eId.EXT){eId.EXT.hideIt('disableRest');}window.buttonAction=1;};this.enableRest=function(){var all=document.getElementsByClass('pb','IMG');for(var i=0;i<all.length;i++){if(all[i].EXT.base_name!=thisObj.base_name){all[i].EXT.enableSelf();}}window.buttonAction=0;};this.disableSelf=function(){thisObj.disabled=1;EL.style.cursor='default';};this.enableSelf=function(){thisObj.disabled=0;EL.style.cursor=(document.all)?'hand':'pointer';};this.note_action=function(){var eId=_ge('pNts');if(eId&&eId.EXT){eId.EXT.addNote();}return 0;};};var nPlaceText=function(t){if(!document.all||window.opera){return;}var notesTextDiv=_ge('pNts');if(notesTextDiv){notesTextDiv.EXT.nPlaceText();setShadeHeight(notesTextDiv.EXT.nTab);}return;};var scaleHeight=function(t){return;temp_div.innerHTML=t.value.replace('<','&lt;').replace("\n",'<br/>')+'g';t.style.height=(temp_div.offsetHeight)+'px';return;if(t.scrollHeight>t.clientHeight){t.style.height=t.scrollHeight;}};function initNotes(){if(window.buttonAction){return;}var notesDiv=_ge('pNts');if(notesDiv&&notesDiv.EXT){notesDiv.EXT.shown_initially=1;notesDiv.style.visibility='visible';if(!notesDiv.EXT.shownAlready){notesDiv.EXT.nDelay();}}};var shadowDiv;var makeShadow=function(div,heightPlus,widthPlus,xPlus,yPlus){if(div==undefined){div=document.createElement('div');div.style.position='absolute';div.style.top='0px';div.style.left='0px';document.body.appendChild(div);}window.shadowHPlus=(heightPlus==undefined)?(12-22):heightPlus;window.shadowWPlus=(widthPlus==undefined)?(12-22):widthPlus;window.shadowXPlus=(xPlus==undefined)?(-5):xPlus;window.shadowYPlus=(yPlus==undefined)?(-5):yPlus;div.innerHTML='<table id="tShade"><tr><td><img class="tns shw shh" src="/images/sh_tl.png"></td><td id="shT"><img class="tns shh" width="100%" height="11" src="/images/sh_t.png"></td><td><img class="tns shw shh" src="/images/sh_tr.png"></td></tr><tr><td id="shL"><img class="tns shw" height="100%" src="/images/sh_l.png"></td><td></td><td id="shR"><img class="tns shw" height="100%" src="/images/sh_r.png"></td></tr><tr><td><img class="tns shw shh" src="/images/sh_bl.png"></td><td><img class="tns shh" width="100%" height="11" src="/images/sh_b.png"></td><td><img class="tns shw shh" src="/images/sh_br.png"></td></tr></table>';div.style.zIndex='999';div.style.display='none';div.id='shade';window.setShadeX=function(val){div.style.marginLeft=(val+shadowXPlus)+'px';};window.setShadeY=function(val){div.style.marginTop=(val+shadowYPlus)+'px';};window.setShadeHeight=function(objDiv){var el=_ge('shL');var el1=_ge('shR');if(!el){return;}var d=((objDiv.offsetHeight)+shadowHPlus);if(d<0){d=0;}if(navigator.appVersion.indexOf('MSIE')!= -1){d=d-2;}el.style.height=d+'px';el1.style.height=d+'px';};window.setShadeWidth=function(objDiv){var el=_ge('shT');if(!el){return;}var d=((objDiv.offsetWidth)+shadowWPlus);if(d<0){d=0;}if(navigator.appVersion.indexOf('MSIE')!= -1){d=d-2;}el.style.width=d+'px';};window.shadowDiv=div;};var dec_pNts=function(args){var EL=args[0];EL.EXT=new PhotoNotesCnt(args[0],args[1],args[2]);return EL;};PhotoNotesCnt=function(el,imageDiv,imageId){var EL=this.EL=el;var thisNote=this;thisNote.colorSet={yellow:'#FFFFD0',blue:'#DCF5FF'};thisNote.isOver=thisNote.editing=thisNote.dragging=0;thisNote.hide_while_dragging=0;thisNote.whichNote=null;thisNote.photo_div=imageDiv;thisNote.photo_div.onmouseover=function(){EL.onmouseover();};thisNote.photo_div.onmouseout=function(e){var s=_get_event_src(e);if(window.buttonAction){return;}thisNote.hide_tim=setTimeout("_ge('pNts').EXT.hideIt('EXT.photo_div.onmouseout');",300);};thisNote.p_id=imageId;thisNote.nTD=_ge('nTD');thisNote.nTD.innerHTML='<table id="nTab"><tr><td><img class="nCrn" src="/images/n_yellow_tl.gif"></td><td class="frmY"></td><td><img class="nCrn" src="/images/n_yellow_tr.gif"></td></tr><tr><td class="frmY"></td><td class="frmY" style="padding:3px"><span id="nText"></span><form id="notes_text_form"><textarea onkeydown="limit(this, 300)" onkeyup="nPlaceText(); scaleHeight(this);" id="nTextArea" wrap="virtual"></textarea></form></td><td class="frmY"></td></tr><tr><td><img class="nCrn" src="/images/n_yellow_bl.gif"></td><td class="frmY"></td><td><img class="nCrn" src="/images/n_yellow_br.gif"></td></tr></table><form id="nBF"><input type="button" class="sub" value="'+((getCookie('lang')=='pl')?'Zapisz':'Save')+'" onclick="_ge(\''+EL.id+'\').EXT.saveEdit(); this.blur();" style="margin:5px 5px 0 0;" onmouseover="this.className=\'sub1\';" onmouseout="this.className=\'sub\'"/><input type="button" class="sub" value="'+((getCookie('lang')=='pl')?'Powróć':'Cancel')+'" onclick="_ge(\''+EL.id+'\').EXT.cancelEdit(); this.blur();" style="margin:5px 5px 0 0;" onmouseover="this.className=\'sub1\';" onmouseout="this.className=\'sub\'"/><input type="button" class="subr" value="'+((getCookie('lang')=='pl')?'Usuń':'Delete')+'" id="removeNote_button" onclick="_ge(\''+EL.id+'\').EXT.removeNote(); this.blur();" style="margin:5px 5px 0 0;" onmouseover="this.className=\'subr1\';" onmouseout="this.className=\'subr\'"></form><div id="temp_div" style="visibility:hidden;"></div>';thisNote.nTab=_ge('nTab');thisNote.nText=_ge('nText');thisNote.nTextArea=_ge('nTextArea');if(!document.all||navigator.userAgent.indexOf('Opera')!= -1){thisNote.nTextArea.style.height='60px';}thisNote.notes_text_form=_ge('notes_text_form');thisNote.nBF=_ge('nBF');thisNote.removeNote_button=_ge('removeNote_button');thisNote.nTD.style.zIndex='1000';thisNote.nTD.style.display='none';thisNote.nTD.style.width='200px';thisNote.nTD.style.position='relative';window.temp_div=_ge('temp_div');temp_div.style.width=thisNote.nTextArea.style.width;thisNote.nTab.onmouseover=function(){if(thisNote.editing){return;}if(thisNote.whichNote){clearTimeout(thisNote.whichNote.EXT.hide_timmy);}};thisNote.nTab.onmouseout=function(){if(thisNote.editing){return;}if(thisNote.whichNote){thisNote.whichNote.EXT.box_div.onmouseout();}};thisNote.nTab.onmouseup=function(e){if(thisNote.editing){return;}var s=_get_event_src(e);if(s&&isLink(s)){return;}if(thisNote.whichNote&&thisNote.whichNote.EXT.can_edit){thisNote.whichNote.EXT.editing=1;thisNote.whichNote.EXT.switchDisplay();thisNote.editOne(thisNote.whichNote);}};if(!shadowDiv){makeShadow(_ge('shade'));}for(var i=0;i<EL.childNodes.length;i++){if(EL.childNodes[i].className=='pn'){EL.childNodes[i].EXT.papa=EL;}}EL.onmouseover=function(){clearTimeout(this.EXT.hide_tim);if(window.buttonAction){return;}this.EXT.isOver=1;this.EXT.switchDisplay();};this.nDelay=function(){thisNote.hide_tim=setTimeout("_ge('pNts').EXT.hideIt('nDelay');",2000);};this.hideIt=function(mouseOut){clearTimeout(thisNote.hide_tim);if(thisNote.editing||thisNote.dragging){return;}thisNote.isOver=0;thisNote.hideOne('hideIt '+mouseOut);thisNote.switchDisplay();};this.colorizeNote=function(color){var lastColor=(thisNote.nLastColor)?thisNote.nLastColor:'yellow';if(lastColor==color){return;}thisNote.nTextArea.style.backgroundColor=thisNote.colorSet[color];var tds=EL.getElementsByTagName('TD');for(var i=0;i<tds.length;i++){if(tds[i].className=='frmY'){tds[i].style.backgroundColor=thisNote.colorSet[color];}}var imageTab=EL.getElementsByTagName('IMG');for(var i=0;i<imageTab.length;i++){if(imageTab[i].src){imageTab[i].src=imageTab[i].src.replace(lastColor,color);}}thisNote.nLastColor=color;};this.showOne=function(objDiv){clearTimeout(thisNote.hide_tim);if(thisNote.whichNote){clearTimeout(thisNote.whichNote.EXT.hide_timmy);}if(thisNote.whichNote!=objDiv){thisNote.hideOne();}thisNote.colorizeNote(objDiv.EXT.use_color);var txt=objDiv.EXT.prepText();if(!objDiv.EXT.from_owner){txt+='  - <a href="/photos/'+objDiv.EXT.author+'"><span class="not">'+objDiv.EXT.authorName+'</span></a>';}thisNote.nText.innerHTML=txt;thisNote.whichNote=objDiv;if(thisNote.editing){thisNote.nText.style.display='none';thisNote.notes_text_form.style.display='block';thisNote.nBF.style.display='block';if(thisNote.whichNote.id=='pn_temp'){thisNote.removeNote_button.style.display='none';}else{thisNote.removeNote_button.style.display='inline';}if(objDiv!=thisNote.whichNote||thisNote.nTextArea.value==''){thisNote.nTextArea.value=objDiv.EXT.saved_txt;scaleHeight(thisNote.nTextArea);}}else{thisNote.nText.style.display='inline';thisNote.notes_text_form.style.display='none';thisNote.nBF.style.display='none';}thisNote.nTD.style.display='block';setShadeHeight(thisNote.nTab);setShadeWidth(thisNote.nTab);shadowDiv.style.display='block';thisNote.nPlaceText();if(thisNote.editing){thisNote.nTextArea.focus();thisNote.nTextArea.select();}};this.nPlaceText=function(posX,posY){if(posX&&posY){var nx=posX;var ny=posY+thisNote.whichNote.EXT.getNoteHeight()+5;}else{if(thisNote.editing){var spaceHeight=0;var spaceWidth=200;}else{var spaceHeight=100;var spaceWidth=200;}var nx=_pi(thisNote.whichNote.style.left);var ny=_pi(thisNote.whichNote.style.top)+thisNote.whichNote.EXT.getNoteHeight()+5;if(ny+thisNote.nTD.offsetHeight>thisNote.getImageHeight()+spaceHeight){ny=_pi(thisNote.whichNote.style.top)-thisNote.nTD.offsetHeight-10;if(document.all&&navigator.userAgent.indexOf('Opera')== -1){ny+=15;}}if(ny< -spaceWidth){ny=_pi(thisNote.whichNote.style.top)+thisNote.whichNote.EXT.getNoteHeight()+5;}}thisNote.nTD.style.left=nx+'px';thisNote.nTD.style.top=ny+'px';setShadeX(nx);setShadeY(ny);};this.hideOne=function(obj){thisNote.nTD.style.display='none';shadowDiv.style.display='none';if(thisNote.whichNote){thisNote.whichNote.EXT.isOver=0;thisNote.whichNote.EXT.switchDisplay();}};this.dragOne=function(){thisNote.dragging=1;window.notesEdit=1;};this.editOne=function(objDiv){disableButtons('ops');thisNote.editing=1;thisNote.dragging=0;window.notesEdit=1;thisNote.showOne(objDiv);};this.hideNotesText=function(){thisNote.nTD.style.display='none';shadowDiv.style.display='none';};this.addNote=function(){if(thisNote.editing){if(getCookie('lang')=='pl'){alert('Tylko jedna notatka na raz.');}else{alert('You can only add one note at a time.');}return;}thisNote.clearTextArea();EL.onmouseover();if(getCookie('lang')=='pl'){initText='Dodaj swoją notatkę.';}else{initText='Add your note here.';}var newNote=thisNote.createNote('temp',30,30,80,80,initText,1,isPhotoAuthor);newNote.EXT.startEdit();thisNote.editOne(newNote);};this.createNote=function(tempId,left,top,width,height,initText,canEdit,isAuthor,autorName,autor){var newDiv=document.createElement('DIV');newDiv.className='pn';newDiv.id='pn_'+tempId;newDiv.style.left=(left+1)+'px';newDiv.style.top=(top+1)+'px';newDiv.innerHTML='<div class="pnBox"><div class="pnBox1"><div class="pnBox2"><div style="width:'+(width-4)+'px; height:'+(height-4)+'px;"></div></div></div></div><div class="pnTxt"></div>';EL.appendChild(newDiv);_dec(newDiv,tempId,canEdit,isAuthor,autorName,autor,initText);newDiv.EXT.papa=EL;return newDiv;};this.removeNote=function(){thisNote.whichNote.EXT.stopEditing(0);thisNote.editing=0;thisNote.hideOne();thisNote.clearTextArea();var tab={noteId:thisNote.whichNote.EXT.note_id,imageId:thisNote.p_id};positionProgress(((getCookie('lang')=='en')?'Removing note':'Usuwam notatkę'));x_removeNote(tab);};this.cancelEdit=function(){enableButtons('ops');thisNote.whichNote.EXT.stopEditing(1);thisNote.editing=0;window.notesEdit=0;thisNote.hideOne();thisNote.clearTextArea();if(thisNote.whichNote.id=='pn_temp'){EL.removeChild(thisNote.whichNote);}};this.clearTextArea=function(){thisNote.nTextArea.value='';};this.saveEdit=function(){if(thisNote.nTextArea.value==''){thisNote.nTextArea.focus();thisNote.nTextArea.select();return;}thisNote.whichNote.EXT.stopEditing(0);thisNote.editing=0;thisNote.hideOne();if(thisNote.whichNote.id=='pn_temp'){var tab={imageId:thisNote.p_id,pLeft:thisNote.whichNote.EXT.get_note_x()+1,pTop:thisNote.whichNote.EXT.get_note_y()+1,width:(thisNote.whichNote.EXT.getNoteWidth())-4,height:(thisNote.whichNote.EXT.getNoteHeight())-4,note:thisNote.nTextArea.value};positionProgress(((getCookie('lang')=='en')?'Adding note':'Dodaję notatkę'));x_addNote(tab);EL.removeChild(thisNote.whichNote);}else{var tab={id:thisNote.whichNote.EXT.note_id,imageId:thisNote.p_id,pLeft:thisNote.whichNote.EXT.get_note_x()+1,pTop:thisNote.whichNote.EXT.get_note_y()+1,width:(thisNote.whichNote.EXT.getNoteWidth())-4,height:(thisNote.whichNote.EXT.getNoteHeight())-4,note:thisNote.nTextArea.value};positionProgress(((getCookie('lang')=='en')?'Updating note':'Zapisuję notatkę'));x_updateNote(tab);}thisNote.clearTextArea();};this.getImageWidth=function(){return thisNote.photo_div.childNodes[0].width;};this.getImageHeight=function(){return thisNote.photo_div.childNodes[0].height;};this.switchDisplay=function(){if(thisNote.isOver){EL.style.visibility='visible';}else{EL.style.visibility='hidden';}};};var dec_pn=function(args){var EL=args[0];EL.EXT=new PhotoNoteCnt(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);return EL;};PhotoNoteCnt=function(el,noteId,canEdit,fromOwner,autorName,autor,savedText){var EL=this.EL=el;var EXT=this;EXT.note_id=noteId;EXT.can_edit=canEdit;EXT.authorName=autorName;EXT.author=autor;EXT.from_owner=fromOwner;EXT.use_color=(EXT.from_owner)?'yellow':'blue';EXT.isOver=0;EXT.editing=0;EXT.isDragging=0;EXT.resize_box_size=8;EXT.last_rendered_txt='';EXT.box_div=EL.childNodes[0];EXT.innermost_div=EXT.box_div.childNodes[0].childNodes[0].childNodes[0];if(document.all&& !window.opera){EXT.innermost_div.style.backgroundColor='#fff';EXT.innermost_div.style.filter='alpha(opacity:0)';}EXT.text_div=EL.childNodes[1];EXT.saved_txt=savedText;EXT.saved_x=_pi(EL.style.left);EXT.saved_y=_pi(EL.style.top);EXT.saved_w=_pi(EXT.innermost_div.style.width);EXT.saved_h=_pi(EXT.innermost_div.style.height);EL.appendChild(EXT.makeResize('nw'));EL.appendChild(EXT.makeResize('ne'));EL.appendChild(EXT.makeResize('sw'));EL.appendChild(EXT.makeResize('se'));EXT.box_div.onmouseover=EXT.onmouseover;EXT.box_div.onmouseout=EXT.onmouseout;if(EXT.can_edit){EXT.box_div.onmousedown=EXT.onmousedown;EXT.box_div.style.cursor=(document.all&& !window.opera)?'hand':'pointer';}else{EXT.box_div.style.cursor='default';}};PhotoNoteCnt.prototype.makeResize=function(resizeType){var EL=this.EL;var EXT=this;var ref='resize_'+resizeType+'_div';EXT[ref]=document.createElement('DIV');EXT[ref].style.position='absolute';EXT[ref].style.display='none';EXT[ref].style.cursor=resizeType+'-resize';EXT[ref].style.top=(resizeType=='ne'||resizeType=='nw')?'0px':(EXT.getNoteHeight()-EXT.resize_box_size)+'px';EXT[ref].style.left=(resizeType=='sw'||resizeType=='nw')?'0px':(EXT.getNoteWidth()-EXT.resize_box_size)+'px';EXT[ref].style.backgroundColor='#fff';EXT[ref].innerHTML='<div style="border:1px solid black;"><div style="width:'+(EXT.resize_box_size-2)+'px; height:'+(EXT.resize_box_size-2)+'px; background-color:#fff; font-size:1px"></div></div>';EXT[ref].onmousedown=function(e){e||(e=window.event);EXT.dragResize(e,resizeType);};EXT[ref].EL=EL;return EXT[ref];};PhotoNoteCnt.prototype.prepText=function(){var EL=this.EL;var EXT=this;var txt=EXT.saved_txt;if(EXT.last_saved_txt!=EXT.saved_txt){txt=txt.trim().nl2br();EXT.last_saved_txt=EXT.saved_txt;EXT.last_rendered_txt=txt;}return EXT.last_rendered_txt;};PhotoNoteCnt.prototype.dragResize=function(e,direction){var EL=this.EL;var EXT=this;e||(e=window.event);var ref='resize_'+direction+'_div';var resizeDiv=EXT[ref];EXT.papa.EXT.dragOne();_disable_select();resizeDiv.lastClientX=e.clientX;resizeDiv.lastClientY=e.clientY;if(direction=='se'){var x=_pi(resizeDiv.style.left);var y=_pi(resizeDiv.style.top);var minX=e.clientX-x+EXT.resize_box_size;var maxX=minX+EXT.papa.EXT.getImageWidth()-_pi(EL.style.left)-(EXT.resize_box_size*2)+1;var minY=e.clientY-y+EXT.resize_box_size;var maxY=minY+EXT.papa.EXT.getImageHeight()-_pi(EL.style.top)-(EXT.resize_box_size*2)+1;}else{if(direction=='sw'){var x=_pi(EL.style.left);var y=_pi(resizeDiv.style.top);var minX=e.clientX-x+1;var maxX=minX+x+EXT.getNoteWidth()-(EXT.resize_box_size*2)-1;var minY=e.clientY-y+EXT.resize_box_size;var maxY=minY+EXT.papa.EXT.getImageHeight()-_pi(EL.style.top)-(EXT.resize_box_size*2)+1;}else{if(direction=='nw'){var x=_pi(EL.style.left);var y=_pi(EL.style.top);var minX=e.clientX-x+1;var maxX=minX+x+EXT.getNoteWidth()-(EXT.resize_box_size*2)-1;var minY=e.clientY-y+1;var maxY=minY+y+EXT.getNoteHeight()-(EXT.resize_box_size*2)-1;}else{if(direction=='ne'){var x=_pi(resizeDiv.style.left);var y=_pi(EL.style.top);var minX=e.clientX-x+EXT.resize_box_size;var maxX=minX+EXT.papa.EXT.getImageWidth()-_pi(EL.style.left)-(EXT.resize_box_size*2)+1;var minY=e.clientY-y+1;var maxY=minY+y+EXT.getNoteHeight()-(EXT.resize_box_size*2)-1;}}}}EXT.isDragging=1;EXT.switchDisplay();document.dragee=resizeDiv;document.onmouseup=function(e){if(document.dragee){document.dragee.EL.EXT.stopDragResize();}document.dragee=null;};document.onmousemove=function(e){e||(e=window.event);if(EXT.papa.EXT.hide_while_dragging){EXT.papa.EXT.hideNotesText();}var ex=Math.min(Math.max(e.clientX,minX),maxX);var ey=Math.min(Math.max(e.clientY,minY),maxY);if(direction=='se'){var x=_pi(resizeDiv.style.left);var y=_pi(resizeDiv.style.top);var nx=x+(ex-resizeDiv.lastClientX);var ny=y+(ey-resizeDiv.lastClientY);resizeDiv.style.left=nx+'px';resizeDiv.style.top=ny+'px';EXT.innermost_div.style.width=(_pi(resizeDiv.style.left)+EXT.resize_box_size-4)+'px';EXT.innermost_div.style.height=(_pi(resizeDiv.style.top)+EXT.resize_box_size-4)+'px';EXT['resize_ne_div'].style.left=resizeDiv.style.left;EXT['resize_sw_div'].style.top=resizeDiv.style.top;}else{if(direction=='sw'){var x=_pi(EL.style.left);var y=_pi(resizeDiv.style.top);var nx=x+(ex-resizeDiv.lastClientX);var ny=y+(ey-resizeDiv.lastClientY);EL.style.left=nx+'px';resizeDiv.style.top=ny+'px';EXT.innermost_div.style.width=(_pi(EXT.innermost_div.style.width)+x-nx)+'px';EXT.innermost_div.style.height=(_pi(resizeDiv.style.top)+EXT.resize_box_size-4)+'px';EXT['resize_ne_div'].style.left=EXT['resize_se_div'].style.left=(_pi(EXT.innermost_div.style.width)-EXT.resize_box_size+4)+'px';EXT['resize_se_div'].style.top=resizeDiv.style.top;}else{if(direction=='nw'){var x=_pi(EL.style.left);var y=_pi(EL.style.top);var nx=x+(ex-resizeDiv.lastClientX);var ny=y+(ey-resizeDiv.lastClientY);EL.style.left=nx+'px';EL.style.top=ny+'px';EXT.innermost_div.style.width=(_pi(EXT.innermost_div.style.width)+x-nx)+'px';EXT.innermost_div.style.height=(_pi(EXT.innermost_div.style.height)+y-ny)+'px';EXT['resize_sw_div'].style.left=resizeDiv.style.left;EXT['resize_ne_div'].style.top=resizeDiv.style.top;EXT['resize_se_div'].style.top=EXT['resize_sw_div'].style.top=(_pi(EXT.innermost_div.style.height)-EXT.resize_box_size+4)+'px';EXT['resize_se_div'].style.left=EXT['resize_ne_div'].style.left=(_pi(EXT.innermost_div.style.width)-EXT.resize_box_size+4)+'px';}else{if(direction=='ne'){var x=_pi(resizeDiv.style.left);var y=_pi(EL.style.top);var nx=x+(ex-resizeDiv.lastClientX);var ny=y+(ey-resizeDiv.lastClientY);resizeDiv.style.left=nx+'px';EL.style.top=ny+'px';EXT.innermost_div.style.width=(_pi(resizeDiv.style.left)+EXT.resize_box_size-4)+'px';EXT.innermost_div.style.height=(_pi(EXT.innermost_div.style.height)+y-ny)+'px';EXT['resize_se_div'].style.left=resizeDiv.style.left;EXT['resize_se_div'].style.top=EXT['resize_sw_div'].style.top=(_pi(EXT.innermost_div.style.height)-EXT.resize_box_size+4)+'px';}}}}resizeDiv.lastClientX=ex;resizeDiv.lastClientY=ey;if(!EXT.papa.EXT.hide_while_dragging){EXT.papa.EXT.nPlaceText();}};};PhotoNoteCnt.prototype.stopDragResize=function(){var EL=this.EL;var EXT=this;_enable_select();if(!EXT.isDragging){return;}document.onmousemove=null;EXT.papa.EXT.editOne(EL);EXT.isDragging=0;EXT.switchDisplay();};PhotoNoteCnt.prototype.showResizeDivs=function(){var EL=this.EL;var EXT=this;EXT.resize_nw_div.style.display=EXT.resize_ne_div.style.display=EXT.resize_sw_div.style.display=EXT.resize_se_div.style.display='block';};PhotoNoteCnt.prototype.hideResizeDivs=function(){var EL=this.EL;var EXT=this;EXT.resize_nw_div.style.display=EXT.resize_ne_div.style.display=EXT.resize_sw_div.style.display=EXT.resize_se_div.style.display='none';};PhotoNoteCnt.prototype.getNoteWidth=function(){var EL=this.EL;var EXT=this;return _pi(EXT.innermost_div.style.width)+4;};PhotoNoteCnt.prototype.getNoteHeight=function(){var EL=this.EL;var EXT=this;return _pi(EXT.innermost_div.style.height)+4;};PhotoNoteCnt.prototype.get_note_x=function(){var EL=this.EL;var EXT=this;return _pi(EL.style.left)-1;};PhotoNoteCnt.prototype.get_note_y=function(){var EL=this.EL;var EXT=this;return _pi(EL.style.top)-1;};PhotoNoteCnt.prototype.onmouseover=function(){var EL=this.parentNode;var EXT=EL.EXT;if(EXT.papa.EXT.editing||EXT.papa.EXT.dragging){return;}EXT.isOver=1;EXT.switchDisplay();EXT.papa.EXT.showOne(EL);};PhotoNoteCnt.prototype.onmouseout=function(){var EL=this.parentNode;var EXT=EL.EXT;if(EL.id=='pn_temp'){return;}EXT.hide_timmy=setTimeout("_ge('"+EL.id+"').EXT.switchHide('PhotoNoteCnt.prototype.onmouseout');",10);};PhotoNoteCnt.prototype.switchHide=function(){var EL=this.EL;var EXT=this;if(EXT.papa.EXT.editing||EXT.papa.EXT.dragging){return;}EXT.isOver=0;EXT.switchDisplay();EXT.papa.EXT.hideOne();};PhotoNoteCnt.prototype.startEdit=function(){var EL=this.EL;var EXT=this;if(EXT.editing){return;}EXT.isOver=1;EXT.editing=1;EXT.switchDisplay();};PhotoNoteCnt.prototype.stopEditing=function(noteContent4){var EL=this.EL;var EXT=this;EXT.editing=0;if(noteContent4){EL.style.left=EXT.saved_x+'px';EL.style.top=EXT.saved_y+'px';EXT.innermost_div.style.width=EXT.saved_w+'px';EXT.innermost_div.style.height=EXT.saved_h+'px';EXT.resize_nw_div.style.top=EXT.resize_ne_div.style.top='0px';EXT.resize_sw_div.style.top=EXT.resize_se_div.style.top=(EXT.getNoteHeight()-EXT.resize_box_size)+'px';EXT.resize_nw_div.style.left=EXT.resize_sw_div.style.left='0px';EXT.resize_ne_div.style.left=EXT.resize_se_div.style.left=(EXT.getNoteWidth()-EXT.resize_box_size)+'px';EXT.papa.EXT.showOne(EL);}EXT.switchDisplay();};PhotoNoteCnt.prototype.onmousedown=function(e){var EL=this.parentNode;var EXT=EL.EXT;e||(e=window.event);if(!EXT.papa.EXT.editing&& !EXT.papa.EXT.dragging){EXT.startEdit();}if((!EXT.papa.EXT.editing&& !EXT.papa.EXT.dragging)||EXT.papa.EXT.whichNote==EL){EXT.startDragging(e);}};PhotoNoteCnt.prototype.stopDragging=function(){var EL=this.EL;var EXT=this;_enable_select();if(!EXT.isDragging){return;}document.onmousemove=null;EXT.papa.EXT.editOne(EL);EXT.isDragging=0;EXT.switchDisplay();};PhotoNoteCnt.prototype.startDragging=function(e){var EL=this.EL;var EXT=this;e||(e=window.event);EXT.papa.EXT.dragOne();_disable_select();var x=_pi(EL.style.left);var y=_pi(EL.style.top);EL.lastClientX=e.clientX;EL.lastClientY=e.clientY;var minX=e.clientX-x+1;var maxX=minX+EXT.papa.EXT.getImageWidth()-EXT.getNoteWidth();var minY=e.clientY-y+1;var maxY=minY+EXT.papa.EXT.getImageHeight()-EXT.getNoteHeight();EXT.isDragging=1;EXT.switchDisplay();document.dragee=EL;document.onmouseup=function(e){if(document.dragee){document.dragee.EXT.stopDragging();}document.dragee=null;};document.onmousemove=function(e){e||(e=window.event);if(EXT.papa.EXT.hide_while_dragging){EXT.papa.EXT.hideNotesText();}var x=_pi(EL.style.left);var y=_pi(EL.style.top);var ex=Math.min(Math.max(e.clientX,minX),maxX);var ey=Math.min(Math.max(e.clientY,minY),maxY);var nx=x+(ex-EL.lastClientX);var ny=y+(ey-EL.lastClientY);EL.style.left=nx+'px';EL.style.top=ny+'px';EL.lastClientX=ex;EL.lastClientY=ey;if(!EXT.papa.EXT.hide_while_dragging){EXT.papa.EXT.nPlaceText();}};};PhotoNoteCnt.prototype.switchDisplay=function(){var EL=this.EL;var EXT=this;EXT.box_div.childNodes[0].style.borderStyle='solid';EXT.box_div.childNodes[0].childNodes[0].style.borderStyle='solid';EXT.box_div.style.left=EXT.box_div.style.top='0px';EXT.box_div.style.borderWidth='0';EXT.hideResizeDivs();if(EXT.editing){EXT.showResizeDivs();EXT.box_div.childNodes[0].childNodes[0].style.borderStyle='dashed';EXT.box_div.childNodes[0].style.borderStyle='dashed';}else{if(EXT.isOver){EXT.box_div.style.left=EXT.box_div.style.top='-1px';EXT.box_div.style.borderWidth='1px';}}};var isLink=function(el){var p=el;while(p){if(p.href){return 1;}p=p.parentNode;}return 0;}; 