function reportAbusePost(e,a,c,b,d){msgBox("querry","Are you sure?<br><br>Every message reported is checked by the abuse department.<br>Persistent false reports could result in your membership being suspended.<br><br>Remember - Not liking or agreeing with a message does NOT make it abusive!",function(){var f="/wayn.html?wci=reportabuse&source=photo_comments&member_key="+e+"&pc_key="+a+"&photo_key="+c+(b?"&wcmenu="+b:"");if(d){f+="&pageURL="+encodeURIComponent(d)}document.location=f},function(){return false}," ")}function reportAbusePhoto(b,d,a,c){msgBox("querry","Are you sure?<br><br>Photos reported as abusive will be checked.<br>Persistent abusive reports that are deemed inappropriate could result in your membership being suspended.<br><br>Remember, if you do not like a photo does NOT mean it is abusive.",function(){var e="/wayn.html?wci=reportabuse&source=photo&member_key="+d+"&photo_key="+b+(a?"&wcmenu="+a:"");if(c){e+="&pageURL="+encodeURIComponent(c)}document.location=e},function(){return false}," ")}function photoFullScreen(a){$("topLevelPhoto").parentNode.style.display="block";$("topLevelPhoto").src=a}function fitPhoto(a){a.style.left=(getScreenWidth()-a.width)/2+"px";a.style.top=(getScreenHeight()-a.height)/2+"px"}function resizePhoto(){var a=$("photoPreview");if(a){a.style.width=(parseInt(a.width)>468?"468px":"auto")}}function setMaxWidth(a){if(parseInt(a.width)!=0){a.style.width=(parseInt(a.width)>540?"540px":"auto")}}function changePrivacy(c,b){var a=new Ajax.Request("/waynphotos.html?wci=photo&wce=changeprivacy&photo_key="+b+"&privacy="+c,{onSuccess:function(d){switch(d.responseText){case"0":setMessage("Sorry, there was an error processing your request.\nPlease try again later.","privacyMsg");break;case"1":setMessage("Privacy changed.","privacyMsg");break;case"2":setMessage("Sorry, you can set privacy only for your own photo.","privacyMsg");break;case"3":setMessage("Sorry, we could not fing photo requested.","privacyMsg");break}},onFailure:function(d){msgBox("warning","Sorry, there was an error processing your request.<br>Please try again later.")},method:"get"})}function AddReply(c,b){if($("textArea_"+c).value!=""){var d=$("textArea_"+c).value;var a=new Ajax.Request("/waynphotos.html?wci=photo&wce=addcomment&photo_key="+b+"&reply_to="+c,{onSuccess:function(e){switch(e.responseText){case"-1":msgBox("warning","Sorry, there was an error processing your request.<br>Please try again later.");break;case"-2":location.href="/waynsplash.html?wci=login";break;case"-3":msgBox("warning","Sorry, the requested photo cannot be found.");break;default:commentsStrip(1,b);break}},onFailure:function(e){msgBox("warning","Sorry, there was an error processing your request.<br>Please try again later.")},method:"post",parameters:"comment="+encodeURIComponent(d)})}else{msgBox("warning","You cannot add an empty comment!")}}function replyComment(b){try{if(!b){return}if($("RepRow"+b).style.display=="block"){$("RepRow"+b).style.display="none"}else{$("RepRow"+b).style.display="block"}$("field"+b).focus()}catch(a){}}function changeTitle(){var a;var b;var d;a=document.formdata.owner.value;b=document.formdata.notes.value;d=a+" Photo On WAYN";if(b.length>0){var c=/<br>/gi;b=b.replace(c," ");d+=" -- "+b}else{if(document.formdata.loc_country.value.length>0){b=document.formdata.loc_country.value+", "+document.formdata.loc_region.value+", "+document.formdata.loc_place.value;d+=" -- "+b}}document.title=d}function thumbsStrip(c,a){$("photoThumbs").innerHTML='<div align="center" valign="middle">Please wait...</div>';tabXMLHTTP=newXMLobject();var b="/waynphotos.html?wci=photo&wce=thumbs&thumbspage="+c+"&"+a;tabXMLHTTP.open("GET",b,true);tabXMLHTTP.send(null);tabXMLHTTP.onreadystatechange=thumbsStripRespond}function thumbsStripRespond(){switch(tabXMLHTTP.readyState){case 2,3:break;case 4:responseXml=tabXMLHTTP.responseXML;try{for(i=responseXml.firstChild;i!=null;i=i.nextSibling){for(j=i.firstChild;j!=null;j=j.nextSibling){$("photoThumbs").innerHTML=j.nodeValue}}}catch(a){}tabXMLHTTP=null;break}}var nextComments=false;function commentsStrip(e,a,b){if($("photoComments")){$("photoComments").innerHTML='<div align="center" valign="middle">Please wait...</div>'}if(replyKey){var d="/waynphotos.html?wci=photo&wce=comments&page="+e+"&photo_key="+a+"&reply_comment="+replyKey}else{var d="/waynphotos.html?wci=photo&wce=comments&page="+e+"&photo_key="+a}var c;c=new Date().getTime();d=d+"&time="+c;new Ajax.Request(d,{onSuccess:function(k){$("commentsubmitdiv").style.display="block";if(!b){$("commentTextArea").value=""}responseXml=k.responseXML;for(var g=responseXml.firstChild;g!=null;g=g.nextSibling){for(var f=g.firstChild;f!=null;f=f.nextSibling){if(f.nodeValue!=null&&f.nodeValue!=""){$("photoComments").innerHTML=f.nodeValue;f=f.nextSibling;$("photoCommentsPaging").innerHTML=f.nodeValue}}}$("comments_value").innerHTML=$("comments_value_hidden").value;if(replyKey>0){var h=$("textArea_"+replyKey);if(h){Element.scrollTo(h);h.focus()}}},method:"get"})}var photoKey=0;var replyKey=0;var locationLabel;function addToLocation(c,e,b){if(e==null){e=300}if(b==null){b=140}var f=$("hidlocationKey").value*1;var d=$("hidtripKey").value*1;var a=new Ajax.Request("/waynphotos.html?wci=photo&wce=addlocation&photo_key="+c+"&location="+f+"&trip_key="+d+"&noredirect=1",{onSuccess:function(l){try{if(l.responseText=="-1"){msgBox("warning","Sorry, there was an error processing your request.<br>Please try again later.")}else{if(d==0&&f==0){setMessage("<b>Destination has been removed from photo.</b>","photoInteractBoxDiv2");try{$("locationimg").src=appproxypath+"images/modern/icoPXphotoAddLocation.gif";$("locationtxt").innerHTML="Add destination"}catch(k){}}else{switch(l.responseText){case"1":setMessage("<b>Destination has been assigned to photo.</b>","photoInteractBoxDiv2");break;case"2":setMessage("<b>Destination has been changed.</b>","photoInteractBoxDiv2");break;case"3":setMessage("<b>Destination has not been changed.</b>","photoInteractBoxDiv2");break}try{$("locationimg").src=appproxypath+"images/modern/icoPXnoteEdit.gif";$("locationtxt").innerHTML="Change destination"}catch(k){}}$("photoInteractBoxDiv2").style.display="block";if($("photoInteractBoxDiv")!=null){$("photoInteractBoxDiv").style.display="none"}var h=$("flashcontent");h.style.display="none";h.innerHTML="";so=null;so=new SWFObject("/trips/triptree.swf?trip_key="+d+"&location_key="+f+"&width="+e+"&height="+b+"","mymovie",e,b,"8","#ffffff");so.addParam("flashVars","location_key="+f+"&trip_key="+d+"&w="+e+"&h="+b);so.write("flashcontent")}}catch(g){}},onFailure:function(g){msgBox("warning","Sorry, there was an error processing your request.<br>Please try again later.")},method:"get"});return false}var nextPhotoLink="";function resizeCover(b,e,a){if($(e)==null){return}$(e).style.width=b.width;$(e).style.height=b.height;if(a==true){var d=$("sharebar");if(d!=null){var c=b.width;if(c<300){c=300}d.style.width=c+"px"}}if($(e+"AppFilter")!=null){resizeCover(b,e+"AppFilter",a);if(!window.event){$(e+"AppFilter").style.marginLeft=(542-b.width)/2}}}var showWAYNsTimeoutID;function showWAYNs(d){var a;var c=/_0\.gif/g;var b=/_1\.gif/g;window.clearTimeout(showWAYNsTimeoutID);for(i=1;i<=5;i++){a=$("WAYN_"+i);if(a){if(i<=d){a.src=a.src.replace(c,"_1.gif")}else{a.src=a.src.replace(b,"_0.gif")}}}}function hideWAYNs(b){var a;window.clearTimeout(showWAYNsTimeoutID);a="showWAYNs("+myDefaultPhotoRate+")";showWAYNsTimeoutID=window.setTimeout(a,250)}function photoDonateCredits(b,c,a){var d=$("donate_credits").value;if(d>10){msgBox("warning","You can not donate more than 10 credits.");$("donate_credits").select();$("donate_credits").focus();return false}donateCredits(b,c,d,"p",a,"donate_container")}function setFlashLocation(a,b){$("hidtripKey").value=b;$("hidlocationKey").value=a}function thumbReplacePhoto(a){a.onerror="";a.src=a.src.replace("main/","thumbs/");var b=$("LightBoxLink");b.href=b.href.replace("main/","thumbs/")}function showEditNote2(){if($("edit_note_div")&&$("photo_note")){$("photo_note").style.display="none";$("edit_note_div").style.display="block"}}function savePhotoNote2(){if($("edit_note_div")&&$("photo_note")&&$("edit_note_textarea")){var d=$("edit_note_textarea");var c=$("photo_note");c.innerHTML="Please wait...";$("edit_note_div").style.display="none";$("photo_note").style.display="block";blankText=c.getAttribute("blankTEXT");d.setAttribute("state","2");var b=c.getAttribute("targetURL");var a=new Ajax.Request(b,{onSuccess:function(h){if(h.responseXML){var g=h.responseXML;for(var f=g.firstChild;f!=null;f=f.nextSibling){for(var e=f.firstChild;e!=null;e=e.nextSibling){if(e.nodeName=="out"){d.value=e.firstChild.nodeValue}if(e.nodeName=="error"){msgBox("warning",e.firstChild.nodeValue)}}}}else{if(h.responseText=="-1"){msgBox("warning","Sorry there was an error processing your request.<br>Please try again later")}}if(d.value==null||d.value==""){c.innerHTML=blankText}else{c.innerHTML=d.value}d.setAttribute("state","0")},onFailure:function(e){msgBox("warning","Sorry there was an error processing your request.<br>Please try again later");if(d.value==null||d.value==""){c.innerHTML=blankText}else{c.innerHTML=d.value}d.setAttribute("state","0")},parameters:"value="+encodeURIComponent(d.value),contentType:"application/x-www-form-urlencoded",method:"post"})}}function openTripEdit(a){var b=$("location_hint_"+a+"_key").value;var c=$("trip_key").value;if(c!=0){$("new_trip_form").style.display="none"}GetTripsByHint(1,b,c);$("trips_compo").style.display="block";$("trip_edit_lnk").style.display="none"}function doneTripEdit(b){var n=$("trip_key").value;var f=$$("input[name=trip]");var e;var h;var k;var m;var a;var g;var c;for(var d=0;d<f.length;d++){if(f[d].checked){e=f[d].value;found=true;break}}c="/waynphotos.html?wci=photo&wce=addtrip&photo_key="+b+"&trip_key="+e;if(e==0){h=$("new_trip_name").value;k=$("cal_StartDate").value;m=$("cal_EndDate").value;a=$("location_hint_"+b+"_key").value;if(""==h&&""==k&&""==m){$("trip_edit_lnk").style.display="inline";$("trips_compo").style.display="none";return false}else{if(""==h){msgBox("warning","Please enter a trip name.");return false}if(""==k){msgBox("warning","Please enter a Start Date");return false}if(""==m){msgBox("warning","Please enter a End Date");return false}if(a==""||a=="0"||a.length<3){new WAYN.Popup.AddUnknownDestination(a,function(p,o){$("location_hint_"+b+"_key").value=p},"onlytowns");return false}c+="&trip_name="+encodeURIComponent(h);c+="&tripStartDate="+encodeURIComponent(k);c+="&tripEndDate="+encodeURIComponent(m);c+="&hint="+encodeURIComponent(a);c+="&create=1"}}if(e!=n||e==0){var l=new Ajax.Request(c,{onSuccess:function(A){var y=A.responseXML;if(y){var x=y.documentElement.getAttribute("trip");var w=y.documentElement.getAttribute("tripname");var o="/waynphotos.html?wci=album&trip="+x;var I=y.documentElement.getAttribute("from");var z=y.documentElement.getAttribute("to");var v=y.documentElement.getAttribute("photokey");var G=y.documentElement.getElementsByTagName("location");if(G.length>0){var u=G[0];var t=u.getAttribute("key");var p=u.getAttribute("countryname");var E="/waynphotos.html?wci=album&trip="+x;var s=u.getAttribute("townkey");var D=u.getAttribute("citykey");var r=u.getAttribute("countrycode");var G=u.getElementsByTagName("flag");if(G.length>0){var H=G[0];var B=H.firstChild.data;var q=$("trip_key").value;var C=$("trip_link_"+q);if(!C){var C=document.createElement("a");C.className="linkBlueDefault";$("trip_link").appendChild(C)}C.href=o;C.innerHTML=w;C.id="trip_link_"+x;var F=$("trip_country_link");F.href=E;F.innerHTML=", "+p;B=B.replace(/href='.*?'/,"href='/waynphotos.html?wci=album&trip="+x+"' ");$("trip_flag_link").innerHTML=B;$("trip_date_from").innerHTML=I;$("trip_date_to").innerHTML=z;$("trip_key").value=x;$("trip_data").style.display="block";$("trip_key_"+v).value=x;$("location_hint_"+v+"_key").value=r+","+D+","+s;$("location_hint_"+v).value=p;WAYN.GetTripLocationsXML(x,UpdateLocationCompo)}}}},onFailure:function(o){msgBox("warning","Sorry there was an error processing your request.<br>Please try again later")},method:"get"})}$("trip_edit_lnk").style.display="inline";$("trips_compo").style.display="none"}function UpdateLocationCompo(m){if(m){var f=m.documentElement.getAttribute("key");var t=m.documentElement.getElementsByTagName("location");var h=m.documentElement.getElementsByTagName("flag");var b=m.documentElement.getAttribute("tripmainloc");var f=m.documentElement.getAttribute("key");if(t.length>0){var n=$("locations_container");n.innerHTML="";for(var x=0;x<t.length;x++){var g=t[x];var v=g.getAttribute("key");var w=g.getAttribute("countryname");var u=g.getAttribute("countrycode");var c=g.getAttribute("cityname");var y=g.getAttribute("citykey");var k=g.getAttribute("townname");var l=g.getAttribute("townkey");var z;var o;if(h[x]){z=h[x]}if(z){o=z.firstChild.data}var e=$("photo_key").value;var d=document.createElement("span");d.style.marginLeft="4px";d.innerHTML=o;var s=document.createElement("a");s.style.marginLeft="2px";s.className="linkBlueDefault";if(k){var r=k+", "+w}else{var r=w}if(b==v){var q=$("location_"+e);q.innerHTML="";var p=document.createElement("span");var a=document.createElement("a");a.className="linkBlueDefault";a.style.marginLeft="2px";a.innerHTML='<a class="linkBlueDefault" href="/waynphotos.html?wci=album&country='+u+"&city="+y+"&town="+l+'">'+r+"</a>";p.innerHTML=o;p.appendChild(a);q.appendChild(p);$("trip_key_"+e).value=f;$("location_hint_"+e+"_key").value=u+","+y+","+l;$("location_hint_"+e).value=r}s.innerHTML=r;s.href="javascript:setLocationHint("+e+",'"+u+"',"+y+","+l+",'"+k+"','"+w+"')";d.appendChild(s);n.appendChild(d)}}}}var tabCounter=0;function getPreviewThumbs(a,c,d){var b="/waynphotos.html?wci=photo&wce=GetPreviewThumbsXML&photo_key="+a+c+"&package_number="+d;callAjax(b,function(e){$("previewThumbs").innerHTML=e})};
