var pages=0;var default_text_comment_textarea="Write something...";function clear_textarea(a){var b=$("comment_text");if(a=="focus"){if(b.value==default_text_comment_textarea){b.value="";b.className="input"}}else{if(b.value.strip()==""){b.className="input textGrayDefault";b.value=default_text_comment_textarea}else{b.className="input"}}}function SaveComment(d,b,c,e,f,a){if(!a){a=0}if(a==0&&($("comment_text").value.strip()==""||$("comment_text").value.strip()==default_text_comment_textarea)){return}$("submittype").value=d;switch(d){case"savecomment":if(!validateForm(document.tmpForm,"comment_text|250|Comment Text")){return}break}s=$("s").getAttribute("v");$("comments_box_hidetextarea").value=1;UpdateBoxComments(b,$("submittype").value,a,0,c,f,encodeURIComponent($("comment_text").value))}var s=0;function UpdateBoxComments(i,e,b,h,k,j,f){if(e=="removecomment"){$("comments_box_hidetextarea").value=""}if(j){var a=null;try{if(!h){h=1}var g="/waynprofile.html?wci=content&wce=getbox";g=g+"&submittype="+e;g=g+"&for_member_key="+j;g=g+"&xml_content=yes";g=g+"&comment_key="+b;g=g+"&page="+h;g=g+"&s="+s;g=g+"&HideTextArea="+$("comments_box_hidetextarea").value;if(b>0){g=g+"&reply_to="+b;f=encodeURIComponent($("comment_reply_"+b).value)}g=location.protocol+"//"+location.hostname+g;a=new Ajax.Request(g,{method:"POST",postBody:"comment_text="+f,onSuccess:function(n){responseXml=n.responseXML;for(var m=responseXml.firstChild;m!=null;m=m.nextSibling){for(var l=m.firstChild;l!=null;l=l.nextSibling){if(l.nodeValue!=null&&l.nodeValue!=""){$("comments_content").innerHTML=l.nodeValue;$("comments_content").style.display="block"}}}Pageing(k,h)},onFailure:function(l){$(c).innerHTML="<center><b>Sorry we're unable to load data at the moment. We will try again in few seconds.</b></center>";return},onException:function(l){$(c).innerHTML="<center><b>Sorry we're unable to load data at the moment. We will try again in few seconds.</b></center>";return}})}catch(d){alert("smartxml:"+d)}}else{try{var c=$(i);$(c).innerHTML="<center><b>Sorry we're unable to load data at the moment. We will try again in few seconds.</b></center>"}catch(d){}}}function Pageing(d,f,g){var b=5;var a;var e=0;if(d>1){a="";if(f!=1){a=a+"<a title='Show first page' href='#' style='cursor: pointer;' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+(1)+","+d+","+g+"); return false;'><<</a>&nbsp;&nbsp;";a=a+"<a title='Show previous page' href='#' style='cursor: pointer;' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+(f-1)+","+d+","+g+"); return false;'><</a>&nbsp;&nbsp;"}if((f-b)>1){a=a+"...&nbsp;&nbsp;"}for(var c=1;c<=d;c++){if(d<=10){if(f==c){a=a+"<b><u>"+c+"</u></b>&nbsp;&nbsp;"}else{a=a+"<a title='Show page number "+c+"' style='cursor: pointer;' href='#' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+c+","+d+","+g+"); return false;'>"+c+"</a>&nbsp;&nbsp;"}}else{if(d>10){if(((f-c)<=b)&&((c-f)<=(b))){if(f==c){a=a+"<b><u>"+c+"</u></b>&nbsp;&nbsp;"}else{a=a+"<a title='Show page number "+c+"' href='#' style='cursor: pointer;' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+c+","+d+","+g+"); return false;'>"+c+"</a>&nbsp;&nbsp;"}e++}else{if((c-f<b*2)&&(c-f>(b*(-1)))&&e<b*2){if(f==c){a=a+"<b><u>"+c+"</u></b>&nbsp;&nbsp;"}else{a=a+"<a title='Show page number "+c+"' href='#' style='cursor: pointer;' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+c+","+d+","+g+"); return false;'>"+c+"</a>&nbsp;&nbsp;"}e++}else{if((c-f>(b*(-2)+(d-f)))&&(c-f<b*(-1))&&e<b*2){if(f==c){a=a+"<b><u>"+c+"</u></b>&nbsp;&nbsp;"}else{a=a+"<a title='Show page number "+c+"' href='#' style='cursor: pointer;' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+c+","+d+","+g+"); return false;'>"+c+"</a>&nbsp;&nbsp;"}e++}}}}}}if((f+b)<d){a=a+"...&nbsp;&nbsp;"}if(f!=d){a=a+"<a title='Show next page' href='#' style='cursor: pointer;' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+(f+1)+","+d+","+g+"); return false;'>></a>&nbsp;&nbsp;";a=a+"<a title='Show last page' href='#' style='cursor: pointer;' onClick='UpdateBoxComments(\"comments_content\",\"pagecomment\",0,"+d+","+d+","+g+"); return false;'>>></a>"}document.getElementById("pageing_div").innerHTML=a}else{}}WAYNProfile.ReplyForm=function(d,f,c,b,e){if(d=="open"){$("reply_form"+f).style.display="block"}else{if(d=="cancel"){$("reply_form"+f).style.display="none";$("reply_text"+f).value=""}else{if(d=="submit"){var a=$("comment_key"+f).value;if($("reply_text"+f).value==""){$("reply_form"+f).style.display="none";return}if(!validateForm(document.tmpForm,"comment_text|250|Comment Text")){return}$("reply_form"+f).style.display="none";if(!e){e=$("for_member_key").value}UpdateBoxComments("comments_content","save_reply",a,c,b,e,encodeURIComponent($("reply_text"+f).value))}}}};function ShowReplyCommentArea(a){if($("add_reply_"+a+"_area").style.display=="none"){Effect.SlideDown("add_reply_"+a+"_area",{duration:0.2,afterFinish:function(){setTimeout(function(){$("comment_reply_"+a).focus()},300)}})}else{Effect.SlideUp("add_reply_"+a+"_area",{duration:0.2})}}function SaveCommentReply(a,b){SaveComment("savecomment","comment_reply_"+a,0,0,b,a);return false}function ShowRepliedText(a){if($("replytext_"+a).style.display=="none"){Effect.SlideDown("replytext_"+a,{duration:0.15})}else{Effect.SlideUp("replytext_"+a,{duration:0.15})}};
