var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
Object.extend=function(_1,_2){
for(property in _2){
_1[property]=_2[property];
}
return _1;
};
Function.prototype.bind=function(_3){
var _4=this;
return function(){
return _4.apply(_3,arguments);
};
};
Function.prototype.bindAsEventListener=function(_5){
var _6=this;
return function(_7){
_6.call(_5,_7||window.event);
};
};
function $(){
if(arguments.length==1){
return get$(arguments[0]);
}
var _8=[];
$c(arguments).each(function(el){
_8.push(get$(el));
});
return _8;
function get$(el){
if(typeof el=="string"){
el=document.getElementById(el);
}
return el;
}
}
if(!window.Element){
var Element=new Object();
}
Object.extend(Element,{remove:function(_b){
_b=$(_b);
_b.parentNode.removeChild(_b);
},hasClassName:function(_c,_d){
_c=$(_c);
if(!_c){
return;
}
var _e=false;
_c.className.split(" ").each(function(cn){
if(cn==_d){
_e=true;
}
});
return _e;
},addClassName:function(_10,_11){
_10=$(_10);
Element.removeClassName(_10,_11);
_10.className+=" "+_11;
},removeClassName:function(_12,_13){
_12=$(_12);
if(!_12){
return;
}
var _14="";
_12.className.split(" ").each(function(cn,i){
if(cn!=_13){
if(i>0){
_14+=" ";
}
_14+=cn;
}
});
_12.className=_14;
},cleanWhitespace:function(_17){
_17=$(_17);
$c(_17.childNodes).each(function(_18){
if(_18.nodeType==3&&!/\S/.test(_18.nodeValue)){
Element.remove(_18);
}
});
},find:function(_19,_1a){
_19=$(_19)[_1a];
while(_19.nodeType!=1){
_19=_19[_1a];
}
return _19;
}});
var Position={cumulativeOffset:function(_1b){
var _1c=0,valueL=0;
do{
_1c+=_1b.offsetTop||0;
valueL+=_1b.offsetLeft||0;
_1b=_1b.offsetParent;
}while(_1b);
return [valueL,_1c];
}};
document.getElementsByClassName=function(_1d){
var _1e=document.getElementsByTagName("*")||document.all;
var _1f=[];
$c(_1e).each(function(_20){
if(Element.hasClassName(_20,_1d)){
_1f.push(_20);
}
});
return _1f;
};
Array.prototype.iterate=function(_21){
for(var i=0;i<this.length;i++){
_21(this[i],i);
}
};
if(!Array.prototype.each){
Array.prototype.each=Array.prototype.iterate;
}
function $c(_23){
var _24=[];
for(var i=0;i<_23.length;i++){
_24.push(_23[i]);
}
return _24;
}
var Ajax={};
Ajax.Request=Class.create();
Ajax.Request.prototype={initialize:function(url,_27){
this.transport=this.getTransport();
this.postBody=_27.postBody||"";
this.method=_27.method||"post";
this.onSuccess=_27.onSuccess||null;
this.onFailure=_27.onFailure||null;
this.update=$(_27.update)||null;
this.request(url);
},request:function(url){
this.transport.open(this.method,url,true);
this.transport.onreadystatechange=this.onStateChange.bind(this);
if(this.method=="post"){
this.transport.setRequestHeader("Content-type","application/x-www-form-urlencoded");
if(this.transport.overrideMimeType){
this.transport.setRequestHeader("Connection","close");
}
}
this.transport.send(this.postBody);
},onStateChange:function(){
if(this.transport.readyState!=4){
return;
}
if(this.transport.status&&this.transport.status>=200&&this.transport.status<300){
if(this.onSuccess){
setTimeout(function(){
this.onSuccess(this.transport);
}.bind(this),10);
}
if(this.update){
setTimeout(function(){
this.update.innerHTML=this.transport.responseText;
}.bind(this),10);
}
}else{
if(this.onFailure){
setTimeout(function(){
this.onFailure(this.transport);
}.bind(this),10);
}
}
this.transport.onreadystatechange=function(){
};
},getTransport:function(){
if(window.ActiveXObject){
return new ActiveXObject("Microsoft.XMLHTTP");
}else{
if(window.XMLHttpRequest){
return new XMLHttpRequest();
}else{
return false;
}
}
}};
function test(_29){
for(var ii=0;ii<_29.length;++ii){
document.write("&#"+String(_29[ii])+";");
}
}
function ffcc_comment(_2b,_2c,_2d,_2e,_2f){
document.write("<span><span class=\"none\"><button class=\"rctrl\" onclick='ff_toggle(this.parentNode, this.parentNode.nextSibling)'>"+_2d+"</button></span><span class=\"hidden\"><button class=\"rctrl\" onclick='ff_toggle(this.parentNode, this.parentNode.previousSibling); "+_2f+"(\""+_2e+"\","+"this.parentNode.lastChild.value)'>OK</button><button class=\"rctrl\" onclick='ff_toggle(this.parentNode, this.parentNode.previousSibling)'>CANCEL</button><br><span class=\"note\">First line is the title. Max length is 4K. <strong>Do not use HTML.</strong> Spacing will be preserved.</span><br><textarea class=\"entry\" cols=\""+String(_2b)+"\" rows=\""+String(_2c)+"\"></textarea></span></span>");
}
function ffcc_create(_30,_31){
function _success(l){
top.location.href=ff_sess_url(ffs,l,nclass);
}
_31=ffstrip(_31);
if(_31){
ffs.request("s",["_rsC",_30],_31,_success,function(e){
alert("Error: "+e);
});
}
}
function ffcc_append(_34,_35){
node=ff_skip_spacers($("postblock").childNodes,0);
node=ff_skip_spacers(node.childNodes,0);
function _success(p){
var div=ff_build("div");
div.innerHTML=p;
ff_localize(div,"ts");
$("comments").appendChild(div);
}
_35=ffstrip(_35);
if(_35){
ffs.request("s",["_rsA",_34,node.id],_35,_success,function(e){
alert("Error: "+e);
});
}
}
function ffc_login(){
document.write("<p><label accesskey=\"L\">Login: </label>"+"<input class=\"login\" type=\"text\" size=\"15\"><br>"+"<label accesskey=\"P\">Password:</label>"+"<input class=\"login\" type=\"password\" size=\"15\"><br>"+"<label accesskey=\"R\" class=\"highlight\">Retype Password (New Accounts Only).       <strong>Do not forget your password -- there is no way to get it back.</strong></label>"+"<input class=\"login\" type=\"password\" size=\"15\"><br>"+"<button class=\"ok\">OK</button>"+"<button class=\"cancel\">Cancel</button></p>");
}
function ffcl_is(){
if(ffs.is_auth()){
ff_subst(lshow,"Sign Out","highlight");
}
}
function ffcl_nav(a){
top.location.href=ff_sess_url(ffs,a.href,nclass);
return false;
}
function ffcl_l(_3a,_3b){
var _3c=false;
if(_3b[2].value){
if(_3b[2].value!=_3b[1].value){
lstat.write("Passwords do not match");
_ffcl_rc(_3b);
return;
}
_3c=true;
}
ffs.open(_3b[0].value,_3b[1].value,function(s){
ff_toggle(login,lshow);
ff_subst(lshow,"Sign Out","highlight");
_3b[0].value="";
lstat.write("");
},function(m){
lstat.write(m);
},_3c);
_ffcl_rc(_3b);
}
function ffcl_lc(_3f,_40){
ff_toggle(login,lshow);
_40[0].value="";
_ffcl_rc(_40);
lstat.write("");
}
function ffcl_sc(){
if(ffs.is_auth()){
ffs.drop(function(r){
});
ff_subst(lshow,"Sign In/New Acct","dialog");
}else{
ff_toggle(lshow,login);
}
}
function _ffcl_rc(_42){
_42[1].value="";
_42[2].value="";
}
var _ff_digg_url="http://digg.com/submit";
function ffcv_submit_digg(_43,_44,_45){
var pt=ff_ptitle(_43,75,true);
var pb=ff_pbody(_43,350,true);
window.open(_ff_digg_url+"?phase=2&url="+ff_purl(_43,_44,true)+(pt?"&title="+pt:"")+(pb?"&bodytext="+pb:"")+"&topic="+_45);
}
function ffcv_vote(_48,_49,_4a){
_48=ff_skip_spacers(_48.childNodes,0);
rating=ff_cls_nodes(_48,"rating")[0];
function _success(r){
rating.firstChild.deleteData(0,rating.firstChild.data.length);
rating.firstChild.appendData(r);
}
ffs.request("s",["_rsR",_49,_48.id,_4a],"1",_success,function(e){
alert("Error: "+e);
});
}
function ff_localize(_4d,_4e){
dates=ff_cls_nodes(_4d,_4e);
for(var ii=0;ii<dates.length;++ii){
var _50=dates[ii];
var dv=new Date(Number(_50.firstChild.data)*1000);
_50.firstChild.data=dv.toLocaleString();
}
}
function ff_localize_global(_52){
var dv=null;
ff_class_act(_52,function(_54){
dv=new Date(Number(_54.firstChild.data)*1000);
_54.firstChild.data=dv.toLocaleString();
});
}
function ff_dialog(_55,_56,_57){
var _58=ff_cls_nodes(_55,_56);
for(name in _57){
_ff_dialog(ff_cls_nodes(_55,name)[0],_57[name],_58);
}
}
function _ff_dialog(_59,_5a,_5b){
_59.onclick=function(){
_5a(_59,_5b);
};
}
function ff_skip_spacers(_5c,_5d){
if(_5c[_5d].nodeName!="#text"){
return _5c[_5d];
}
if(_5c[_5d+1].nodeName!="#text"){
return _5c[_5d+1];
}
if(_5c[_5d+2].nodeName!="#text"){
return _5c[_5d+2];
}
return null;
}
function ff_build(_5e,_5f,_60){
if(_5e=="text"){
return document.createTextNode(_5f);
}
elem=document.createElement(_5e);
if(_5f!=null){
for(opt in _5f){
elem[opt]=_5f[opt];
}
}
if(_60!=null){
for(var ii=0;ii<_60.length;++ii){
elem.appendChild(_60[ii]);
}
}
return elem;
}
function ff_edit(_62,_63){
if(_62.nodeName!="#text"){
return true;
}
var _64=_62.parentNode;
var ec=ff_build("textarea",{name:"",rows:"5",cols:"10",value:_62.data});
var btn=ff_build("button",{value:"OK",onclick:function(){
_62.data=ec.value;
_64.insertBefore(_62,ec);
_64.removeChild(ec);
_64.removeChild(btn);
}});
_64.insertBefore(btn,_62);
_64.insertBefore(ec,_62);
_64.removeChild(_62);
return true;
}
function ff_subst(_67,_68,cls){
_67.firstChild.data=_68;
_67.className=cls;
}
function ff_toggle(_6a,_6b){
var _6c=_6b.className;
_6b.className=_6a.className;
_6a.className=_6c;
}
function ff_cls_nodes(_6d,_6e){
var _6f=[];
for(var ii=0;ii<_6d.childNodes.length;++ii){
if(_6d.childNodes[ii].className==_6e){
_6f.push(_6d.childNodes[ii]);
}
_6f=_6f.concat(ff_cls_nodes(_6d.childNodes[ii],_6e));
}
return _6f;
}
function ff_class_act(_71,_72){
var _73=document.getElementsByTagName("*")||document.all;
for(var ii=0;ii<_73.length;++ii){
if(_73[ii].className==_71){
_72(_73[ii]);
}
}
}
function ff_get_param(_75,_76){
if(_76==null){
_76=top.location.search;
}
var _77=_76.indexOf(_75+"=");
if(_77<0){
return null;
}
_77+=_75.length+1;
var end=_76.indexOf("&");
if(end<0){
return _76.substring(_77);
}else{
return _76.substring(_77,end);
}
}
function ff_form_elem(_79,_7a,_7b,el,def){
var inp;
if(_7a=="button"){
inp=ff_build("button",_7b,[ff_build("text",_79)]);
_79=null;
}else{
inp=ff_build("input",_7b);
inp.type=_7a;
}
if(el!=null){
el.push([_79,inp]);
}
if(def){
inp.value=def;
}
if(_79){
return [ff_build("label",null,[ff_build("text",_79)]),inp,ff_build("br")];
}else{
return [inp,ff_build("br")];
}
}
function ff_ptitle(_7f,_80,_81){
var _82=_7f.getElementsByTagName("p")[0];
return _ff_pext(_82,"strong",_80,_81);
}
function ff_pbody(_83,_84,_85){
return _ff_pext(_83,"pre",_84,_85);
}
function ff_purl(_86,_87,_88){
var _89=ff_skip_spacers(_86.childNodes,0);
var url=top.location.host+"/"+_87+"/"+_89.id+".html";
if(_88){
return encodeURIComponent(url);
}else{
return url;
}
}
function _ff_pext(_8b,tag,_8d,_8e){
var _8f=_8b.getElementsByTagName(tag)[0];
if(_8f.firstChild==null){
return "";
}
var _90=_ff_all_text(_8f);
if(_8d){
_90=_90.substring(0,_8d);
}
if(_8e){
return encodeURIComponent(_90);
}else{
return _90;
}
}
function _ff_all_text(_91){
var _92="";
for(var ii=0;ii<_91.childNodes.length;++ii){
var n=_91.childNodes[ii];
if(n.nodeName=="#text"){
_92+=n.data;
}else{
_92+=_ff_all_text(n);
}
}
return _92;
}
var FFldimg=Class.create();
FFldimg.prototype={initialize:function(_95,_96,_97,_98){
this._session=_95;
this._ltags=_96;
this._stags=_97;
this._spinner=_98;
},load:function(_99,_9a,_9b,_9c){
var _9d=this;
var _9e=null;
if(_9c){
_9e=function(){
_9c("l");
};
}
if(_9b==null){
_9b="";
}
_9b=ffstrip(_9b);
if(_9b){
this._session.request("s",this._stags.concat(_9a),_9b,function(r){
ff_ldimg(_99,_9d._session.get_url("l",_9d._ltags.concat(_9a)),_9e,_9d._spinner);
},function(e){
if(_9c){
_9c("s");
}
});
}else{
ff_ldimg(_99,_9d._session.get_url("l",_9d._ltags.concat(_9a)),_9e,_9d._spinner);
}
}};
function ff_ldimg(_a1,url,_a3,_a4){
img=ff_build("img");
if(_a1.childNodes.length){
_a1.replaceChild(img,_a1.firstChild);
}else{
_a1.appendChild(img);
}
if(_a4){
img.src=_a4;
}
if(_a3){
img.onerror=function(){
_a1.removeChild(img);
_a3();
};
}
img.src=url;
}
var FFSession=Class.create();
FFSession.prototype={initialize:function(_a5,_a6,_a7){
this._proto=_a5;
this._ds=_a6;
if(_a7!=null){
this._session=_a7;
}else{
this._session=_a6;
}
},open:function(_a8,_a9,sf,ef,_ac){
var _ad=this;
var _sf=function(_af){
_ad._session=_af;
sf(_af);
};
this.drop(function(r){
});
if(_ac){
this._proto.request("","s",["_login",_a8],_a9,_sf,ef);
}else{
this._proto.request("","o",["_login",_a8],_a9,_sf,ef);
}
},drop:function(sf,ef){
if(this._session!=this._ds){
this._proto.request(this._session,"d",["_login"],"",sf,ef);
this._session=this._ds;
}
},is_active:function(){
return this._session!=null;
},is_auth:function(){
return this._session!=this._ds;
},get_url:function(op,_b4,_b5){
if(this._session==null){
return null;
}
return this._proto.get_url(this._session,op,_b4,_b5);
},request:function(op,_b7,_b8,sf,ef){
if(this._session==null){
ef("No session open");
}else{
this._proto.request(this._session,op,_b7,_b8,sf,ef);
}
}};
function ff_sess_links(_bb,cls){
var _bd="";
var qss=null;
if(_bb.is_auth()){
_bd="?"+cls+"="+String(_bb._session);
}
ff_class_act(cls,function(_bf){
qss=_bf.href.indexOf("?");
if(qss>=0){
_bf.href=_bf.href.substring(0,qss)+_bd;
}else{
_bf.href+=_bd;
}
});
}
function ff_sess_url(_c0,url,cls){
var _c3="";
var qss=url.indexOf("?");
if(_c0.is_auth()){
_c3="?"+cls+"="+String(_c0._session);
}
if(qss>=0){
return url.substring(0,qss)+_c3;
}else{
return url+_c3;
}
}
var FFProto=Class.create();
FFProto.prototype={initialize:function(_c5){
this._path=_c5;
},encode:function(_c6,op,_c8,_c9){
if(_c9==null){
_c9="";
}
var _ca="s"+_c6+"\x00"+op+"\x00";
for(var ii=0;ii<_c8.length-1;++ii){
_ca+=String(_c8[ii])+"|";
}
_ca+=String(_c8[_c8.length-1]);
if(_c9==null){
return _ca;
}else{
return _ca+"\x00"+String(_c9);
}
},decode:function(_cc){
if(_cc.charAt(0)=="e"){
return [false,_cc.substring(2)];
}
if(_cc.charAt(0)!="s"){
return [false,"Incorrect protocol"];
}
if(_cc.length<2){
return [false,"Operation failed"];
}
if((_cc.length<3)&&(_cc.charAt(1)=="0")){
return [false,"Operation failed"];
}
return [true,_cc.substring(1)];
},get_url:function(_cd,op,_cf,_d0){
return this._path+encodeURIComponent(this.encode(_cd,op,_cf,_d0));
},request:function(_d1,op,_d3,_d4,sf,ef){
var _d7=this;
new Ajax.Request(this._path,{method:"post",postBody:encodeURIComponent(this.encode(_d1,op,_d3,_d4)),onSuccess:function(r){
var _d9=_d7.decode(r.responseText);
if(_d9[0]){
sf(_d9[1]);
return;
}
if(ef!=null){
ef(_d9[1]);
}
},onFailure:function(e){
if(ef!=null){
ef("Updates disabled -- try again in 15 minutes");
}
}});
}};
var FFStatus=Class.create();
FFStatus.prototype={initialize:function(_db){
this._elem=_db;
},read:function(){
if(this._elem.firstChild==null){
return "";
}else{
return this._elem.firstChild.data;
}
},write:function(_dc){
if(_dc.length>0){
if(this._elem.firstChild==null){
this._elem.appendChild(document.createTextNode(_dc));
}else{
this._elem.firstChild.deleteData(0,this._elem.firstChild.data.length);
this._elem.firstChild.appendData(_dc);
}
}else{
if(this._elem.firstChild!=null){
this._elem.removeChild(this._elem.firstChild);
}
}
}};
function ffstrip(_dd){
return _dd.replace(/^\s+/,"").replace(/\s+$/,"");
}

