function getItemTab(c,b,d){var a="/waynphotos.html?wci=comment&wce=gettab&tab="+encodeURIComponent(c)+"&photo="+b;if($("isVideo")){var e=$("isVideo").value;if(e==1){a=a+"&is_video=1"}}if(d){a+="&px="+d}callAjax(a,function(f){var g="lighttab_content_"+b;$(g).innerHTML=f;window.setTimeout("WAYN.Inputs.Init()",100)})}function itemCommentAbuse(b,a,c){reportAbusePost(a,c,b,"",document.location)}function itemSaveComment(f,j,e,h){var k;var d;var c;try{c="/waynphotos.html?wci=photo&wce=addcomment&photo_key="+f;e=parseInt(e);if(!isNaN(e)){c+="&reply_to="+e;d="comment_"+f+"_R"+e}else{d="comment_"+f}if($("feature_comment_checkbox_"+f)){var g=$("feature_comment_checkbox_"+f).checked;if(g){c=c+"&featured=1"}}if($("isVideo")){var b=$("isVideo").value;if(b==1){c=c+"&is_video=1"}}if($(d)){k=$(d).value}else{return}var a=false;if(isCommentValid(k)){var l=new Ajax.Request(c,{onSuccess:function(q){switch(q.responseText){case"-1":msgBox("warning","Sorry, there was an error processing your request.\nPlease try again later.");break;case"-2":document.location.href="/waynsplash.html?wci=login&url="+encodeURIComponent(document.location.href);break;case"-3":msgBox("warning","Sorry, the requested photo cannot be found.");break;case"-4":msgBox("warning","This member has disabled rates and comments for his photos.");break;case"-5":msgBox("warning","This member has disabled rates and comments for her photos.");break;case"-99":msgBox("warning","You cannot post the same comment more than 3 times per day.");break;case"-6":a=true;break;default:var p=q.responseText.split(",");var o="comments_tab_"+f;var n=$(o);if(-1==n.className.indexOf("lightTabActive")){checklighttab(n,f)}chengeCounterLightTab(f,n,0,p[3],0);var m="top_rates_number_"+f;if(0==p[2]){$(m).innerHTML="";$("top_rates_tab_"+f).style.visibility="hidden"}else{$(m).innerHTML="("+p[2]+")"}break}},onFailure:function(m){msgBox("warning","Sorry, there was an error processing your request.<br>Please try again later.")},method:"post",parameters:"comment="+encodeURIComponent(k),asynchronous:false});if(a==true){window.open("/wayncredits.html?wci=purchase&url="+encodeURIComponent(document.location.href)+"&cost=10","_blank")}}else{if(!h){msgBox("warning","Add comment for this photo!")}}}catch(i){}}function itemCommentRemove(a,b,c){deleteComment(b,a,true,c)}function itemRate(e,c,f,g,b,a){var d=$("sendButtonActive_"+c);if(d){d.style.display="none"}d=$("sendButtonDisabled_"+c);if(d){d.style.display="block"}d=$("disabledSendButton_"+c);if(d){d.style.cursor="default"}ratePhoto(e,c,true,f,g,b,a)}function itemSaveReply(a,d,c){try{itemSaveComment(a,c,d)}catch(b){}}function ratePhoto(l,g,d,j,h,e,k){myDefaultPhotoRate=l;var f;var c="/waynphotos.html?wci=photo&wce=rate&photo_key="+g+"&value="+l;if(k){c+="&showbox=1"}if(6==l){if("undefined"===typeof(k)){c+="&tck="+14685}else{c+="&tck="+14684}}if(!isCommentValid(h)||l=="Add comment to this photo:"){h=""}if(!isNaN(e)){c+="&replyto="+e}if($("feature_comment_checkbox_"+g)){var i=$("feature_comment_checkbox_"+g).checked;if(i){c=c+"&featured=1"}}if($("isVideo")){var b=$("isVideo").value;if(b==1){c=c+"&is_video=1"}}var a=false;var m=new Ajax.Request(c,{onSuccess:function(s){switch(s.responseText){case"-1":msgBox("warning","Sorry, there was an error processing your request.\nPlease try again later.");break;case"-2":if(d){document.location.href="/waynsplash.html?wci=login&url="+encodeURIComponent(document.location.href)}else{document.location.href="/waynsplash.html?wci=login&url="+encodeURIComponent(document.location.href)}break;case"-3":msgBox("warning","Sorry, the requested photo cannot be found.");break;case"-4":msgBox("warning","This member has disabled rates and comments for his photos.");break;case"-5":msgBox("warning","This member has disabled rates and comments for her photos.");break;case"-6":a=true;break;default:if("-99"==s.responseText){msgBox("warning","You cannot post the same comment more than 3 times per day.")}var r=s.responseText.split(",");var q;var p;var n;if(d){if(6==l){q="top_rates_tab_"+g;p=document.getElementById(q);p.style.visibility="visible";try{if(-1==p.className.indexOf("lightTabActive")){checklighttab(p,g)}chengeCounterLightTab(g,q,0,r[2],0);n="comments_number_"+g;if(0==r[3]){$(n).innerHTML=""}else{$(n).innerHTML="("+r[3]+")"}}catch(o){}}else{q="comments_tab_"+g;p=document.getElementById(q);if(-1==p.className.indexOf("lightTabActive")){checklighttab(p,g)}if(h!=""){chengeCounterLightTab(g,q,0,r[3],0)}else{chengeCounterLightTab(g,q,0,r[3],0)}n="top_rates_number_"+g;if(0==r[2]){$(n).innerHTML="";$("top_rates_tab_"+g).style.visibility="hidden"}else{$(n).innerHTML="("+r[2]+")"}}if(r[0]>0){$("overall_rate_"+g).innerHTML=(isNaN(r[0])?0:r[0])}}}if(6==l){refreshMessageCount()}},onFailure:function(n){msgBox("warning","Sorry, there was an error processing your request.<br>Please try again later.")},method:"post",parameters:"comment="+encodeURIComponent(h),asynchronous:false});if(a==true){window.open("/wayncredits.html?wci=purchase&url="+encodeURIComponent(document.location.href)+"&cost=10","_blank")}}function isCommentValid(a){if(!a){return false}if(a.stripAllWhite()!=""&&a.length>=2){return true}else{return false}}var featureCommentViewHint;function featureCommentShowHint(a){window.clearTimeout(featureCommentViewHint);$("feature_comment_hint_"+a).show()}function featureCommentHideHint(b){var a="feature_comment_hint_"+b;featureCommentViewHint=setTimeout("$("+a+").hide();",300)}var topRateBoxPopup;function itemTopRateBox(b,f,h){var c="/waynphotos.html?wci=topratebox&tck=14683&item="+b+"&page="+f;var e;var d=$("topRateBox");if($("isVideo")){var g=$("isVideo").value;if(1==g){c+="&is_video=1"}}var a=new Ajax.Request(c,{onSuccess:function(i){d.innerHTML=i.responseText},onFailure:function(i){},method:"post",parameters:"comment="+encodeURIComponent(h)});topRateBoxPopup=new WAYN.Popup(d,false,true,false,true)}function closeTopRateBox(){try{$("topRateBox").close();$("topRateBox").innerHTML=""}catch(a){}}function deleteComment(f,c,b,g){var e="is_featured_"+f;if($(e)){featured=$(e).value}else{featured=0}var d="/waynphotos.html?wci=photo&wce=deletecomment&photo_key="+c+"&pc_key="+f+"&featured="+featured;if($("isVideo")){var h=$("isVideo").value;if(h==1){d=d+"&is_video=1"}}var a=new Ajax.Request(d,{onSuccess:function(i){if(i.responseText=="-1"){msgBox("error","Sorry, there was an error processing your request.\nPlease try again later.",null,null," ")}else{if(!b){commentsStrip(1,c)}else{chengeCounterLightTab(c,"comments_tab_"+c,-1,undefined,0)}}},onFailure:function(i){msgBox("error","Sorry, there was an error processing your request.\nPlease try again later.",null,null," ")},method:"get"})};
