var URL_STAFFPICKS_USER="/ajax/addStaffpicksUser";var URL_BETA_USER="/ajax/addBetaUser";var URL_BLACKLIST_USER="/ajax/addBlacklistUser";var URL_REMOVE_IDOL="/ajax/removeIdol";var URL_GET_STATEMENT="/ajax/getStatement";function staffpicksUser(A){var B="Are you sure to Staffpicks this user?";if(!confirm(B)){return }else{new Ajax.Request(URL_STAFFPICKS_USER+"/"+A,{method:"post",onSuccess:function(D){var C=D.responseText;parseResponse(C);if(typeof responseArray.json.url!="undefined"){window.location=responseArray.json.url}else{if(responseArray.code=="0"){displayFeedback(responseArray.code+"The user is now the Staffpicks user")}else{displayFeedback(responseArray.code+responseArray.json.error)}}resetResponse()},onFailure:function(){displayFeedback("1Error contacting the server")}})}}function promoteBetaUser(A){var B="Are you sure to promote this user to Beta user?";if(!confirm(B)){return }else{new Ajax.Request(URL_BETA_USER+"/"+A,{method:"post",onSuccess:function(D){var C=D.responseText;parseResponse(C);if(typeof responseArray.json.url!="undefined"){window.location=responseArray.json.url}else{if(responseArray.code=="0"){displayFeedback(responseArray.code+"The user is now a Beta user")}else{displayFeedback(responseArray.code+responseArray.json.error)}}resetResponse()},onFailure:function(){displayFeedback("1Error contacting the server")}})}}function blacklistUser(A){var B="Are you sure to blacklist this user?";if(!confirm(B)){return }else{new Ajax.Request(URL_BLACKLIST_USER+"/"+A,{method:"post",onSuccess:function(D){var C=D.responseText;parseResponse(C);if(typeof responseArray.json.url!="undefined"){window.location=responseArray.json.url}else{if(responseArray.code=="0"){displayFeedback(responseArray.code+responseArray.json.msg);$("un").innerHTML=responseArray.json.un}else{displayFeedback(responseArray.code+responseArray.json.error)}}resetResponse()},onFailure:function(){displayFeedback("1Error contacting the server")}})}}function uploadForm(){if($("uploaddiv").style.display=="none"){$("uploaddiv").show()}else{$("uploaddiv").hide()}}function calcServerTime(A){d=new Date();utc=d.getTime()+(d.getTimezoneOffset()*60000);nd=new Date(utc+(3600000*A));return nd}function uploadFeedBlock(C){var B=$(C).childElements();var A=calcServerTime(srv_tz_os);B.each(function(N){var L=N.select('[class="commentdate"]');if(L[0]){var E=L[0].innerHTML.substr(0,10).split("-");var F=L[0].innerHTML.substr(11,8).split(":");var D=new Date(E[0],E[1]-1,E[2],F[0],F[1],F[2]);var K=(A.getTime()-D.getTime())/1000|0;var H=K/60|0;var O=H/60|0;var M=O/24|0;var J=M/30|0;var G=J/12|0;var I="";if(K!=0){I=GT.strargs(GT.gettext("feed_timestamp_formatstr"),[K,GT.ngettext("second","seconds",K),])}if(H!=0){I=GT.strargs(GT.gettext("feed_timestamp_formatstr"),[H,GT.ngettext("minute","minutes",H),])}if(O!=0){I=GT.strargs(GT.gettext("feed_timestamp_formatstr"),[O,GT.ngettext("hour","hours",O),])}if(M!=0){I=GT.strargs(GT.gettext("feed_timestamp_formatstr"),[M,GT.ngettext("day","days",M),])}if(J!=0){I=GT.strargs(GT.gettext("feed_timestamp_formatstr"),[J,GT.ngettext("month","months",J),])}if(G!=0){I=GT.strargs(GT.gettext("feed_timestamp_formatstr"),[G,GT.ngettext("year","years",G),])}L[0].innerHTML=I}})}function removeIdol(D,A,C,B){var F=GT.gettext("Are you sure to you want to stop being a fan of this user?");if(!confirm(F)){return }else{var E=$(C).innerHTML-0;new Ajax.Request(URL_REMOVE_IDOL+"/"+D+"/"+A+"/"+E,{method:"post",onSuccess:function(H){var G=H.responseText;parseResponse(G);if(responseArray.code!="0"){displayFeedback(responseArray.code+responseArray.json.error)}else{displayFeedback(responseArray.code+GT.gettext("You are no longer a fan of this user"));$(B).innerHTML=responseArray.html}resetResponse()},onFailure:function(){displayFeedback("1Error contacting the server")}})}}function highlightUser(A){$("userdetail_"+A).addClassName("userhlb");$("usercontent_"+A).addClassName("userhighlight");var B=$("userdetail_"+A).select('[class="user_control"]')[0];B.show()}function unhighlightUser(A){$("userdetail_"+A).removeClassName("userhlb");$("usercontent_"+A).removeClassName("userhighlight");var B=$("userdetail_"+A).select('[class="user_control"]')[0];B.hide()}function highlightUserSmall(B,A){var C=$("userdetail_"+B).select('[class="fans_user_thumb_author"]')[0];var D=$("userdetail_"+B).select('[class="user_control"]')[0];if(typeof A!="undefined"){C.style.background=A}else{C.style.background="#e7e7e7"}D.show()}function unhighlightUserSmall(A){var B=$("userdetail_"+A).select('[class="fans_user_thumb_author"]')[0];var C=$("userdetail_"+A).select('[class="user_control"]')[0];B.style.background="none";C.hide()}function highlightMovie(A){$("moviedetail_"+A).addClassName("highlight");$("moviecontent_"+A).addClassName("content_highlight");var B=$("moviedetail_"+A).select('[class="movie_control"]')[0];B.show()}function unhighlightMovie(A){$("moviedetail_"+A).removeClassName("highlight");$("moviecontent_"+A).removeClassName("content_highlight");var B=$("moviedetail_"+A).select('[class="movie_control"]')[0];B.hide()}function highlightEntry(A){$(A).className="entry_item_highlight"}function unhighlightEntry(A){$(A).className="entry_item"}function showDiv(B){var A=document.getElementById(B);A.style.display="block"}function hideDiv(B){var A=document.getElementById(B);A.style.display="none"}function swapText(D,C){var B=document.getElementById(D);var A=document.getElementById(C);var E=B.innerHTML;B.innerHTML=A.innerHTML;A.innerHTML=E}function loadStatementPage(G,B,E,H,C,A,I,D){var F=$(H).innerHTML-0;if(D=="next"){F=F+1}else{if(D=="prev"){F=F-1}}new Ajax.Request(URL_GET_STATEMENT+"/"+E+"/"+G+"/"+F,{method:"post",onSuccess:function(K){var J=K.responseText;statementPagingComplete(J,G,B,F,H,C,A,I,E)},onFailure:function(){displayFeedback("1Error contacting the server")}})}function statementPagingComplete(D,G,B,F,H,C,A,I,E){parseResponse(D);if(responseArray.code=="0"){$(B).innerHTML=responseArray.html;$(H).innerHTML=F;if(typeof E!="undefined"){$(C).innerHTML="<a href=\"javascript:loadStatementPage('"+G+"','"+B+"','"+E+"','"+H+"','"+C+"','"+A+"','"+I+"','prev');\">&lt; "+responseArray.json.prevlink+"</a>";$(I).innerHTML="<a href=\"javascript:loadStatementPage('"+G+"','"+B+"','"+E+"','"+H+"','"+C+"','"+A+"','"+I+"','next');\">"+responseArray.json.nextlink+" &gt;</a>";$(A).innerHTML=responseArray.json.currentMonth}if(responseArray.json.prev_page==0){$(C).style.display="none"}else{$(C).style.display="block"}if(responseArray.json.next_page==0){$(I).style.display="none"}else{$(I).style.display="block"}if(G=="userfeed"){uploadFeedBlock("feedsmain")}}else{displayFeedback(responseArray.code+responseArray.json.error)}resetResponse()}function close_FB_oa(){$("fb_oa_container").hide()}function hideTrial(){var A=new Date();A.setDate(A.getDate()+3);set_cookie("ga_user_trial_hide","1",A.getFullYear(),A.getMonth(),A.getDate());$("trial_ad").hide()};
