function getComments(a){ImageAjaxActions.getComments(imageOwner,imageNumber,a,refreshComments)}function refreshComments(a){if(a!=null){document.getElementById("commentsDiv").innerHTML=a}}function showExtraEmoticons(){var a=document.getElementById("emoticonsExtra");if(a.style.display=="block"){hideDiv("emoticonsExtra");document.getElementById("moreEmots").src=openImg}else{showDiv("emoticonsExtra");document.getElementById("moreEmots").src=closeImg}}function removeComment(a,b){if(confirm(confirmRemoveComment)){RemoveImageCommentAction.removeComment(a,{callback:function(c){commentRemoved(c,b)}});setStatus(false,false,removeCommentWaitText)}}function commentRemoved(b,a){if(b){setStatus(true,false,removeCommentSuccessText);getComments(a)}else{setStatus(true,true,removeCommentFailText)}}function postComment(){MemberAjaxActions.needCaptchaForMsgSend(imageOwner,checkForCaptcha);document.getElementById("postComment").onclick=""}function checkForCaptcha(b){if(b){var a=document.getElementById("photoComment1");a.style.display="none";showCaptcha();document.getElementById("postComment").onclick=sendCaptcha}else{var c=document.getElementById("photoComment").value;AddImageCommentAction.addComment(imageOwner,imageNumber,c,"",commentPosted);hideDiv("commentDiv");setStatus(false,false,addCommentWaitText)}}function sendCaptcha(){var b=document.getElementById("photoComment").value;var a=document.getElementById("commentCaptchaResponse").value;AddImageCommentAction.addComment(imageOwner,imageNumber,b,a,commentPosted);setStatus(false,false,addCommentWaitText);hideDiv("commentDiv");document.getElementById("postComment").onclick=""}function commentPosted(d){if(d!=null){var c=d.substring(0,1);if(c==0){setStatus(true,false,d.substring(1))}else{setStatus(true,true,d.substring(1));if(d.substring(1)==noCaptchaText||d.substring(1)==captchaIncorrectText){showCaptcha();document.getElementById("postComment").onclick=sendCaptcha;showDiv("commentDiv");return}}getComments("first");var a=document.getElementById("photoComment1");var b=document.getElementById("photoComment2");b.innerHTML="";b.style.display="none";document.getElementById("postComment").onclick=postComment;document.getElementById("photoComment").value="";fillField(document.getElementById("photoComment"),typeCommentText);a.style.display="block"}else{setStatus(true,true,addCommentFailText);showDiv("commentDiv");document.getElementById("postComment").onclick=postComment}showDiv("activateComment")}function showCaptcha(){document.getElementById("emptyFlagcommentCaptchaResponse").value=0;var b=document.getElementById("photoComment2");var a='<table width="100%" border="0" cellpadding="0" cellspacing="5">';a=a+"<tr>";a=a+'<td width="110" align="right" valign="top">';a=a+"<h3>"+enterCodeText+"</h3>";a=a+"</td>";a=a+'<td width="210" align="left" valign="top" class="send_message_container_title">';a=a+'<input style="width:190px;" onkeypress="submitCaptcha(event.keyCode);" type="text" class="recipient" id="commentCaptchaResponse" value="'+typeCaptchaText+'" onblur="fillField(this,\''+typeCaptchaText+'\');" onfocus="clearField(this);" />';a=a+"</td>";a=a+"</tr>";a=a+"<tr>";a=a+'<td width="110" align="right" valign="top">&nbsp;</td>';a=a+'<td width="210" align="left" valign="top" class="send_message_container_title"><img src="'+captchaImg+"?param"+paramId+"="+paramId+'" width="200" height="100" border="1" style="border-color:#9999CC" /></td>';a=a+"</tr>";a=a+"</table>";b.innerHTML=a;b.style.display="block";paramId++}function submitCaptcha(a){if(a==Event.KEY_RETURN){sendCaptcha()}}function textCounter(){fieldlength=document.getElementById("photoComment").value.length;if(fieldlength>maxlimit){document.getElementById("photoComment").value=document.getElementById("photoComment").value.substring(0,maxlimit)}};
