if(!dojo._hasResource["Antichrist"]){
dojo._hasResource["Antichrist"]=true;
dojo.provide("Antichrist");
dojo.provide("AntichristTheme");
dojo.provide("CommentStoreModel");
dojo.require("dojo.behavior");
dojo.require("dojo.back");
dojo.require("dijit.dijit");
dojo.require("dijit.Dialog");
dojo.require("dijit.TooltipDialog");
dojo.require("dijit.Tooltip");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.ComboBox");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.DateTextBox");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit.form.DropDownButton");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dijit.layout.StackContainer");
dojo.require("dijit.layout.BorderContainer");
dojo.require("dojox.form.BusyButton");
var AntichristStore=new dojox.data.QueryReadStore({url:"getAntichristList"});
var CountriesStore;
var CountryRegionsStore;
var LanguagesStore;
var NameSuffixesStore;
var ModerationRemarksStore;
var IconsStore;
var Tracker;
var NameCommentsStore=null;
var ListStore=Object();
ListStore["Recent"]=new dojox.data.QueryReadStore({url:"getRecentResults",doClientPaging:false,requestMethod:"post"});
dojo.forEach(["Daily","Weekly","Monthly","Yearly","Total"],function(_1){
ListStore[_1]=new dojox.data.QueryReadStore({url:"getResults?interval="+_1,doClientPaging:false,requestMethod:"post"});
});
function getQueryVariable(_2){
var _3=window.location.search.substring(1);
var _4=_3.split("&");
for(var _5=0;_5<_4.length;_5++){
var _6=_4[_5].split("=");
if(_6[0]==_2){
return _6[1];
}
}
return undefined;
};
function formatPercentage(_7){
return _7+"%";
};
function formatPerson(_8){
return "<span class=\"Person\">"+_8+"</span>";
};
(function(){
AntichristTheme=new dojox.charting.Theme({chart:{stroke:null,fill:"transparent"},plotarea:{stroke:null,fill:"transparent"},axis:{stroke:{color:"#fff",width:2},line:{color:"#fff",width:1},majorTick:{color:"#fff",width:2,length:12},minorTick:{color:"#fff",width:1,length:8},font:"normal normal normal 8pt Tahoma",fontColor:"#999"},series:{outline:{width:1,color:"#fff"},stroke:{width:2,color:"#666"},fill:new dojo.Color([102,102,102,0.8]),font:"normal normal normal 7pt Tahoma",fontColor:"#000"},marker:{stroke:{width:2},fill:"#333",font:"normal normal normal 7pt Tahoma",fontColor:"#000"},colors:[]});
AntichristTheme.defineColors({hue:1,saturation:60,low:40,high:88});
})();
function rot13init(){
var _9=new Array();
var _a="abcdefghijklmnopqrstuvwxyz";
for(var _b=0;_b<_a.length;_b++){
_9[_a.charAt(_b)]=_a.charAt((_b+13)%26);
}
for(_b=0;_b<_a.length;_b++){
_9[_a.charAt(_b).toUpperCase()]=_a.charAt((_b+13)%26).toUpperCase();
}
return _9;
};
function rot13(_c){
if(_c){
if(!_d){
var _d=rot13init();
}
var _e="";
for(var _f=0;_f<_c.length;_f++){
var _10=_c.charAt(_f);
_e+=(_10>="A"&&_10<="Z"||_10>="a"&&_10<="z"?_d[_10]:_10);
}
return _e;
}else{
return null;
}
};
dojo.declare("CommentStoreModel",dijit.tree.ForestStoreModel,{getChildren:function(_11,_12,_13){
var _14=0;
if(!_11.root){
_14=this.store.getValue(_11,"antichrist_comment_id");
}
this.store.fetch({query:{parent:_14},onComplete:_12,onError:_13});
return this.inherited(arguments);
}});
function refreshModerationsButton(_15){
if(Dynamics["ModerationButton"]){
Dynamics["ModerationButton"].destroyRecursive(false);
}
Dynamics["ModerationButton"]=new dijit.form.DropDownButton({title:"See moderation details for this comment",label:_15,id:"ModerationButton"},"ModerationButton");
var _16=new dojo.data.ItemFileReadStore({url:"getModerations?C="+commentID,clearOnClose:true});
Dynamics["ModerationButton"].dropDown=Dynamics["ModerationDialog"];
_16.fetch({onComplete:function(_17,_18){
if(_17.length>0){
var _19="<table class=\"ModerationGrid\"><thead><tr><th>Remark</th><th>Percent</th></tr></thead><tbody>";
dojo.forEach(_17,function(_1a){
_19+="<tr><td>"+_16.getValue(_1a,"remark")+"</td><td>"+_16.getValue(_1a,"remark_percentage")+"%</td></tr>";
});
_19+="</tbody></table>";
Dynamics["ModerationDialog"].setContent(_19);
}else{
Dynamics["ModerationDialog"].setContent("No one has moderated this comment yet.");
}
},onError:function(_1b,_1c){
Dynamics["ModerationDialog"].setContent("Sorry, no moderation breakdown currently available.");
}});
Dynamics["ModerationButton"].startup();
};
var CommentInfo=Object();
function treeClick(_1d,_1e){
if(!ModerationRemarksStore){
ModerationRemarksStore=new dojo.data.ItemFileReadStore({url:"getModerationRemarks"});
}
if(_1d&&!_1d.root){
var _1f=_1e.tree.model.store;
commentID=_1f.getValue(_1d,"antichrist_comment_id");
var _20=_1f.getValue(_1d,"for_or_against");
var _21="(Neutral)";
if(_20==1){
_21="(Pro)";
}else{
if(_20==-1){
varforOrAgainstStr="(Con)";
}
}
var _22=_1f.getValue(_1d,"user_name");
var _23="<h2 id=\"UserInfoTitle\" title=\"User #"+_1f.getValue(_1d,"user_account_id")+"\">"+_22;
var _24=_1f.getValue(_1d,"user_nickname");
if(_24&&_24!=_22){
_23+=" (a.k.a. "+_24+")";
}
_23+="</h2><div id=\"UserInfoBody\"><p id=\"UserInfoLocation\"";
var _25=_1f.getValue(_1d,"user_language");
if(_25){
_23+=" title=\""+_25+"\"";
}
var _26=_1f.getValue(_1d,"user_state_or_province","")||"";
var _27=_1f.getValue(_1d,"user_country","");
_23+=">"+(_26+((_26&&_27)?", ":"")+_27);
_23+="</p>";
var _28=_1f.getValue(_1d,"user_icon_url");
if(_28){
var _29=_28.replace("picon://","/picon/");
_29=_29.replace("http://www.antichristwatch.net/","/");
_23+="<img id=\"UserIcon\" src=\""+_29+"\" alt=\"["+_22+"]\" />";
}
_23+="<p id=\"UserInfoDescription\">"+(_1f.getValue(_1d,"user_description","")||"No blurb provided.")+"</p>";
var _2a=_1f.getValue(_1d,"user_homepage_url");
if(_2a){
_23+="<p id=\"UserInfoHomePage\"><a href=\""+_2a+"\" title=\"Go to the home page of "+_22+"\" rel=\"nofollow\">"+_2a+"</a></p>";
}
_23+="</div>";
var _2b="<h2 id=\"CommentTextTitle\" title=\"Comment #"+commentID+" "+_21+"\">"+_1f.getValue(_1d,"comment_title")+" "+"</h2><div id=\"CommentTextBody\">"+_1f.getValue(_1d,"comment_content")+"</div>"+"<p id=\"CommentByLine\">by <span id=\"CommentPosterButton\"></span> at "+_1f.getValue(_1d,"comment_timestamp").slice(0,19)+"; <span id=\"ModerationButton\"></span> "+_21+"</p><br /> "+"<button id=\"ReplyButton\">Post a Reply</button> <button id=\"ModerateButton\">Moderate</button>";
dijit.byId("CommentsTextSubPane").setContent(_2b);
if(Dynamics["UserInfoDialog"]){
Dynamics["UserInfoDialog"].destroyRecursive(false);
}
Dynamics["UserInfoDialog"]=new dijit.TooltipDialog({id:"UserInfoDialog"});
Dynamics["UserInfoDialog"].setContent(_23);
if(Dynamics["CommentPosterButton"]){
Dynamics["CommentPosterButton"].destroyRecursive(false);
}
Dynamics["CommentPosterButton"]=new dijit.form.DropDownButton({title:"See info about "+_22,id:"CommentPosterButton",label:_22},"CommentPosterButton");
Dynamics["CommentPosterButton"].dropDown=Dynamics["UserInfoDialog"];
Dynamics["CommentPosterButton"].startup();
commentID=_1f.getValue(_1d,"antichrist_comment_id");
if(Dynamics["ModerationDialog"]){
Dynamics["ModerationDialog"].destroyRecursive(false);
}
Dynamics["ModerationDialog"]=new dijit.TooltipDialog({id:"ModerationDialog"});
refreshModerationsButton(_1f.getValue(_1d,"moderation_level"));
if(Dynamics["ReplyButton"]){
Dynamics["ReplyButton"].destroyRecursive(false);
}
Dynamics["ReplyButton"]=new dijit.form.Button({onClick:postCommentReply},"ReplyButton");
if(!UserInfo["commentsLeft"]){
Dynamics["ReplyButton"].setAttribute("disabled",true);
}
if(Dynamics["ModerateButton"]){
Dynamics["ModerateButton"].destroyRecursive(false);
}
Dynamics["ModerateButton"]=new dijit.form.Button({onClick:moderateComment},"ModerateButton");
if(_22==UserInfo["userName"]||!UserInfo["moderationsLeft"]){
Dynamics["ModerateButton"].setAttribute("disabled",true);
}
}else{
dijit.byId("CommentsTextSubPane").setContent("");
}
};
function refreshTree(_2c){
NameCommentsStore=new dojox.data.QueryReadStore({url:"getComments?full_name="+encodeURI(_2c)});
NameCommentsStore.fetch({onComplete:function(_2d,_2e){
CommentInfo["ID"]=0;
CommentInfo["title"]="";
CommentInfo["body"]="";
if(_2d.length>0){
AntichristInfo["name"]=NameCommentsStore.getValue(_2d[0],"candidate_antichrist");
var _2f="<button id=\"PostButton\">Post a Comment</button>"+"<div id=\"CommentsTree\"></div>";
dijit.byId("CommentsTreeSubPane").setContent(_2f);
var _30=new CommentStoreModel({store:NameCommentsStore,query:{is_top_level:true},rootId:"root",rootLabel:"Comments on "+AntichristInfo["name"]});
if(NameCommentsTree){
NameCommentsTree.destroyRecursive(false);
}
NameCommentsTree=new dijit.Tree({model:_30,onClick:treeClick,persist:false},"CommentsTree");
}else{
var _2f="<p>No arguments for or against this potential Antichrist have been made yet.</p>"+"<p>You can be the first...</p>"+"<button id=\"PostButton\">Post a Comment</button>"+"<div id=\"CommentsTree\"></div>";
dijit.byId("CommentsTreeSubPane").setContent(_2f);
}
if(Dynamics["PostButton"]){
Dynamics["PostButton"].destroyRecursive(false);
}
Dynamics["PostButton"]=new dijit.form.Button({onClick:postComment},"PostButton");
if(!UserInfo["commentsLeft"]){
Dynamics["PostButton"].setAttribute("disabled",true);
}
dijit.byId("CommentsTextSubPane").setContent("");
dijit.byId("LookUpSubmit").cancel();
},onError:function(_31,_32){
console.log("error loading data "+_31);
dijit.byId("LookUpSubmit").cancel();
}});
};
var AntichristInfo=Object();
var NameCommentsTree=null;
function lookUpName(_33){
var _34=new dojox.data.QueryReadStore({url:"lookUpName?full_name="+encodeURI(_33)});
_34.fetch({onComplete:function(_35,_36){
if(_35.length>0){
AntichristInfo["name"]=_34.getValue(_35[0],"candidate_antichrist");
}else{
AntichristInfo["name"]=_33;
}
dojo.forEach(_35,function(_37){
dojo.html.set(dojo.byId("PotentialAntichristName"),AntichristInfo["name"]);
dojo.html.set(dojo.byId("SpecificDailyVoterPercentage"),(_34.getValue(_37,"daily_vote_percentage",0)||0)+"%");
dojo.html.set(dojo.byId("SpecificWeeklyVoterPercentage"),(_34.getValue(_37,"weekly_vote_percentage",0)||0)+"%");
dojo.html.set(dojo.byId("SpecificMonthlyVoterPercentage"),(_34.getValue(_37,"monthly_vote_percentage",0)||0)+"%");
dojo.html.set(dojo.byId("SpecificYearlyVoterPercentage"),(_34.getValue(_37,"yearly_vote_percentage",0)||0)+"%");
dojo.html.set(dojo.byId("SpecificTotalVoterPercentage"),(_34.getValue(_37,"total_vote_percentage",0)||0)+"%");
dojo.html.set(dojo.byId("CommentTally"),(_34.getValue(_37,"argument_tally","0")||"0"));
});
},onError:function(_38,_39){
dojo.html.set(dojo.byId("PotentialAntichristName"),"Search failed.");
}});
refreshTree(_33);
};
function handleGridCellClick(evt){
if(evt.cellIndex==0){
dijit.byId("AntichristLookUpName").setValue(evt.cellNode.firstChild.firstChild.nodeValue);
dijit.byId("LookUpForm").submit();
dijit.byId("ContentTabs").selectChild("LookUpPane");
saveState("LookUpPane",evt.cellNode.firstChild.firstChild.nodeValue);
}
};
function makeChart(_3a){
function _3b(_3c,_3d,_3e){
dojo.xhrGet({url:"./"+_3c,handleAs:"json",timeout:23000,load:function(_3f,_40){
_3a(_3f["items"],_3d,_3e);
return _3f;
},error:function(_41,_42){
console.error("Chart loading error -- HTTP status code: ",_42.xhr.status);
return _41;
}});
};
return _3b;
};
var PieChart=Object();
drawPieChart=function(_43,_44,_45){
dojo.style(dojo.byId(_44),{"width":_45+"px","height":_45+"px","overflow":"hidden"});
if(PieChart[_44]){
PieChart[_44].destroy();
}
PieChart[_44]=new dojox.charting.Chart2D(_44);
var _46=PieChart[_44];
_46.setTheme(AntichristTheme);
_46.addAxis("potential_antichrist");
_46.addAxis("num_of_votes");
_46.addPlot("default",{type:"Pie",font:"normal normal bold .95em Times",fontColor:"000",radius:Math.round(_45*0.4)});
_46.addSeries("Picks",_43);
var _47=new dojox.charting.action2d.MoveSlice(_46,"default");
var _48=new dojox.charting.action2d.Highlight(_46,"default");
var _49=new dojox.charting.action2d.Tooltip(_46,"default");
_46.render();
};
var makePieChart=makeChart(drawPieChart);
function drawPieCharts(_4a){
var _4b=_4a.id.slice(0,-8);
var _4c=dojo.byId(_4b+"ListGrid");
if(!Dynamics[_4c.id]){
var _4d=[{field:"candidate_antichrist",name:"Potential Antichrist",width:"auto",formatter:formatPerson},{field:"vote_percentage",name:"Percent",width:"6em",formatter:formatPercentage}];
Dynamics[_4c.id]=new dojox.grid.DataGrid({title:_4c.title,query:{candidate_antichrist:"*"},store:ListStore[_4b],rowsPerPage:50,region:"center",selectionMode:"single",refreshOnShow:true,structure:_4d,onCellClick:handleGridCellClick,height:"90%",style:"min-width:32em;float:left;"},_4b+"ListGrid");
Dynamics[_4c.id].startup();
}else{
Dynamics[_4c.id].resize();
}
var _4e=dijit.byId("TopPicksSubPane").domNode.clientWidth-dijit.byId(_4b+"ListGrid").domNode.clientWidth;
var _4f=dijit.byId("TopPicksSubPane").domNode.clientHeight;
var _50=Math.min(_4e,_4f);
var _51=dojo.byId(_4b+"ListPie");
makePieChart("getResultsPie?interval="+_4b,_4b+"ListPie",_50);
};
var BarChart=Object();
drawBarChart=function(_52,_53,_54){
_52=_52.reverse();
var _55=dojo.map(_52,function(_56){
return Number(_56.num_of_votes);
});
var _57=dojo.map(_52,function(_58,_59){
return {value:_59+1,text:_58.voting_date};
});
BarChart[_53]=new dojox.charting.Chart2D(_53);
var _5a=BarChart[_53];
_5a.setTheme(AntichristTheme);
_5a.addAxis("x",{stroke:"#999",majorLabels:true,minorTicks:true,majorTick:{length:3,stroke:"#999"},labels:_57});
_5a.addAxis("y",{stroke:"#999",vertical:true,includeZero:true,majorTick:{length:3,stroke:"#999"}});
_5a.addPlot("default",{type:"Columns"});
_5a.addSeries("Activity",_55);
_5a.render();
};
var makeBarChart=makeChart(drawBarChart);
function drawBarCharts(){
if(!Dynamics["RecentListGrid"]){
var _5b=Dynamics["RecentPicksPane"]._contentBox["h"];
var _5c=Math.floor(_5b*0.6)-15;
var _5d=[{field:"candidate_antichrist",name:"Potential Antichrist",width:"auto",formatter:formatPerson},{field:"voting_time",name:"Voting Time",width:"auto"},{field:"country_name",name:"Originating Country",width:"auto"},{field:"region_name",name:"Region",width:"auto"}];
Dynamics["RecentListGrid"]=new dojox.grid.DataGrid({title:dojo.byId("RecentListGrid").title,query:{candidate_antichrist:"*"},store:ListStore["Recent"],rowsPerPage:50,region:"center",selectionMode:"single",refreshOnShow:true,structure:_5d,onCellClick:handleGridCellClick,height:String(_5c)+"px"},"RecentListGrid");
Dynamics["RecentListGrid"].startup();
}else{
Dynamics["RecentListGrid"].resize();
dojo.html.set(dojo.byId("DailyActivityChart"),"");
makeBarChart("getDailyActivity","DailyActivityChart");
}
};
function forOrAgainstTally(){
var _5e=0;
if(dijit.byId("ProComment").getValue()=="on"){
_5e=1;
}else{
if(dijit.byId("ConComment").getValue()=="on"){
_5e=-1;
}
}
return _5e;
};
function applyPosting(){
var _5f=null;
if(!UserInfo["userName"]||!UserInfo["token"]||!UserInfo["loggedIn"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You must be logged in to post.");
dijit.byId("StatusDialog").show();
}else{
if(!UserInfo["commentsLeft"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You have already posted your daily allotment of comments.  You may post more tomorrow.");
dijit.byId("StatusDialog").show();
}else{
var _60={url:"postComment?T="+encodeURI(UserInfo["token"])+"&R="+encodeURI(rot13(UserInfo["userName"]))+"&AntichristName="+AntichristInfo["name"],handleAs:"json",load:function(_61){
dojo.html.set(dojo.byId("StatusMessageBox"),_61.resultMessage);
UserInfo["commentsLeft"]--;
dijit.byId("PostCommentDialog").hide();
dijit.byId("StatusDialog").show();
if(!UserInfo["commentsLeft"]){
Dynamics["PostButton"].setAttribute("disabled",true);
Dynamics["ReplyButton"].setAttribute("disabled",true);
}
},error:function(_62){
if(_62.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your comment timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),_62.responseText);
dijit.byId("PostCommentDialog").hide();
dijit.byId("StatusDialog").show();
}
},timeout:23000,content:{"CommentText":dijit.byId("CommentText").getValue(),"ForOrAgainst":forOrAgainstTally()},form:"PostCommentForm"};
_5f=dojo.xhrGet(_60);
}
}
return false;
};
function showPostCommentDialog(){
if(!Dynamics["CommentText"]){
Dynamics["CommentText"]=new dijit.Editor({name:"CommentText",height:"15em"},dojo.byId("CommentText"));
}else{
Dynamics["CommentText"].resize();
}
dijit.byId("ReplyToID").setValue(CommentInfo["ID"]);
dijit.byId("PostCommentTitle").setValue(CommentInfo["title"]);
dijit.byId("CommentText").setValue(CommentInfo["body"]);
dojo.html.set(dojo.byId("PostAntichristName"),AntichristInfo["name"]);
dijit.byId("PostCommentDialog").show();
};
function postComment(evt){
if(!UserInfo["userName"]||!UserInfo["token"]||!UserInfo["loggedIn"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You must be logged in to post a comment.");
dijit.byId("StatusDialog").show();
}else{
if(!UserInfo["commentsLeft"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You have already posted your daily allotment of comments.  You may post more tomorrow.");
dijit.byId("StatusDialog").show();
}else{
CommentInfo["ID"]=null;
CommentInfo["title"]="";
CommentInfo["body"]="";
showPostCommentDialog();
}
}
return false;
};
function postCommentReply(evt){
if(!UserInfo["userName"]||!UserInfo["token"]||!UserInfo["loggedIn"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You must be logged in to post a reply.");
dijit.byId("StatusDialog").show();
}else{
if(!UserInfo["commentsLeft"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You have already posted your daily allotment of comments.  You may post more tomorrow.");
dijit.byId("StatusDialog").show();
}else{
CommentInfo["ID"]=dojo.byId("CommentTextTitle").getAttribute("title").split(" ",2)[1].slice(1);
var _63=dojo.byId("CommentTextTitle").firstChild.nodeValue;
if(_63.slice(0,4)!="Re: "){
_63="Re: "+_63;
}
var _64="";
CommentInfo["title"]=_63;
CommentInfo["body"]=_64;
showPostCommentDialog();
}
}
return false;
};
function applyModeration(){
var _65=null;
if(!UserInfo["userName"]||!UserInfo["token"]||!UserInfo["loggedIn"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You must be logged in to moderate.");
dijit.byId("StatusDialog").show();
}else{
if(!UserInfo["moderationsLeft"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You have already made your daily allotment of moderations.  You may moderate more tomorrow.");
dijit.byId("StatusDialog").show();
}else{
var _66={url:"moderateComment?T="+encodeURI(UserInfo["token"])+"&R="+encodeURI(rot13(UserInfo["userName"]))+"&C="+CommentInfo["ID"],handleAs:"json",load:function(_67){
dojo.html.set(dojo.byId("StatusMessageBox"),_67.resultMessage);
UserInfo["moderationsLeft"]--;
dijit.byId("ModerateCommentDialog").hide();
dijit.byId("StatusDialog").show();
if(!UserInfo["moderationsLeft"]){
Dynamics["ModerateButton"].setAttribute("disabled",true);
}else{
Dynamics["ModerateButton"].setAttribute("disabled",true);
}
},error:function(_68){
if(_68.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your moderation timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),_68.responseText);
dijit.byId("ModerateCommentDialog").hide();
dijit.byId("StatusDialog").show();
}
},timeout:23000,form:"ModerateCommentForm"};
_65=dojo.xhrGet(_66);
}
}
return false;
};
function moderateComment(evt){
if(!UserInfo["userName"]||!UserInfo["token"]||!UserInfo["loggedIn"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You must be logged in to moderate a comment.");
dijit.byId("StatusDialog").show();
}else{
if(!UserInfo["moderationsLeft"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You have already made your daily allotment of moderations.  You may moderate more tomorrow.");
dijit.byId("StatusDialog").show();
}else{
CommentInfo["ID"]=dojo.byId("CommentTextTitle").getAttribute("title").split(" ",2)[1].slice(1);
dijit.byId("ModerationRemark").store=ModerationRemarksStore;
dijit.byId("ModerateCommentDialog").show();
}
}
return false;
};
function vote(){
var _69={url:"voteForAntichrist",handleAs:"json",load:function(_6a){
dojo.html.set(dojo.byId("StatusMessageBox"),_6a.resultMessage);
dijit.byId("StatusDialog").show();
dijit.byId("AntichristInputName").setAttribute("disabled",true);
dijit.byId("AntichristInputName").setDisplayedValue("Already Voted");
dijit.byId("VoteSubmit").cancel();
dijit.byId("VoteSubmit").setAttribute("disabled",true);
dijit.byId("ContentTabs").selectChild("TopPicksPane");
refreshNode(dijit.byId("TopPicksSubPane").selectedChildWidget);
saveState("TopPicksPane",dijit.byId("TopPicksSubPane").selectedChildWidget.id);
},error:function(_6b){
if(_6b.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your vote timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),_6b.responseText);
}
dijit.byId("StatusDialog").show();
dijit.byId("VoteSubmit").cancel();
},timeout:23000,form:"VoteForm"};
dojo.xhrGet(_69);
return false;
};
var UserInfo=Object();
UserInfo["userName"]=null;
UserInfo["token"]=null;
UserInfo["rememberMe"]=null;
UserInfo["isBirthday"]=null;
UserInfo["loggedIn"]=null;
UserInfo["nickname"]=null;
function logout(){
UserInfo["userName"]=null;
UserInfo["token"]=null;
UserInfo["loggedIn"]=false;
UserInfo["commentsLeft"]=null;
UserInfo["moderationsLeft"]=null;
UserInfo["nickname"]=null;
dijit.byId("AccountPane").back();
var _6c=Dynamics["LoginLogoutSubmit"];
_6c.title="Login to Antichrist Watch";
_6c.setLabel("Login");
dojo.style("RegisterForm","display","block");
dojo.html.set(dojo.byId("LoginMessageBox"),"");
dojo.html.set(dojo.byId("AccountName"),"Account");
if(!UserInfo["rememberMe"]){
dojo.cookie("credentials",null,{expires:-1});
dojo.cookie("TWISTED_SESSION",null,{expires:-1});
}
dijit.byId("ModifyAccountForm").initialized=null;
};
function md5hex(_6d){
return (dojox.encoding.digests.MD5(_6d,dojox.encoding.digests.outputTypes.Hex));
};
function md5hexDijitValue(_6e){
var _6f=dijit.byId(_6e);
if(!_6f.isChanging){
_6f.isChanging=true;
_6f.setValue(md5hex(_6f.getValue()));
_6f.isChanging=null;
}
};
function processPassword(_70,_71){
if(_71){
md5hexDijitValue(_70);
}
};
function processPasswordDup(_72,_73){
if(_73){
var _74=dijit.byId(_72);
var _75=dijit.byId(_72+"Dup");
if(!_75.isChanging){
_75.isChanging=true;
var _76=md5hex(_75.getValue());
_75.setValue(_76);
_75.isChanging=null;
if(_76!=_74.getValue()){
var _77="Your entered passwords don't match.  Please try again.";
dojo.html.set(dojo.byId("StatusMessageBox"),_77);
dijit.byId("StatusDialog").show();
}
}
}
};
function setIconList(){
IconsStore=new dojo.data.ItemFileReadStore({url:"getIconList?w="+encodeURI(dijit.byId("UserHomePage").getValue())+"&s="+encodeURI(dijit.byId("UserSex").getValue())+"&e="+encodeURI(dijit.byId("UserEMailAddress").getValue()),clearOnClose:true});
dijit.byId("UserIconSelect").store=IconsStore;
};
function setModerationRemark(_78){
ModerationRemarksStore.fetchItemByIdentity({identity:_78,onItem:function(_79){
dijit.byId("ModerationValue").setValue(ModerationRemarksStore.getValue(_79,"numeric_value"));
}});
};
function toggleRememberMe(_7a){
if(_7a){
dojo.cookie("cookieTest",true);
if(!dojo.cookie("cookieTest")){
dojo.html.set(dojo.byId("StatusMessageBox"),"You must have cookies turned on for the “remember me” feature to work.");
dijit.byId("StatusDialog").show();
dijit.byId("LoginDialog").hide();
}else{
dojo.cookie("cookieTest",null,{expires:-1});
}
}else{
dojo.cookie("cookieTest",null,{expires:-1});
}
};
function setCountry(_7b){
CountryRegionsStore=new dojo.data.ItemFileReadStore({url:"getCountryRegions?id="+_7b,clearOnClose:true});
dijit.byId("UserStateOrProvince").store=CountryRegionsStore;
};
function setIcon(_7c){
var _7d=_7c.replace("picon://","/picon/");
_7d=_7d.replace("http://www.antichristwatch.net/","/");
dojo.html.set(dojo.byId("EditIconDisplayBox"),"<img class=\"UserIcon\" alt=\"Picture of Me\" title=\"Me!\" src=\""+_7d+"\" />");
};
function authenticateUser(_7e){
function _7f(){
var _80=rot13(UserInfo["userName"]||dijit.byId("LoginUserName").getValue());
if(_7e=="createAccount"){
var _81=dijit.byId("SetupAccountPassword").getValue();
if(_81!=dijit.byId("SetupAccountPasswordDup").getValue()){
dojo.html.set(dojo.byId("StatusMessageBox"),"Your entered passwords don't match.  Please try again.");
dijit.byId("StatusDialog").show();
dijit.byId("SetupAccountDialog").hide();
return false;
}
var _82=md5hex(_81);
}else{
var _82=md5hex(dijit.byId("LoginPassword").getValue());
}
function _83(_84){
if(_84.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your login timed out.  Please try again later.");
dijit.byId("StatusDialog").show();
dijit.byId("CreateAccountDialog").hide();
dijit.byId("SetupAccountDialog").hide();
}else{
if(_84.responseText=="No such user."){
dijit.byId("CreateAccountDialog").show();
}else{
UserInfo["userName"]=null;
UserInfo["token"]=null;
UserInfo["isBirthday"]=null;
dojo.html.set(dojo.byId("StatusMessageBox"),_84.responseText);
dijit.byId("StatusDialog").show();
dijit.byId("CreateAccountDialog").hide();
dijit.byId("SetupAccountDialog").hide();
dojo.cookie("credentials",null,{expires:-1});
}
}
dijit.byId("LoginDialog").hide();
};
var _85=_7e+"?R="+_80;
if(_7e=="loginFromCookie"){
_85+="&T="+UserInfo["token"];
}else{
if(_7e=="loginOneShot"){
_85+="&K="+UserInfo["token"];
}else{
_85+="&M="+_82;
}
}
if(UserInfo["openID"]){
_85+="&O="+UserInfo["openID"];
}
var _86={url:_85,handleAs:"json",load:function(_87){
CountriesStore=new dojo.data.ItemFileReadStore({url:"getTerseCountries"});
dijit.byId("UserCountry").store=CountriesStore;
LanguagesStore=new dojo.data.ItemFileReadStore({url:"getLanguages"});
dijit.byId("UserLanguage").store=LanguagesStore;
NameSuffixesStore=new dojo.data.ItemFileReadStore({url:"getValidConstants?table=valid_person_suffix&column=name_suffix"});
dijit.byId("UserNameSuffix").store=NameSuffixesStore;
UserInfo["userName"]=rot13(_87.login);
UserInfo["token"]=_87.token;
UserInfo["isBirthday"]=(_87.is_birthday=="t");
var _88=_87.error;
if(_88){
_83(_87);
}else{
UserInfo["loggedIn"]=true;
var _89=new dojox.data.QueryReadStore({url:"getUserInfo?T="+encodeURI(UserInfo["token"])+"&R="+encodeURI(rot13(UserInfo["userName"])),doClientPaging:false,requestMethod:"post"});
_89.fetchItemByIdentity({identity:UserInfo["username"],onItem:function(_8a){
dijit.byId("ModifyAccountForm").initialized=null;
dijit.byId("UserGivenName").setValue(_89.getValue(_8a,"given_name"));
dijit.byId("UserMiddleInitials").setValue(_89.getValue(_8a,"middle_initials"));
dijit.byId("UserSurname").setValue(_89.getValue(_8a,"surname"));
dijit.byId("UserNameSuffix").setValue(_89.getValue(_8a,"name_suffix"));
dijit.byId("UserNickname").setValue(_89.getValue(_8a,"nickname")||UserInfo["nickname"]);
var _8b=_89.getValue(_8a,"sex")||UserInfo["gender"];
if(_8b){
dijit.byId("UserSex").setDisplayedValue(_8b);
}
var _8c=String(Math.random()*10000000000000);
dijit.byId("UserPassword").setValue(_89.getValue(_8a,"user_password")||_8c);
dijit.byId("UserPasswordDup").setValue(_89.getValue(_8a,"user_password")||_8c);
dijit.byId("UserHomePage").setValue(_89.getValue(_8a,"user_homepage_url"));
dijit.byId("UserEMailAddress").setValue(_89.getValue(_8a,"user_e_mail_address")||UserInfo["email"]);
var _8d=_89.getValue(_8a,"user_icon_url");
if(_8d){
dijit.byId("UserIconSelect").setValue(_8d);
}
var _8e=_89.getValue(_8a,"user_description");
if(_8e){
dijit.byId("UserDescription").setValue(_8e);
}else{
dijit.byId("UserDescription").setValue("");
}
dijit.byId("UserBirthday").setDisplayedValue(_89.getValue(_8a,"user_birthday")||UserInfo["dob"]);
dijit.byId("UserStateOrProvince").setDisplayedValue(_89.getValue(_8a,"user_state_or_province"));
UserInfo["moderationsLeft"]=_89.getValue(_8a,"moderations_left",0);
UserInfo["commentsLeft"]=_89.getValue(_8a,"comments_left",0);
dijit.byId("UserCountry").setValue(_89.getValue(_8a,"country_code",UserInfo["country"]||"US")||UserInfo["country"]||"US");
dijit.byId("UserLanguage").setDisplayedValue(_89.getValue(_8a,"user_language")||UserInfo["language"]||"English");
if(_7e=="createAccount"&&UserInfo["openID"]){
dijit.byId("ModifyAccountForm").submit();
}
setIconList();
dijit.byId("ModifyAccountForm").initialized=true;
}});
dijit.byId("AccountPane").forward();
dojo.html.set(dojo.byId("LoginMessageBox"),"<p>Welcome "+UserInfo["userName"]+"</p>"+"<p id=\"Notice\">"+(UserInfo["isBirthday"]?"Happy birthday!":"")+"</p>");
dojo.html.set(dojo.byId("AccountName"),UserInfo["userName"]);
var _8f=Dynamics["LoginLogoutSubmit"];
_8f.title="Logout of Antichrist Watch";
_8f.setLabel("Logout");
dojo.style("RegisterForm","display","none");
dijit.byId("LoginDialog").hide();
dijit.byId("CreateAccountDialog").hide();
UserInfo["rememberMe"]=dijit.byId("LoginRememberMe").getValue()=="on";
if(UserInfo["rememberMe"]){
dojo.cookie("credentials",rot13(UserInfo["userName"])+" "+UserInfo["token"]);
}
var _90=dijit.byId("AccountPane");
dijit.byId("ContentTabs").selectChild(_90);
refreshNode(_90);
if(_7e=="createAccount"){
dijit.byId("ContentTabs").selectChild(dijit.byId("AccountPane"));
saveState("AccountPane");
var _91="Your account has been created.";
if(!UserInfo["email"]){
_91+="<br />Unless you're 100% sure of your memory, it's probably a good idea to enter your e-mail address.";
}
dijit.byId("SetupAccountDialog").hide();
dojo.html.set(dojo.byId("StatusMessageBox"),_91);
dijit.byId("StatusDialog").show();
}else{
if(_7e=="loginOneShot"&&!UserInfo["openID"]){
dijit.byId("ContentTabs").selectChild(dijit.byId("AccountPane"));
saveState("AccountPane");
var _91="Please choose a new password.";
dijit.byId("SetupAccountDialog").hide();
dojo.html.set(dojo.byId("StatusMessageBox"),_91);
dijit.byId("StatusDialog").show();
}else{
dijit.byId("ContentTabs").selectChild(dijit.byId("VotePane"));
saveState("VotePane");
}
}
}
},error:function(_92){
_83(_92);
},timeout:23000};
dojo.xhrGet(_86);
return false;
};
return _7f;
};
var login=authenticateUser("login");
var loginFromCookie=authenticateUser("loginFromCookie");
var loginOneShot=authenticateUser("loginOneShot");
var createAccount=authenticateUser("createAccount");
function loginOrLogout(){
if(UserInfo["loggedIn"]){
logout();
}else{
dijit.byId("LoginDialog").show();
}
};
function doNotCreateAccount(){
dijit.byId("LoginDialog").hide();
dijit.byId("CreateAccountDialog").hide();
return false;
};
function setupNewAccountBase(){
dojo.style("SetupAccountOpenIDs","display","none");
dojo.style(dijit.byId("SetupAccountOpenIDButton").domNode,"display","block");
dojo.style("SetupAccountPasswords","display","block");
dijit.byId("SetupAccountDialog").show();
return false;
};
function setupNewAccount(){
dijit.byId("SetupAccountForm").initialized=false;
dijit.byId("CreateAccountDialog").hide();
setupNewAccountBase();
dijit.byId("SetupAccountForm").initialized=true;
return false;
};
function setupNewAccountViaOpenID(){
dijit.byId("SetupAccountForm").initialized=false;
dojo.style("SetupAccountOpenIDs","display","block");
dojo.style(dijit.byId("SetupAccountOpenIDButton").domNode,"display","none");
dijit.byId("SetupAccountOpenID").setValue(UserInfo["openID"]);
var _93=UserInfo["nickname"];
if(!_93){
var _94=UserInfo["openID"].lastIndexOf("/")+1;
if(_94){
var _93=UserInfo["openID"].substr(_94);
}
}
newRandomPassword=String(Math.random()*10000000000000);
dijit.byId("SetupAccountPassword").setValue(newRandomPassword);
dijit.byId("SetupAccountPasswordDup").setValue(newRandomPassword);
dijit.byId("SetupAccountUserName").setValue(_93);
dojo.style("SetupAccountPasswords","display","none");
dijit.byId("SetupAccountDialog").show();
dijit.byId("SetupAccountForm").initialized=true;
return false;
};
function setupNewOpenIDAccount(){
dijit.byId("SetupAccountForm").initialized=false;
dijit.byId("OpenIdDialog").hide();
dijit.byId("SetupAccountDialog").show();
dijit.byId("SetupAccountUserName").setValue(dijit.byId("LoginUserName").getValue());
dijit.byId("SetupAccountPassword").setValue("");
dijit.byId("SetupAccountPasswordDup").setValue("");
dojo.style("SetupAccountOpenIDs","display","block");
dojo.style(dijit.byId("SetupAccountOpenIDButton").domNode,"display","none");
dojo.style("SetupAccountPasswords","display","none");
if(dijit.byId("LoginRememberMe").getValue()=="on"){
dijit.byId("SetupAccountRememberMe").setValue("on");
}
dijit.byId("SetupAccountForm").initialized=true;
return false;
};
function readyOpenID(_95){
dijit.byId("new_openid").setValue(_95);
dijit.byId("SetupAccountDialog").hide();
dijit.byId("LoginDialog").hide();
dijit.byId("ManageOpenIdsDialog").hide();
dijit.byId("OpenIdDialog").show();
};
function verifyOpenID(){
var _96=null;
UserInfo["openID"]=dijit.byId("openid_url").getValue();
if(dijit.byId("new_openid").getValue()){
var _97="&use_sreg=1&use_pape=1";
}else{
var _97="";
}
if(UserInfo["userName"]){
_97+="&a="+encodeURI(UserInfo["userName"]);
}
if(UserInfo["token"]){
_97+="&T="+encodeURI(UserInfo["token"]);
}
if(!UserInfo["openID"]){
dojo.html.set(dojo.byId("StatusMessageBox"),"You do not currently have an active OpenID.");
dijit.byId("OpenIdDialog").hide();
dijit.byId("StatusDialog").show();
}else{
window.location="openIdCheck?stage=verify"+_97+"&openid_url="+UserInfo["openID"];
}
return false;
};
function manageOpenIDs(){
var _98={url:"getOpenIDs?T="+encodeURI(UserInfo["token"])+"&R="+encodeURI(rot13(UserInfo["userName"])),handleAs:"json",load:function(_99){
openIdDisplayStr="<ul>";
dojo.forEach(_99.items,function(_9a){
openIdDisplayStr+="<li>"+_9a.openid_url+" <button type=\"button\" class=\"BasicButton\" onclick=\"detachOpenID('"+_9a.openid_url+"');return false;\">Delete</button></li>";
});
openIdDisplayStr+="</ul>";
dojo.html.set(dojo.byId("OpenIdList"),openIdDisplayStr);
dijit.byId("ManageOpenIdsDialog").show();
try{
dojo.behavior.apply();
}
catch(err){
}
},error:function(_9b){
if(_9b.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your OpenID display timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),"There was a problem and your OpenIDs could not be displayed.  Please try again later.");
}
dijit.byId("StatusDialog").show();
},timeout:23000};
dojo.xhrPost(_98);
};
function attachOpenID(_9c){
openIdURL=_9c.canonicalID;
var _9d={url:"attachOpenID?T="+encodeURI(UserInfo["token"])+"&R="+encodeURI(rot13(UserInfo["userName"]))+"&O="+encodeURI(openIdURL),handleAs:"json",load:function(_9e){
dojo.html.set(dojo.byId("StatusMessageBox"),"OpenID "+openIdURL+" attached to "+UserInfo["userName"]+".");
dijit.byId("ManageOpenIdsDialog").hide();
dijit.byId("StatusDialog").show();
},error:function(_9f){
if(_9f.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your attachment timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),"There was a problem and your OpenID was not attached.  Please try again later.");
}
dijit.byId("ManageOpenIdsDialog").hide();
dijit.byId("StatusDialog").show();
},timeout:23000};
var _a0=_9c;
if(UserInfo["userName"]){
_a0=dojo.xhrPost(_9d);
}
return _a0;
};
function detachOpenID(_a1){
var _a2={url:"detachOpenID?T="+encodeURI(UserInfo["token"])+"&R="+encodeURI(rot13(UserInfo["userName"]))+"&O="+encodeURI(_a1),handleAs:"json",load:function(_a3){
dojo.html.set(dojo.byId("StatusMessageBox"),"OpenID "+_a1+" detached from "+UserInfo["userName"]+".");
dijit.byId("ManageOpenIdsDialog").hide();
dijit.byId("StatusDialog").show();
},error:function(_a4){
if(_a4.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your detachment timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),"There was a problem and your OpenID was not detached.  Please try again later.");
}
dijit.byId("ManageOpenIdsDialog").hide();
dijit.byId("StatusDialog").show();
},timeout:23000};
dojo.xhrPost(_a2);
return false;
};
function editUserAccount(){
var _a5=dijit.byId("ModifyAccountForm").initialized;
var _a6={url:"editAccount?T="+encodeURI(UserInfo["token"])+"&R="+encodeURI(rot13(UserInfo["userName"])),handleAs:"json",load:function(_a7){
if(_a7.error){
if(_a5){
dojo.html.set(dojo.byId("StatusMessageBox"),responseObj.error);
}
}else{
if(_a5){
dojo.html.set(dojo.byId("StatusMessageBox"),"New account settings have been saved.");
}
}
dijit.byId("StatusDialog").show();
dijit.byId("EditAccountSubmit").cancel();
},error:function(_a8){
if(_a8.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your edit timed out.  Please try again later.");
}else{
if(_a8.error){
dojo.html.set(dojo.byId("StatusMessageBox"),responseObj.error);
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),"There was a problem and your settings have not been saved.  Please try again later.");
}
}
dijit.byId("StatusDialog").show();
dijit.byId("EditAccountSubmit").cancel();
},timeout:23000,content:{"UserDescription":dijit.byId("UserDescription").getValue(),"UserState":dijit.byId("UserStateOrProvince").getDisplayedValue()},form:"ModifyAccountForm"};
dojo.xhrPost(_a6);
return false;
};
function refreshNode(_a9){
dojo.forEach(["Daily","Weekly","Monthly","Yearly","Total","Recent"],function(_aa){
if(_a9.id==_aa+"ListGrid"){
_a9.setStore(_a9.store);
}else{
if(_a9.id==_aa+"TopPicks"){
drawPieCharts(_a9);
}
}
});
dojo.forEach(_a9.getDescendants(),function(_ab){
refreshNode(_ab);
});
if(_a9.id=="RecentPicksPane"){
drawBarCharts();
}else{
if(_a9.id=="ModifyAccountPanel"){
if(!Dynamics["UserDescription"]){
Dynamics["UserDescription"]=new dijit.Editor({name:"UserDescription",height:"5em",inheritWidth:true},dojo.byId("UserDescription"));
}else{
Dynamics["UserDescription"].resize();
}
}
}
if(_a9.resize){
_a9.resize();
}
};
function getSessionInfo(_ac){
var _ad=null;
var _ae={url:"getSessionInfo?UID="+encodeURI(_ac),handleAs:"json",load:function(_af){
var _b0=_af.resultMessage;
if(_b0){
if(_b0=="Sorry, your session has expired."){
dojo.cookie("TWISTED_SESSION",null,{expires:-1});
dojo.html.set(dojo.byId("StatusMessageBox"),_b0);
throw Error("Session Expired");
}else{
UserInfo["openID"]=_af.canonicalID;
dojo.forEach(["nickname","fullname","email","country","dob","gender","language","userName","token"],function(_b1){
UserInfo[_b1]=_af[_b1];
});
}
}
return _af;
},error:function(_b2){
if(_b2.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your session transfer timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),_b2.resultMessage);
}
dijit.byId("StatusDialog").show();
},timeout:23000};
_ad=dojo.xhrGet(_ae);
return _ad;
};
function processOpenIdInfo(_b3){
var _b4=null;
var _b5={url:"getOpenIdLoginKey?O="+encodeURI(UserInfo["openID"]||_b3.canonicalID),handleAs:"json",load:function(_b6){
if(_b6["user_name"]&&_b6["one_shot_key"]){
UserInfo["userName"]=_b6["user_name"];
UserInfo["token"]=_b6["one_shot_key"];
loginOneShot();
}else{
setupNewAccountViaOpenID();
}
},error:function(_b7){
if(_b7.dojoType=="timeout"){
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry; your OpenID data fetch timed out.  Please try again later.");
}else{
dojo.html.set(dojo.byId("StatusMessageBox"),_b7.resultMessage);
}
dijit.byId("StatusDialog").show();
},timeout:23000};
_b4=dojo.xhrGet(_b5);
return _b4;
};
function processSessionError(_b8){
console.log("processSessionError ",_b8);
dojo.html.set(dojo.byId("StatusMessageBox"),"Sorry, your session has expired.");
};
function removeHider(){
dojo.fadeOut({node:"PageHider",duration:250,onEnd:function(){
dojo.style("PageHider","display","none");
}}).play();
};
function saveState(_b9,arg){
var _ba=_b9.slice(0,-4);
if(arg){
_ba+="/"+encodeURI(arg);
}else{
if(_b9=="TopPicksPane"){
_ba+="/"+encodeURI("WeeklyTopPicks");
}
}
var _bb={handle:function(_bc){
switch(_b9){
case "TopPicksPane":
if(!arg){
arg="WeeklyTopPicks";
}
dijit.byId("TopPicksSubPane").selectChild(arg);
break;
case "LookUpPane":
dijit.byId("AntichristLookUpName").setValue(arg);
dijit.byId("LookUpForm").submit();
break;
}
dijit.byId("ContentTabs").selectChild(_b9);
},changeUrl:_ba};
dojo.back.addToHistory(_bb);
Tracker.trackPageView("/"+_ba);
};
function startUp(){
dojo.require("dojo.cookie");
dojo.require("dojo.html");
dojo.require("dijit.Tree");
dojo.require("dijit.Editor");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dojox.data.QueryReadStore");
dojo.require("dojox.grid.DataGrid");
dojo.require("dojox.charting.Theme");
dojo.require("dojox.charting.widget.Chart2D");
dojo.require("dojox.charting.Chart2D");
dojo.require("dojox.charting.scaler.linear");
dojo.require("dojox.encoding.digests.MD5");
dojo.require("dojox.analytics.Urchin");
var _bd={handle:function(_be){
dijit.byId("ContentTabs").selectChild("VotePane");
}};
dojo.back.setInitialState(_bd);
dojo.addOnLoad(function(){
Tracker=new dojox.analytics.Urchin({acct:"UA-69205-6"});
var _bf=dijit.byId("ContentTabs");
dojo.connect(Dynamics["TopPicksNextButton"],"onClick",null,function(_c0){
var _c1=dijit.byId("TopPicksSubPane");
_c1.back();
refreshNode(_c1.selectedChildWidget);
saveState("TopPicksPane",_c1.selectedChildWidget.id);
});
dojo.connect(Dynamics["TopPicksPreviousButton"],"onClick",null,function(_c2){
var _c3=dijit.byId("TopPicksSubPane");
_c3.forward();
refreshNode(_c3.selectedChildWidget);
saveState("TopPicksPane",_c3.selectedChildWidget.id);
});
dojo.connect(_bf.tablist,"onButtonClick",null,function(_c4){
if(_c4.id=="TopPicksPane"){
refreshNode(dijit.byId("TopPicksSubPane").selectedChildWidget);
}else{
if(_c4.id=="RecentPicksPane"){
refreshNode(_c4);
}
}
saveState(_c4.id);
});
UserInfo["userName"]=getQueryVariable("U");
dijit.byId("LoginUserName").setValue(UserInfo["userName"]);
UserInfo["token"]=getQueryVariable("K");
if(UserInfo["userName"]&&UserInfo["token"]){
loginOneShot();
}
var _c5=dojo.cookie("credentials");
if(_c5){
_c5=_c5.split(" ");
UserInfo["userName"]=rot13(_c5[0]);
dijit.byId("LoginUserName").setValue(UserInfo["userName"]);
UserInfo["token"]=_c5[1];
if(UserInfo["token"]){
loginFromCookie();
}
}
var _c6=setTimeout(removeHider,175);
dijit.byId("ModerationRemark").onChange=setModerationRemark;
dijit.byId("UserEMailAddress").onChange=setIconList;
dijit.byId("UserHomePage").onChange=setIconList;
dijit.byId("UserSex").onChange=setIconList;
dijit.byId("LoginRememberMe").onChange=toggleRememberMe;
dijit.byId("SetupAccountUserName").onChange=function(_c7){
dijit.byId("LoginUserName").setValue(_c7);
};
var _c8=dojo.cookie("TWISTED_SESSION");
if(_c8){
console.log("Got a TWISTED_SESSION");
var _c9=getSessionInfo(_c8);
_c9.addErrback(processSessionError);
_c9.addCallback(attachOpenID);
_c9.addCallback(processOpenIdInfo);
}
});
};
var Dynamics=Object();
dojo.behavior.add({"#Warning":function(_ca){
dojo.style(_ca,{"visibility":"hidden","display":"none"});
},".BasicCheckBox":function(_cb){
Dynamics[_cb.id]=new dijit.form.CheckBox({type:_cb.type},_cb);
},".BasicRadioButton":function(_cc){
Dynamics[_cc.id]=new dijit.form.RadioButton({type:_cc.type,name:_cc.name,checked:_cc.checked},_cc);
},".BasicButton":function(_cd){
Dynamics[_cd.id]=new dijit.form.Button({type:_cd.type},_cd);
if(_cd.onclick){
Dynamics[_cd.id].onClick=_cd.onclick;
}
},".OpenIDButton":function(_ce){
Dynamics[_ce.id]=new dijit.form.Button({type:_ce.type,iconClass:"OpenIDButton",showLabel:false},_ce);
dojo.style(dijit.byId(_ce.id).domNode,"float","right");
},".BasicDialog":function(_cf){
Dynamics[_cf.id]=new dijit.Dialog({title:_cf.title},_cf);
},".Person":{onclick:function(evt){
dijit.byId("AntichristLookUpName").setValue(evt.currentTarget.title);
dijit.byId("LookUpForm").submit();
var _d0=dijit.byId("LookUpPane");
dijit.byId("ContentTabs").selectChild(_d0);
saveState("LookUpPane",evt.currentTarget.title);
}},"#RegisterForm":function(_d1){
Dynamics[_d1.id]=new dijit.form.Form({onSubmit:function(evt){
setupNewAccountBase();
return false;
}},_d1);
dojo.style(dijit.byId(_d1.id).domNode,"float","right");
},"#LoginLogoutForm":function(_d2){
Dynamics[_d2.id]=new dijit.form.Form({onSubmit:function(evt){
loginOrLogout();
return false;
}},_d2);
dojo.style(dijit.byId(_d2.id).domNode,"float","right");
},"#MastHead":function(_d3){
Dynamics[_d3.id]=new dijit.layout.ContentPane({title:_d3.title,region:"top",splitter:false,minSize:28},_d3);
Dynamics[_d3.id].startup();
},"#RightWing":function(_d4){
Dynamics[_d4.id]=new dijit.layout.ContentPane({title:_d4.title,region:"right",splitter:false,minSize:120},_d4);
Dynamics[_d4.id].startup();
},"#Footer":function(_d5){
Dynamics[_d5.id]=new dijit.layout.ContentPane({title:_d5.title,region:"bottom",splitter:false,minSize:45},_d5);
Dynamics[_d5.id].startup();
},"#AntichristInputName":function(_d6){
Dynamics[_d6.id]=new dijit.form.ComboBox({type:_d6.type,name:_d6.name,invalidMessage:_d6.title,store:AntichristStore,required:true,autoComplete:false,hasDownArrow:true,searchAttr:"full_name",label:"full_name"},_d6);
},"#VoteSubmit":function(_d7){
Dynamics[_d7.id]=new dojox.form.BusyButton({type:"button",busyLabel:"Voting",label:"Vote",onClick:function(){
dijit.byId("VoteForm").submit();
},width:"6em"},_d7);
dojo.style(dijit.byId(_d7.id).domNode.firstChild.firstChild.firstChild,"width","6em");
},"#VoteForm":function(_d8){
Dynamics[_d8.id]=new dijit.form.Form({onSubmit:function(evt){
vote();
return false;
}},_d8);
},"#VotePane":function(_d9){
Dynamics[_d9.id]=new dijit.layout.ContentPane({title:_d9.title,preload:false,refreshOnShow:true},_d9);
Dynamics[_d9.id].startup();
},".TopPicksSection":function(_da){
Dynamics[_da.id]=new dijit.layout.ContentPane({title:_da.title,preload:false,refreshOnShow:true,label:_da.title},_da);
},"#TopPicksHeaderSubPane":function(_db){
Dynamics[_db.id]=new dijit.layout.ContentPane({title:_db.title,preload:false,region:"top",splitter:false},_db);
Dynamics[_db.id].startup();
},"#TopPicksSubPane":function(_dc){
Dynamics[_dc.id]=new dijit.layout.StackContainer({title:_dc.title,preload:false,region:"center",splitter:false},_dc);
Dynamics[_dc.id].startup();
},"#TopPicksFooterSubPane":function(_dd){
Dynamics[_dd.id]=new dijit.layout.ContentPane({title:_dd.title,preload:false,region:"bottom",splitter:false},_dd);
Dynamics[_dd.id].startup();
},"#TopPicksPane":function(_de){
Dynamics[_de.id]=new dijit.layout.BorderContainer({title:_de.title,preload:false,refreshOnShow:true},_de);
Dynamics[_de.id].startup();
},"#RecentPicksPane":function(_df){
Dynamics[_df.id]=new dijit.layout.ContentPane({title:_df.title,preload:false,refreshOnShow:true},_df);
Dynamics[_df.id].startup();
},"#AntichristLookUpName":function(_e0){
Dynamics[_e0.id]=new dijit.form.ComboBox({type:_e0.type,invalidMessage:_e0.title,store:AntichristStore,required:true,autoComplete:false,hasDownArrow:true,searchAttr:"full_name",label:"full_name"},_e0);
},"#LookUpSubmit":function(_e1){
Dynamics[_e1.id]=new dojox.form.BusyButton({type:"button",busyLabel:"Looking Up Name",label:"Look Up Name",onClick:function(){
dijit.byId("LookUpForm").submit();
},width:"10em"},_e1);
dojo.style(dijit.byId(_e1.id).domNode.firstChild.firstChild.firstChild,"width","10em");
},"#LookUpForm":function(_e2){
Dynamics[_e2.id]=new dijit.form.Form({onSubmit:function(evt){
var _e3=dijit.byId("AntichristLookUpName").getValue();
lookUpName(_e3);
saveState("LookUpPane",_e3);
return false;
}},_e2);
},"#CommentsTreeSubPane":function(_e4){
Dynamics[_e4.id]=new dijit.layout.ContentPane({title:_e4.title,region:"left",splitter:"true",minSize:200},_e4);
Dynamics[_e4.id].startup();
},"#CommentsTextSubPane":function(_e5){
Dynamics[_e5.id]=new dijit.layout.ContentPane({title:_e5.title,region:"center",splitter:"true"},_e5);
Dynamics[_e5.id].startup();
},"#CandidateQuery":function(_e6){
Dynamics[_e6.id]=new dijit.layout.ContentPane({title:_e6.title,region:"top",splitter:false},_e6);
Dynamics[_e6.id].startup();
},"#CandidateDetails":function(_e7){
Dynamics[_e7.id]=new dijit.layout.BorderContainer({title:_e7.title},_e7);
Dynamics[_e7.id].startup();
},"#LookUpPane":function(_e8){
Dynamics[_e8.id]=new dijit.layout.ContentPane({title:_e8.title,preload:false,refreshOnShow:true},_e8);
Dynamics[_e8.id].startup();
},"#DiscussLink":{onclick:function(evt){
var _e9=dijit.byId("LookUpPane");
dijit.byId("ContentTabs").selectChild(_e9);
refreshNode(_e9);
return false;
}},"#LoginLink":function(_ea){
Dynamics[_ea.id]=new dijit.form.Button({type:_ea.type,title:_ea.title,onClick:function(){
dijit.byId("LoginDialog").show();
return false;
}},_ea);
},"#SetupAccountLink":function(_eb){
Dynamics[_eb.id]=new dijit.form.Button({type:_eb.type,title:_eb.title,onClick:function(){
setupNewAccountBase();
return false;
}},_eb);
},"#LoginAccountPanel":function(_ec){
Dynamics[_ec.id]=new dijit.layout.ContentPane({title:_ec.title,preload:false,refreshOnShow:true},_ec);
Dynamics[_ec.id].startup();
},"#UserGivenName":function(_ed){
Dynamics[_ed.id]=new dijit.form.ValidationTextBox({type:_ed.type,name:_ed.name,invalidMessage:_ed.title,required:true,regExp:"[A-Z a-z.,0-9-]+",width:"12em"},_ed);
dojo.style(dijit.byId(_ed.id).domNode,"width","12em");
},"#UserMiddleInitials":function(_ee){
Dynamics[_ee.id]=new dijit.form.ValidationTextBox({type:_ee.type,name:_ee.name,invalidMessage:_ee.title,required:false,regExp:"[A-Z a-z.,0-9-]+",width:"3em"},_ee);
dojo.style(dijit.byId(_ee.id).domNode,"width","3em");
},"#UserSurname":function(_ef){
Dynamics[_ef.id]=new dijit.form.ValidationTextBox({type:_ef.type,name:_ef.name,invalidMessage:_ef.title,required:true,regExp:"[A-Z a-z.,0-9-]+",width:"15em"},_ef);
dojo.style(dijit.byId(_ef.id).domNode,"width","15em");
},"#UserNameSuffix":function(_f0){
Dynamics[_f0.id]=new dijit.form.FilteringSelect({type:_f0.type,name:_f0.name,invalidMessage:_f0.title,required:false,searchAttr:"name_suffix",label:"name_suffix",width:"6em"},_f0);
dojo.style(dijit.byId(_f0.id).domNode,"width","6em");
},"#UserNickname":function(_f1){
Dynamics[_f1.id]=new dijit.form.ValidationTextBox({type:_f1.type,name:_f1.name,invalidMessage:_f1.title,required:false,regExp:"[A-Z a-z.,0-9-]+",width:"10em"},_f1);
dojo.style(dijit.byId(_f1.id).domNode,"width","10em");
},"#UserSex":function(_f2){
Dynamics[_f2.id]=new dijit.form.FilteringSelect({type:_f2.type,name:_f2.name,invalidMessage:_f2.title,required:false,autocomplete:true,width:"7em"},_f2);
dojo.style(dijit.byId(_f2.id).domNode,"width","7em");
},"#UserPassword":function(_f3){
Dynamics[_f3.id]=new dijit.form.ValidationTextBox({type:_f3.type,name:_f3.name,invalidMessage:_f3.title,required:true,regExp:".{4,48}",width:"10em",intermediateChanges:false,onChange:function(evt){
processPassword(_f3.id,dijit.byId("ModifyAccountForm").initialized);
return false;
}},_f3);
dojo.style(dijit.byId(_f3.id).domNode,"width","10em");
},"#UserPasswordDup":function(_f4){
Dynamics[_f4.id]=new dijit.form.ValidationTextBox({type:_f4.type,name:_f4.name,invalidMessage:_f4.title,required:true,regExp:".{4,48}",width:"10em",intermediateChanges:false,onChange:function(evt){
processPasswordDup("UserPassword",dijit.byId("ModifyAccountForm").initialized);
return false;
}},_f4);
dojo.style(dijit.byId(_f4.id).domNode,"width","10em");
},"#UserBirthday":function(_f5){
Dynamics[_f5.id]=new dijit.form.DateTextBox({type:_f5.type,name:_f5.name,invalidMessage:_f5.title,required:false,constraints:{datePattern:"yyyy-MM-dd"},width:"10em"},_f5);
dojo.style(dijit.byId(_f5.id).domNode,"width","10em");
},"#UserEMailAddress":function(_f6){
Dynamics[_f6.id]=new dijit.form.ValidationTextBox({type:_f6.type,name:_f6.name,invalidMessage:_f6.title,required:false,regExp:".+@.+.[A-Za-z0-9]{2,8}",width:"15em"},_f6);
dojo.style(dijit.byId(_f6.id).domNode,"width","15em");
},"#UserHomePage":function(_f7){
Dynamics[_f7.id]=new dijit.form.ValidationTextBox({type:_f7.type,name:_f7.name,invalidMessage:_f7.title,required:false,regExp:"^(http|https|ftp|gopher|svn|ldap)://([a-zA-Z_0-9+-]+[.])+[A-Za-z0-9]{2,8}(/.*)*$",width:"18em"},_f7);
dojo.style(dijit.byId(_f7.id).domNode,"width","18em");
},"#UserStateOrProvince":function(_f8){
Dynamics[_f8.id]=new dijit.form.ComboBox({type:_f8.type,invalidMessage:_f8.title,required:false,autoComplete:false,hasDownArrow:true,searchAttr:"region_name",label:"region_name",width:"14em"},_f8);
dojo.style(dijit.byId(_f8.id).domNode,"width","14em");
Dynamics[_f8.id].setDisplayedValue(_f8.value);
},"#UserCountry":function(_f9){
Dynamics[_f9.id]=new dijit.form.FilteringSelect({type:_f9.type,name:_f9.name,invalidMessage:_f9.title,required:true,searchAttr:"country_name",label:"country_name",width:"11em",onChange:setCountry},_f9);
dojo.style(dijit.byId(_f9.id).domNode,"width","11em");
},"#UserLanguage":function(_fa){
Dynamics[_fa.id]=new dijit.form.FilteringSelect({type:_fa.type,name:_fa.name,invalidMessage:_fa.title,required:true,searchAttr:"language_name",label:"language_name",width:"15em"},_fa);
dojo.style(dijit.byId(_fa.id).domNode,"width","15em");
},"#UserIconSelect":function(_fb){
Dynamics[_fb.id]=new dijit.form.ComboBox({type:_fb.type,name:_fb.name,invalidMessage:_fb.title,required:false,searchAttr:"icon_url",label:"icon_url",width:"32em",onChange:setIcon},_fb);
dojo.style(dijit.byId(_fb.id).domNode,"width","32em");
Dynamics[_fb.id].setValue(_fb.value);
},"#UserDescription":function(_fc){
var _fd=document.createElement("div");
var _fe=_fc.parentNode;
_fe.replaceChild(_fd,_fc);
var _ff=_fc.id;
_fc.setAttribute("id","");
_fd.setAttribute("id",_ff);
},"#EditAccountOpenIDButton":function(node){
Dynamics[node.id]=new dijit.form.Button({type:node.type},node);
dojo.style(dijit.byId(node.id).domNode,"float","right");
Dynamics[node.id].onClick=function(){
manageOpenIDs();
};
},"#EditAccountSubmit":function(node){
Dynamics[node.id]=new dojox.form.BusyButton({type:"button",busyLabel:"Edit Account Settings",label:"Edit Account Settings",onClick:function(){
dijit.byId("ModifyAccountForm").submit();
},width:"13em"},node);
dojo.style(dijit.byId(node.id).domNode.firstChild.firstChild.firstChild,"width","13em");
},"#ModifyAccountForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
editUserAccount();
return false;
}},node);
},"#ModifyAccountPanel":function(node){
Dynamics[node.id]=new dijit.layout.ContentPane({title:node.title,preload:false,refreshOnShow:true},node);
Dynamics[node.id].startup();
},"#AccountPane":function(node){
Dynamics[node.id]=new dijit.layout.StackContainer({title:node.title,preload:false,refreshOnShow:true},node);
Dynamics[node.id].startup();
},"#AddendaPane":function(node){
Dynamics[node.id]=new dijit.layout.ContentPane({title:node.title,preload:false,refreshOnShow:true},node);
Dynamics[node.id].startup();
},"#ContentTabs":function(node){
Dynamics[node.id]=new dijit.layout.TabContainer({title:node.title,region:"center",splitter:false},node);
Dynamics[node.id].startup();
},"#StatusForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
dijit.byId("StatusDialog").hide();
return false;
}},node);
},"#LoginUserName":function(node){
Dynamics[node.id]=new dijit.form.ValidationTextBox({type:node.type,name:node.name,invalidMessage:node.title,required:true,regExp:"[A-Za-z.,0-9-]+"},node);
},"#LoginPassword":function(node){
Dynamics[node.id]=new dijit.form.ValidationTextBox({type:node.type,name:node.name,invalidMessage:node.title,required:true,regExp:".+"},node);
},"#LoginOpenIDButton":function(node){
Dynamics[node.id].onClick=function(){
readyOpenID(false);
};
},"#LoginForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
login();
return false;
}},node);
},"#CreateAccountForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
setupNewAccount();
return false;
},onReset:function(evt){
doNotCreateAccount();
return false;
}},node);
},"#SetupAccountOpenID":function(node){
Dynamics[node.id]=new dijit.form.TextBox({type:node.type,name:node.name,invalidMessage:node.title,disabled:true},node);
dojo.style(Dynamics[node.id].domNode,"width","18em");
},"#SetupAccountUserName":function(node){
Dynamics[node.id]=new dijit.form.ValidationTextBox({type:node.type,name:node.name,invalidMessage:node.title,required:true,regExp:"[A-Za-z.,0-9-]{3,48}"},node);
},"#SetupAccountPassword":function(node){
Dynamics[node.id]=new dijit.form.ValidationTextBox({type:node.type,name:node.name,invalidMessage:node.title,required:true,regExp:".{4,48}",intermediateChanges:false,onChange:function(evt){
processPassword(node.id,dijit.byId("SetupAccountForm").initialized);
return false;
}},node);
dojo.style(dijit.byId(node.id).domNode,"width","10em");
},"#SetupAccountPasswordDup":function(node){
Dynamics[node.id]=new dijit.form.ValidationTextBox({type:node.type,name:node.name,invalidMessage:node.title,required:true,regExp:".{4,48}",intermediateChanges:false,onChange:function(evt){
processPasswordDup("SetupAccountPassword",dijit.byId("SetupAccountForm").initialized);
return false;
}},node);
dojo.style(dijit.byId(node.id).domNode,"width","10em");
},"#SetupAccountOpenIDButton":function(node){
Dynamics[node.id].onClick=function(){
readyOpenID(true);
};
},"#SetupAccountForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
createAccount();
return false;
}},node);
},"#AttachNewOpenIDButton":function(node){
Dynamics[node.id]=new dijit.form.Button({type:node.type},node);
dojo.style(dijit.byId(node.id).domNode,"float","right");
Dynamics[node.id].onClick=function(){
readyOpenID(true);
};
},"#ManageOpenIdForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
dijit.byId("ManageOpenIdsDialog").hide();
return false;
}},node);
},"#new_openid":function(node){
Dynamics[node.id]=new dijit.form.TextBox({type:node.type,name:node.name,required:false},node);
dojo.style(dijit.byId(node.id).domNode,"display","none");
},"#openid_url":function(node){
Dynamics[node.id]=new dijit.form.ValidationTextBox({type:node.type,name:node.name,invalidMessage:node.title,regExp:"^(http[s]?|xri)://[A-Z:;/a-z.,0-9-]+",required:true},node);
dojo.style(Dynamics[node.id].domNode,"width","18em");
},"#OpenIdForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
verifyOpenID();
return false;
}},node);
},"#ReplyToID":function(node){
Dynamics[node.id]=new dijit.form.TextBox({type:node.type,name:node.name,required:false},node);
dojo.style(dijit.byId(node.id).domNode,"display","none");
},"#PostCommentTitle":function(node){
Dynamics[node.id]=new dijit.form.ValidationTextBox({type:node.type,name:node.name,invalidMessage:node.title,required:true,regExp:".+"},node);
},"#CommentText":function(node){
var _100=document.createElement("div");
var _101=node.parentNode;
_101.replaceChild(_100,node);
var _102=node.id;
node.setAttribute("id","");
_100.setAttribute("id",_102);
},"#PostCommentForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
applyPosting();
return false;
}},node);
},"#ModerateCommentForm":function(node){
Dynamics[node.id]=new dijit.form.Form({onSubmit:function(evt){
applyModeration();
return false;
}},node);
},"#ModerationRemark":function(node){
Dynamics[node.id]=new dijit.form.FilteringSelect({type:node.type,name:node.name,invalidMessage:node.title,required:true,searchAttr:"remark",label:"remark",width:"12em"},node);
dojo.style(dijit.byId(node.id).domNode,"width","12em");
},"#ModerationValue":function(node){
Dynamics[node.id]=new dijit.form.TextBox({type:node.type,name:node.name},node);
},"#PageWrapper":function(node){
Dynamics[node.id]=new dijit.layout.BorderContainer({title:node.title,splitter:false},node);
Dynamics[node.id].startup();
}});
dojo.addOnLoad(startUp);
}


