function jolley_preloader(a,c){this.var_name=a;this.div_id=c;this.preloader_id=c+"_preloader";this.wait=500;this.state=0;this.stateString=[];this.stateString[0]='<img src="/images/loading.gif" class="loading" />';this.styleWasSet=this.active=false;this.start=function(){var d=document.getElementById(this.div_id);if(d.style.height=="")d.style.height=d.offsetHeight+"px";else this.styleWasSet=true;d.innerHTML=this.stateString[0];this.active=true;this.repeater()};this.repeater=function(){if(this.active){var d=
document.getElementById(this.preloader_id);if(d!=null){d.innerHTML=this.stateString[this.state];this.state++;if(this.state>=this.stateString.length)this.state=0}}};this.stop=function(){if(!this.styleWasSet)document.getElementById(this.div_id).style.height="";this.active=false;this.state=0;document.getElementById(this.div_id).innerHTML=""}}function Lert(a,c,d){this.message_=a;this.buttons_=c;this.defaultButton_=d.defaultButton||this.buttons_[0];this.icon_=d.icon||null}
Lert.prototype.display=function(){var a=document.getElementsByTagName("BODY")[0],c=getPageScroll(),d=getPageSize(),e=document.getElementById("lertOverlay");if(!e){e=document.createElement("div");e.setAttribute("id","lertOverlay");e.style.display="none";a.appendChild(e)}e.style.height=d[1]+"px";e.style.display="block";var f=document.getElementById("lertContainer");if(!f){f=document.createElement("div");f.setAttribute("id","lertContainer");f.style.display="none";a.appendChild(f)}f.style.top=c[1]+d[3]/
15+"px";f.style.display="block";a=document.createElement("div");a.setAttribute("id","lertWindow");if(this.icon_!=null){c=document.createElement("img");c.setAttribute("src",this.icon_);c.setAttribute("id","lertIcon");c.setAttribute("alt","");a.appendChild(c)}c=document.createElement("p");c.setAttribute("id","lertMessage");c.innerHTML=this.message_;a.appendChild(c);c=document.createElement("div");c.setAttribute("id","lertButtons");var g=document.onkeydown;for(i in this.buttons_){d=this.buttons_[i];
if(d.getDom){d=d.getDom(function(){f.style.display="none";e.style.display="none";document.onkeydown=g;f.innerHTML=""},this.defaultButton_);c.appendChild(d)}}a.appendChild(c);document.onkeydown=this.keyboardControls;f.appendChild(a)};Lert.prototype.keyboardControls=function(a){keycode=a==null?event.keyCode:a.which};function LertButton(a,c){this.label_=a;this.onclick_=c;this.eventClick=function(){}}
LertButton.prototype.getDom=function(a,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.className="lertButton";this==c&&d.setAttribute("id","lertDefaultButton");d.innerHTML=this.label_;var e=this.onclick_;d.onclick=function(){a();e()};this.eventClick=d.onclick;return d};
function getPageScroll(){var a;if(self.pageYOffset)a=self.pageYOffset;else if(document.documentElement&&document.documentElement.scrollTop)a=document.documentElement.scrollTop;else if(document.body)a=document.body.scrollTop;return arrayPageScroll=new Array("",a)}
function getPageSize(){var a,c;if(window.innerHeight&&window.scrollMaxY){a=document.body.scrollWidth;c=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight>document.body.offsetHeight){a=document.body.scrollWidth;c=document.body.scrollHeight}else{a=document.body.offsetWidth;c=document.body.offsetHeight}var d,e;if(self.innerHeight){d=self.innerWidth;e=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){d=document.documentElement.clientWidth;e=
document.documentElement.clientHeight}else if(document.body){d=document.body.clientWidth;e=document.body.clientHeight}pageHeight=c<e?e:c;pageWidth=a<d?d:a;return arrayPageSize=new Array(pageWidth,pageHeight,d,e)}function jx(){this.http=false;this.format="text";this.callback=function(){};this.error=this.handler=false;this.opt={}}
jx.prototype.getHTTPObject=function(){var a=false;if(typeof ActiveXObject!="undefined")try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){a=false}}else if(XMLHttpRequest)try{a=new XMLHttpRequest}catch(e){a=false}return a};
jx.prototype.load=function(a,c,d,e,f){this.init();if(this.http&&a){this.http.overrideMimeType&&this.http.overrideMimeType("text/xml");this.callback=c;e||(e="GET");d||(d="text");f=f?false:true;this.format=d.toLowerCase();e=e.toUpperCase();var g=this;c="uid="+(new Date).getTime();a+=a.indexOf("?")+1?"&":"?";a+=c;c=null;if(e=="POST"){c=a.split("?");a=c[0];c=c[1]}this.http.open(e,a,f);if(e=="POST"){this.http.setRequestHeader("Content-type","application/x-www-form-urlencoded");this.http.setRequestHeader("Content-length",
c.length);this.http.setRequestHeader("Connection","close")}if(f==false){this.http.send(c);if(g){a=g.http;e="";if(a.responseText)e=a.responseText;if(g.format.charAt(0)=="j"){e=e.replace(/[\n\r]/g,"");e=eval("("+e+")")}else if(g.format.charAt(0)=="x")e=a.responseXML;g.callback&&g.callback(e)}}else{this.http.onreadystatechange=this.handler?this.handler:function(){if(g){var h=g.http;if(h.readyState==4)if(h.status==200){var j="";if(h.responseText)j=h.responseText;if(g.format.charAt(0)=="j"){j=j.replace(/[\n\r]/g,
"");j=eval("("+j+")")}else if(g.format.charAt(0)=="x")j=h.responseXML;g.callback&&g.callback(j)}else{g.opt.loadingIndicator&&document.getElementsByTagName("body")[0].removeChild(g.opt.loadingIndicator);if(g.opt.loading)document.getElementById(g.opt.loading).style.display="none";g.error&&g.error(h.status)}}};this.http.send(c)}}};
jx.prototype.bind=function(a){var c={url:"",onSuccess:false,onError:false,format:"text",method:"GET",update:"",loading:"",loadingIndicator:""};for(var d in c)if(a[d])c[d]=a[d];this.opt=c;if(c.url){if(c.onError)this.error=c.onError;var e=false;if(c.loadingIndicator){e=document.createElement("div");e.setAttribute("style","position:absolute;top:0px;left:0px;");e.setAttribute("class","loading-indicator");e.innerHTML=c.loadingIndicator;document.getElementsByTagName("body")[0].appendChild(e);this.opt.loadingIndicator=
e}if(c.loading)document.getElementById(c.loading).style.display="block";this.load(c.url,function(f){c.onSuccess&&c.onSuccess(f);if(c.update)document.getElementById(c.update).innerHTML=f;e&&document.getElementsByTagName("body")[0].removeChild(e);if(c.loading)document.getElementById(c.loading).style.display="none"},c.format,c.method)}};jx.prototype.init=function(){this.http=this.getHTTPObject()};var hexcase=0,b64pad="",chrsz=8;
function hex_md5(a){return binl2hex(core_md5(str2binl(a),a.length*chrsz))}function b64_md5(a){return binl2b64(core_md5(str2binl(a),a.length*chrsz))}function str_md5(a){return binl2str(core_md5(str2binl(a),a.length*chrsz))}function hex_hmac_md5(a,c){return binl2hex(core_hmac_md5(a,c))}function b64_hmac_md5(a,c){return binl2b64(core_hmac_md5(a,c))}function str_hmac_md5(a,c){return binl2str(core_hmac_md5(a,c))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}
function core_md5(a,c){a[c>>5]|=128<<c%32;a[(c+64>>>9<<4)+14]=c;c=1732584193;for(var d=-271733879,e=-1732584194,f=271733878,g=0;g<a.length;g+=16){var h=c,j=d,k=e,l=f;c=md5_ff(c,d,e,f,a[g+0],7,-680876936);f=md5_ff(f,c,d,e,a[g+1],12,-389564586);e=md5_ff(e,f,c,d,a[g+2],17,606105819);d=md5_ff(d,e,f,c,a[g+3],22,-1044525330);c=md5_ff(c,d,e,f,a[g+4],7,-176418897);f=md5_ff(f,c,d,e,a[g+5],12,1200080426);e=md5_ff(e,f,c,d,a[g+6],17,-1473231341);d=md5_ff(d,e,f,c,a[g+7],22,-45705983);c=md5_ff(c,d,e,f,a[g+8],7,
1770035416);f=md5_ff(f,c,d,e,a[g+9],12,-1958414417);e=md5_ff(e,f,c,d,a[g+10],17,-42063);d=md5_ff(d,e,f,c,a[g+11],22,-1990404162);c=md5_ff(c,d,e,f,a[g+12],7,1804603682);f=md5_ff(f,c,d,e,a[g+13],12,-40341101);e=md5_ff(e,f,c,d,a[g+14],17,-1502002290);d=md5_ff(d,e,f,c,a[g+15],22,1236535329);c=md5_gg(c,d,e,f,a[g+1],5,-165796510);f=md5_gg(f,c,d,e,a[g+6],9,-1069501632);e=md5_gg(e,f,c,d,a[g+11],14,643717713);d=md5_gg(d,e,f,c,a[g+0],20,-373897302);c=md5_gg(c,d,e,f,a[g+5],5,-701558691);f=md5_gg(f,c,d,e,a[g+
10],9,38016083);e=md5_gg(e,f,c,d,a[g+15],14,-660478335);d=md5_gg(d,e,f,c,a[g+4],20,-405537848);c=md5_gg(c,d,e,f,a[g+9],5,568446438);f=md5_gg(f,c,d,e,a[g+14],9,-1019803690);e=md5_gg(e,f,c,d,a[g+3],14,-187363961);d=md5_gg(d,e,f,c,a[g+8],20,1163531501);c=md5_gg(c,d,e,f,a[g+13],5,-1444681467);f=md5_gg(f,c,d,e,a[g+2],9,-51403784);e=md5_gg(e,f,c,d,a[g+7],14,1735328473);d=md5_gg(d,e,f,c,a[g+12],20,-1926607734);c=md5_hh(c,d,e,f,a[g+5],4,-378558);f=md5_hh(f,c,d,e,a[g+8],11,-2022574463);e=md5_hh(e,f,c,d,a[g+
11],16,1839030562);d=md5_hh(d,e,f,c,a[g+14],23,-35309556);c=md5_hh(c,d,e,f,a[g+1],4,-1530992060);f=md5_hh(f,c,d,e,a[g+4],11,1272893353);e=md5_hh(e,f,c,d,a[g+7],16,-155497632);d=md5_hh(d,e,f,c,a[g+10],23,-1094730640);c=md5_hh(c,d,e,f,a[g+13],4,681279174);f=md5_hh(f,c,d,e,a[g+0],11,-358537222);e=md5_hh(e,f,c,d,a[g+3],16,-722521979);d=md5_hh(d,e,f,c,a[g+6],23,76029189);c=md5_hh(c,d,e,f,a[g+9],4,-640364487);f=md5_hh(f,c,d,e,a[g+12],11,-421815835);e=md5_hh(e,f,c,d,a[g+15],16,530742520);d=md5_hh(d,e,f,
c,a[g+2],23,-995338651);c=md5_ii(c,d,e,f,a[g+0],6,-198630844);f=md5_ii(f,c,d,e,a[g+7],10,1126891415);e=md5_ii(e,f,c,d,a[g+14],15,-1416354905);d=md5_ii(d,e,f,c,a[g+5],21,-57434055);c=md5_ii(c,d,e,f,a[g+12],6,1700485571);f=md5_ii(f,c,d,e,a[g+3],10,-1894986606);e=md5_ii(e,f,c,d,a[g+10],15,-1051523);d=md5_ii(d,e,f,c,a[g+1],21,-2054922799);c=md5_ii(c,d,e,f,a[g+8],6,1873313359);f=md5_ii(f,c,d,e,a[g+15],10,-30611744);e=md5_ii(e,f,c,d,a[g+6],15,-1560198380);d=md5_ii(d,e,f,c,a[g+13],21,1309151649);c=md5_ii(c,
d,e,f,a[g+4],6,-145523070);f=md5_ii(f,c,d,e,a[g+11],10,-1120210379);e=md5_ii(e,f,c,d,a[g+2],15,718787259);d=md5_ii(d,e,f,c,a[g+9],21,-343485551);c=safe_add(c,h);d=safe_add(d,j);e=safe_add(e,k);f=safe_add(f,l)}return Array(c,d,e,f)}function md5_cmn(a,c,d,e,f,g){return safe_add(bit_rol(safe_add(safe_add(c,a),safe_add(e,g)),f),d)}function md5_ff(a,c,d,e,f,g,h){return md5_cmn(c&d|~c&e,a,c,f,g,h)}function md5_gg(a,c,d,e,f,g,h){return md5_cmn(c&e|d&~e,a,c,f,g,h)}
function md5_hh(a,c,d,e,f,g,h){return md5_cmn(c^d^e,a,c,f,g,h)}function md5_ii(a,c,d,e,f,g,h){return md5_cmn(d^(c|~e),a,c,f,g,h)}function core_hmac_md5(a,c){var d=str2binl(a);if(d.length>16)d=core_md5(d,a.length*chrsz);var e=Array(16);a=Array(16);for(var f=0;f<16;f++){e[f]=d[f]^909522486;a[f]=d[f]^1549556828}c=core_md5(e.concat(str2binl(c)),512+c.length*chrsz);return core_md5(a.concat(c),640)}function safe_add(a,c){var d=(a&65535)+(c&65535);return(a>>16)+(c>>16)+(d>>16)<<16|d&65535}
function bit_rol(a,c){return a<<c|a>>>32-c}function str2binl(a){for(var c=Array(),d=(1<<chrsz)-1,e=0;e<a.length*chrsz;e+=chrsz)c[e>>5]|=(a.charCodeAt(e/chrsz)&d)<<e%32;return c}function binl2str(a){for(var c="",d=(1<<chrsz)-1,e=0;e<a.length*32;e+=chrsz)c+=String.fromCharCode(a[e>>5]>>>e%32&d);return c}function binl2hex(a){for(var c=hexcase?"0123456789ABCDEF":"0123456789abcdef",d="",e=0;e<a.length*4;e++)d+=c.charAt(a[e>>2]>>e%4*8+4&15)+c.charAt(a[e>>2]>>e%4*8&15);return d}
function binl2b64(a){for(var c="",d=0;d<a.length*4;d+=3)for(var e=(a[d>>2]>>8*(d%4)&255)<<16|(a[d+1>>2]>>8*((d+1)%4)&255)<<8|a[d+2>>2]>>8*((d+2)%4)&255,f=0;f<4;f++)c+=d*8+f*6>a.length*32?b64pad:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>6*(3-f)&63);return c}
var protocol=window.location.protocol,host=protocol+"//"+document.domain+"/"+(window.location.href.indexOf("sandbox")!=-1?"sandbox/":""),server=host+"index.php/",contextMenuObj,MSIE=navigator.userAgent.indexOf("MSIE")?true:false,navigatorVersion=navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,"$1")/1,activeContextMenuItem=false,posx=0,posy=0,xOffset=0;function highlightContextMenuItem(){this.className="contextMenuHighlighted"}function deHighlightContextMenuItem(){this.className=""}
function initMenu(a){var c="";c=c+'<li><a href="#" onclick="ThumbForm(0,event.pageY,'+a+');return false;">Refresh Thumbnail</a></li>';c=c+'<li><a href="#" onclick="TagForm(0,event.pageY,'+a+');return false;">Modify Tags</a></li>';c=c+'<li><a href="#" onclick="AuthorForm(0,event.pageY,'+a+');return false;">Change Author</a></li>';c=c+'<li><a href="#" onclick="DeleteConfirm(0,event.pageY,'+a+');return false;">Remove Blog</a></li>';c=c+'<li><a href="#" onclick="DisableConfirm(0,event.pageY,'+a+');return false;">Disable Blog</a></li>';
c=c+'<li><a href="#" onclick="FeaturedConfirm(0,event.pageY,'+a+');return false;">Set Featured</a></li>';c=c+'<li><a href="#" onclick="TwitterForm(0,event.pageY,'+a+');return false;">View/Edit Twitter Name</a></li>';c=c+'<li><a href="#" onclick="hideMenu('+a+'); return false;">Close Menu</a></li>';menudom=document.createElement("UL");menudom.id="contextMenu";menudom.tag=a;menudom.innerHTML=c;menudom.onclick=function(){hideMenu(a);return false};document.getElementById("hook_"+a).appendChild(menudom);
contextMenuObj=document.getElementById("contextMenu");contextMenuObj.style.display="none";c=contextMenuObj.getElementsByTagName("LI");for(var d=0;d<c.length;d++){c[d].onmouseover=highlightContextMenuItem;c[d].onmouseout=deHighlightContextMenuItem;var e=c[d].getElementsByTagName("A")[0]}}
function popMenu(a,c){contextMenuObj.style.position="absolute";contextMenuObj.style.left=a+"px";contextMenuObj.style.top=c+"px";contextMenuObj.style.display="block";xOffset=document.getElementById("container").offsetLeft+contextMenuObj.parentNode.parentNode.offsetLeft;contextMenuObj.parentNode.parentNode.onmouseout=function(){if(MouseX<=a+xOffset||MouseY<=c||MouseX>=a+xOffset+contextMenuObj.offsetWidth-15||MouseY>=c+contextMenuObj.offsetHeight-15){hideMenu(contextMenuObj.tag);return false}};return false}
function hideMenu(a){a=document.getElementById("hook_"+a);a.getElementById("contextMenu").style.display="none";a.removeChild(a.getElementById("contextMenu"));return false}function isAdmin(a){(new jx).load(server+"admin/isAdmin",function(c){if(c=="true"){document.getElementById("authorresult").innerHTML="true";document.getElementByClassName(a).style.display="inline"}else document.getElementById(a).style.display="none"},"text","post")}
function ChangeAuthor(a){document.getElementById("authorresult").innerHTML="";(new jx).load(server+"admin/change_author/?new_author="+document.getElementById("new_author").value+"&blog_id="+a,function(c){if(c=="1")document.getElementById("authorresult").innerHTML="Success";else document.getElementById("authorresult").innerHTML="Failure"},"text","post")}
function RemoveBlog(a){(new jx).load(server+"admin/remove_blog/?blog_id="+a,function(c){delConfirm.innerHTML=c=="true"?'Success <input type="button" value="Close" onclick="document.getElementById(\'hook_'+a+"').removeChild(document.getElementById('delconfirm_"+a+"'))>":'Failure <input type="button" value="Close" onclick="document.getElementById(\'hook_'+a+"').removeChild(document.getElementById('delconfirm_"+a+"'))>"},"text","post")}
function DisableBlog(a){(new jx).load(server+"admin/disable_blog/?blog_id="+a,function(c){disConfirm.innerHTML=c=="true"?'Success <input type="button" value="Close" onclick="document.getElementById(\'hook_'+a+"').removeChild(document.getElementById('disconfirm_"+a+"'))>":'Failure <input type="button" value="Close" onclick="document.getElementById(\'hook_'+a+"').removeChild(document.getElementById('disconfirm_"+a+"'))>"},"text","post")}
function UpdateThumb(a){var c=new jx,d=document.getElementById("thumbresult");c.load(server+"admin/update_thumb/?blog_id="+a,function(e){d.innerHTML=e!="false"?'Success <input type="button" value="Close" onclick="document.getElementById(\'hook_'+b:'Failure <input type="button" value="Close" onclick="document.getElementById(\'hook_'+b},"text","post")}
function UpdateFeatured(a){(new jx).load(server+"admin/update_featured/?blog_id="+a,function(c){feConfirm.innerHTML=c=="true"?'Success <input type="button" value="Close" onclick="document.getElementById(\'hook_'+a+"').removeChild(document.getElementById('feconfirm_"+a+"'))>":'Failure <input type="button" value="Close" onclick="document.getElementById(\'hook_'+a+"').removeChild(document.getElementById('feconfirm_"+a+"'))>"},"text","post")}
function GetTwitter(a){(new jx).load(server+"admin/get_twitter/?blog_id="+a,function(c){if(c=="")document.getElementById("originaltwitter").innerHTML="This blog has no registered Twitter username.";else document.getElementById("originaltwitter").innerHTML="This blog's registered Twitter username is: "+c},"text","post")}
function ChangeTwitter(a){document.getElementById("twitterresult").innerHTML="";(new jx).load(server+"admin/change_twitter/?new_twitter="+document.getElementById("new_twitter").value+"&blog_id="+a,function(c){if(c=="1"){document.getElementById("twitterresult").innerHTML="Success";GetTwitter(a)}else document.getElementById("twitterresult").innerHTML="Failure"},"text","post")}
function UpdateTags(a){(new jx).load(server+"admin/update_tags/?tag_list="+document.getElementById("tag_list").value+"&blog_id="+a,function(c){if(c=="true"){document.getElementById("tagresult").innerHTML="<center>Success</center>";GetTags(a)}else document.getElementById("tagresult").innerHTML="<center>Failure</center>"},"text","post")}
function GetTags(a){(new jx).load(server+"admin/get_tags/?blog_id="+a,function(c){if(c=="")document.getElementById("tag_list").value="User has no associated tags";else if(c=="false")document.getElementById("tag_list").value="Invalid Permission";else document.getElementById("tag_list").value=c},"text","post")}
function TagForm(a,c,d){a=a+200;var e="<center>Enter tags seperated by a comma (,)</center><br>";e=e+'<form id="tagbox" onsubmit="UpdateTags('+d+');return false;" method="POST" action="#"><center>';e+='<textarea id="tag_list" name="tag_list" rows="5" cols="40" style="margin:1px"></textarea><br>';e+='<input type="submit" value="Update Tags">';e=e+'<input type="button" value="Close" onclick="document.getElementById(\'hook_'+d+"').removeChild(document.getElementById('form_"+d+"'))></center>";e+="<span id='tagresult'></span>";
tagForm=document.createElement("DIV");tagForm.id="form_"+d;tagForm.style.border="1px solid black";tagForm.style.background="red";tagForm.style.position="absolute";tagForm.style.zIndex="10";tagForm.style.left=a+"px";tagForm.style.top=c+"px";tagForm.style.display="block";tagForm.innerHTML=e;document.getElementById("hook_"+d).appendChild(tagForm);GetTags(d)}
function AuthorForm(a,c,d){a=a+200;var e='<form id="blogauthor" onsubmit="ChangeAuthor('+d+');return false;" method="POST" action="#">';e+='Author Name:<input type="text" id="new_author" name="new_author">';e+='<input type="submit" value="Change Author">';e=e+'<input type="button" value="Close" onclick="document.getElementById(\'hook_'+d+"').removeChild(document.getElementById('form_"+d+"'))>";e+="<span id='authorresult'></span>";authorBox=document.createElement("DIV");authorBox.id="form_"+d;authorBox.style.border=
"1px solid black";authorBox.style.background="red";authorBox.style.position="absolute";authorBox.style.zIndex="10";authorBox.style.left=a+"px";authorBox.style.top=c+"px";authorBox.style.display="block";authorBox.innerHTML=e;document.getElementById("hook_"+d).appendChild(authorBox)}
function TwitterForm(a,c,d){a=a+200;var e="<span id='originaltwitter'></span><br>";e=e+'<form id="twittername" onsubmit="ChangeTwitter('+d+');return false;" method="POST" action="#">';e+='New Twitter User Name:<input type="text" id="new_twitter" name="new_twitter">';e+='<input type="submit" value="Change Twitter Username">';e=e+'<input type="button" value="Close" onclick="document.getElementById(\'hook_'+d+"').removeChild(document.getElementById('twitter_"+d+"'))>";e+="<br><span id='twitterresult'></span>";
twitterBox=document.createElement("DIV");twitterBox.id="twitter_"+d;twitterBox.style.border="1px solid black";twitterBox.style.background="red";twitterBox.style.position="absolute";twitterBox.style.zIndex="10";twitterBox.style.left=a+"px";twitterBox.style.top=c+"px";twitterBox.style.display="block";twitterBox.innerHTML=e;document.getElementById("hook_"+d).appendChild(twitterBox);GetTwitter(d)}
function ThumbForm(a,c,d){a=a+200;var e='<form id="updatethumb" onsubmit="UpdateThumb('+d+');return false;" method="POST" action="#">';e+='<input type="submit" value="Update Thumbnail">';e=e+'<input type="button" value="Close" onclick="document.getElementById(\'hook_'+d+"').removeChild(document.getElementById('thumb_"+d+"'))>";e+="<br><span id='thumbresult'></span>";thumbBox=document.createElement("DIV");thumbBox.id="thumb_"+d;thumbBox.style.border="1px solid black";thumbBox.style.background="red";
thumbBox.style.position="absolute";thumbBox.style.zIndex="10";thumbBox.style.left=a+"px";thumbBox.style.top=c+"px";thumbBox.style.display="block";thumbBox.innerHTML=e;document.getElementById("hook_"+d).appendChild(thumbBox)}
function DeleteConfirm(a,c,d){a=a+200;var e='<form id="delConfirmBox" onsubmit="RemoveBlog('+d+');return false;" method="POST" action="#">';e+="Really Delete This Blog?";e+='<input type="submit" value="Yes">';e=e+'<input type="button" value="No" onclick="document.getElementById(\'hook_'+d+"').removeChild(document.getElementById('delconfirm_"+d+"'))>";e+="</form>";delConfirm=document.createElement("DIV");delConfirm.id="delconfirm_"+d;delConfirm.style.border="1px solid black";delConfirm.style.background=
"red";delConfirm.style.position="absolute";delConfirm.style.zIndex="10";delConfirm.style.left=a+"px";delConfirm.style.top=c+"px";delConfirm.style.display="block";delConfirm.innerHTML=e;document.getElementById("hook_"+d).appendChild(delConfirm)}
function DisableConfirm(a,c,d){a=a+200;var e='<form id="disConfirmBox" onsubmit="DisableBlog('+d+');return false;" method="POST" action="#">';e+="Really Disable This Blog?";e+='<input type="submit" value="Yes">';e=e+'<input type="button" value="No" onclick="document.getElementById(\'hook_'+d+"').removeChild(document.getElementById('disconfirm_"+d+"'))>";e+="</form>";disConfirm=document.createElement("DIV");disConfirm.id="disconfirm_"+d;disConfirm.style.border="1px solid black";disConfirm.style.background=
"red";disConfirm.style.position="absolute";disConfirm.style.zIndex="10";disConfirm.style.left=a+"px";disConfirm.style.top=c+"px";disConfirm.style.display="block";disConfirm.innerHTML=e;document.getElementById("hook_"+d).appendChild(disConfirm)}
function FeaturedConfirm(a,c,d){a=a+200;var e='<form id="feConfirmBox" onsubmit="UpdateFeatured('+d+');return false;" method="POST" action="#">';e+="Set this blog as the featured blog?";e+='<input type="submit" value="Yes">';e=e+'<input type="button" value="No" onclick="document.getElementById(\'hook_'+d+"').removeChild(document.getElementById('feconfirm_"+d+"'))>";e+="</form>";feConfirm=document.createElement("DIV");feConfirm.id="feconfirm_"+d;feConfirm.style.border="1px solid black";feConfirm.style.background=
"red";feConfirm.style.position="absolute";feConfirm.style.zIndex="10";feConfirm.style.left=a+"px";feConfirm.style.top=c+"px";feConfirm.style.display="block";feConfirm.innerHTML=e;document.getElementById("hook_"+d).appendChild(feConfirm)}
var START=0,PREVIOUS_START=START,MAX=10,LIMIT=10,TIMEFRAME="1",SORT="top",QUERY="",HIGHLIGHT_ID=-1,SIMPLE_BID_LIST_START=-1,PREVIOUS_SIMPLE_BID_LIST_START=SIMPLE_BID_LIST_START,SIMPLE_BID_LIST_LIMIT=20,SIMPLE_BID_LIST_TIMEFRAME=1,USING_HASH=0,MAX_ASYNC_LOADS=15,CurrentAsyncLoads=0,canKillAsyncRequests=false,site_ids=[],rsss=[];protocol=window.location.protocol;
host=protocol+"//"+document.domain+"/"+(window.location.href.indexOf("sandbox")!=-1?"sandbox/":"")+(window.location.href.indexOf("viralogy/")!=-1?"viralogy/":"");server=host+"index.php/";var PopCloseAction="PopBlur()",register_username="NONE",DisplayUpdateInterval=300,ProbeUpdateInterval=60,Current_Jx_Requests=[],IE=document.all?true:false;IE||document.captureEvents(Event.MOUSEMOVE);document.onmousemove=getMouseXY;var MouseX=0,MouseY=0;
function getMouseXY(a){if(IE){tempX=event.clientX+document.body.scrollLeft;tempY=event.clientY+document.body.scrollTop}else{tempX=a.pageX;tempY=a.pageY}if(tempX<0)tempX=0;if(tempY<0)tempY=0;MouseX=tempX;MouseY=tempY;return true}
function switchOptionsDropDown(a){var c=document.getElementById("options_drop_down_"+a);if(c.style.display==""||c.style.display=="block"){c.style.display="none";$("site_options_show_"+a).removeClass("active")}else{c.style.display="block";$("site_options_show_"+a).addClass("active")}}function switchAnswer(a){var c=document.getElementById("answer"+a);parseInt(c.style.height)==0?grow("answer"+a):shrink("answer"+a)}
function shrink(a){var c=document.getElementById(a),d=parseInt(c.style.height);d-=4;c.style.height=d+"px";d>0&&setTimeout("shrink('"+a+"');",1)}function grow(a){var c=document.getElementById(a),d=parseInt(c.style.height);d+=4;c.style.height=d+"px";d<c.innerHTML.length/5+10&&setTimeout("grow('"+a+"');",1)}var update_read_preloader=new jolley_preloader("update_read_preloader","being_read_now");
function UpdateBeingRead(a){if(!a||a===undefined)a="";SetHeaderStatus("Loading...");var c=document.getElementById("being_read_now");update_read_preloader.start();(new jx).load(server+"sites/display_being_read_list/"+a,function(d){update_read_preloader.stop();c.innerHTML=d;SetHeaderStatus("")},"text","post")}
function Refund(a){document.getElementById("refund_button").innerHTML='<span style="color:white;">Loading...</span>';(new jx).load(server+"user/refund/"+a,function(c){document.getElementById("refund_button").onclick="";document.getElementById("refund_button").style.cursor="";document.getElementById("refund_button").style.width="300px";document.getElementById("refund_button").innerHTML="<a style='float:right;color:white;' href='javascript:window.location.reload()'>x</a><div style='clear:both' >"+c+
"</div>"},"text","post")}
function UpdateSiteVars(a,c,d,e,f,g){if(a!=null){PREVIOUS_START=START;START=a;if(START<0)START=0}else START=0;if(e!=null){SORT=e;switch(e){case "top":if(f==null)f="";d==null&&ResetSortTime();TIMEFRAME=1;break;case "hot":if(f==null)f="";if(d==null){ResetSortTime();TIMEFRAME=1}break;case "recent":if(f==null)f="";if(d==null){ResetSortTime(true);TIMEFRAME=-1}break;default:break}MakeActive(document.getElementById("sort_"+e),"#sort_type")}if(c!=null)LIMIT=c;if(d!=null)TIMEFRAME=d;if(f!=null){if(f=="Search Sites")f=
"";QUERY=f;if(f==""){document.getElementById("query").value="Search Sites";MakeActive(document.getElementById("sort_cat_all"),"#sort_cat")}else{document.getElementById("query").value=f;MakeActive(document.getElementById("sort_cat_"+f.replace(" ","").replace("#","")),"#sort_cat")}}g||UpdateSession()}function MakeActive(a,c){c=="#sort_type"&&MakeActive(document.getElementById("sort_cat_all"),"#sort_cat");$$(c+" .active").removeClass("active");a&&$(a.id).addClass("active")}
function ResetSortTime(a){if(a){MakeActive(document.getElementById("timeframe_-1"),"#sort_time");$("timeframe_1").style.display="none";$("timeframe_7").style.display="none";$("timeframe_30").style.display="none"}else{MakeActive(document.getElementById("timeframe_1"),"#sort_time");$("timeframe_1").style.display="";$("timeframe_7").style.display="";$("timeframe_30").style.display=""}}
function UpdateSession(){var a=new jx;Current_Jx_Requests[Current_Jx_Requests.length]=a;a.load(server+"user/updateSession/",function(c){},"text","post")}function SavePageView(a){a=new jx;Current_Jx_Requests[Current_Jx_Requests.length]=a;a.load(server+"site/save_page_view/?page="+wp_name,function(c){},"text","post")}function SetBodyStatus(a){var c=document.getElementById("body_status");if(c)c.innerHTML=a}
function SetHeaderStatus(a){var c=document.getElementById("header_status");if(c)c.innerHTML=a}var refresh_sites_preloader=new jolley_preloader("refresh_sites_preloader","site_listing");
function RefreshSites(a){MAX=0;a||(a=false);if(canKillAsyncRequests)for(;Current_Jx_Requests.length>0;){var c=Current_Jx_Requests.shift();c.http.abort()}if(USING_HASH&&!a){c=SORT+"/"+TIMEFRAME+"/"+QUERY;document.getElementById("LocationHash").name=c;window.location.hash=c}var d=document.getElementById("site_listing");if(!a){refresh_sites_preloader.start();SetBodyStatus("Loading...")}c=new jx;Current_Jx_Requests[Current_Jx_Requests.length]=c;c.load(server+"sites/display_list/?initial_load="+a+"&start="+
START+"&limit="+LIMIT+"&timeframe="+TIMEFRAME+"&sort="+SORT+"&query="+escape(QUERY),function(e){a||refresh_sites_preloader.stop();if(e!="false"){var f=e.indexOf("|||");MAX=parseInt(e.substr(0,f),10);var g=0,h="";site_ids=[];rsss=[];for(var j=0;j<MAX;j++){e=e.substr(f+3);f=e.indexOf("|||");g=e.substr(0,f);e=e.substr(f+3);f=e.indexOf("|||");h=e.substr(0,f);rsss[j]=h;site_ids[j]=g}e=e.substr(f+3);d.innerHTML=e;document.getElementById("permalink_url").value=host+"home/frontpage/"+START+"/"+LIMIT+"/"+
SORT+"/"+TIMEFRAME+"/"+escape(QUERY);g=f="";if(QUERY){f=' "'+QUERY+'"';window.location.hash="#site_sort"}switch(TIMEFRAME){case "-1":case -1:e="ever";break;case "1":case 1:e="of today";break;case "7":case 7:e="this week";break;case "30":case 30:e="this month";break;default:e="in the past "+TIMEFRAME+" days";break}switch(SORT){case "top":g="the top rated";break;case "featured":g="the top featured";break;case "popular":g="the most viewed";break;case "recent":g="the new";break}SetBodyStatus("<strong>Showing "+
g+" "+f+" sites "+e+"</strong>");HighlightSite();setTimeout("LoadDisplayLatestPostInfo()",50)}else{SetBodyStatus("There are no results for that");START=PREVIOUS_START}},"text","post")}function HighlightSite(){if(HIGHLIGHT_ID!=-1){document.getElementById("site_"+HIGHLIGHT_ID).style.border="4px solid #A1CC3A";window.location.hash="#site_"+HIGHLIGHT_ID;HIGHLIGHT_ID=-1}}var HIDE_PERM_LINK_TIMER=null;
function ShowPermLink(){document.getElementById("page_permalink").style.display="block";document.getElementById("permalink_url").focus();document.getElementById("permalink_url").select();HIDE_PERM_LINK_TIMER&&clearTimeout(HIDE_PERM_LINK_TIMER);HIDE_PERM_LINK_TIMER=setTimeout("HidePermLink()",5E3)}function HidePermLink(){document.getElementById("page_permalink").style.display="none";HIDE_PERM_LINK_TIMER=null}var HIDE_PERM_BLOG_LINK_TIMER=null,PERM_BLOG_LINK_BLOG_DIV=0;
function ShowPermSiteLink(a,c){HidePermSiteLink(PERM_BLOG_LINK_BLOG_DIV);PERM_BLOG_LINK_BLOG_DIV=a;a=document.getElementById("site_preview_perm_site_link_"+a);a.innerHTML="<input type='text' onfocus='this.select()' readOnly='readOnly' value='"+host+"home/frontpage/site/"+c+"'>";a.style.display="block";a.style.visibility="visible";HIDE_PERM_BLOG_LINK_TIMER&&clearTimeout(HIDE_PERM_BLOG_LINK_TIMER);HIDE_PERM_BLOG_LINK_TIMER=setTimeout("HidePermSiteLink()",5E3)}
function HidePermSiteLink(a){a||(a=PERM_BLOG_LINK_BLOG_DIV);if(a){a=document.getElementById("site_preview_perm_site_link_"+a);a.style.display="none";a.style.visibility="hidden";HIDE_PERM_BLOG_LINK_TIMER&&clearTimeout(HIDE_PERM_BLOG_LINK_TIMER);HIDE_PERM_BLOG_LINK_TIMER=null}}
function RefreshBids(){var a=document.getElementById("WeekMonthAllBidListViewBox");a&&LoadIntoDiv(a,"bids/simple_list/"+SIMPLE_BID_LIST_START+"/"+SIMPLE_BID_LIST_LIMIT+"/"+SIMPLE_BID_LIST_TIMEFRAME);SetBodyStatus("Loading...");(new jx).load(server+"bids/display_list/?start="+START+"&limit="+LIMIT+"&timeframe="+TIMEFRAME+"&sort="+SORT+"&query="+escape(QUERY),function(c){if(c!="false"){a.innerHTML=c;SetBodyStatus("")}else{SetBodyStatus("There are no more bids");START=PREVIOUS_START}},"text","post")}
var LAST_BID_PROBE=0;function RefreshBidsProbe(){var a=new jx;Current_Jx_Requests[Current_Jx_Requests.length]=a;a.load(server+"bids/probe/?last_bid_probe="+LAST_BID_PROBE,function(c){if(c!="false"){LAST_BID_PROBE=c;RefreshBids()}},"text","post")}var LAST_BEING_READ_PROBE=0;
function RefreshBeingReadProbe(a){if(a===undefined)a=false;var c=new jx;Current_Jx_Requests[Current_Jx_Requests.length]=c;c.load(server+"sites/being_read_probe/?last_being_read_probe="+LAST_BEING_READ_PROBE,function(d){if(d!="false"){LAST_BEING_READ_PROBE=d;UpdateBeingRead(a);canKillAsyncRequests=true}},"text","post")}
function GoToMySite(){if(canKillAsyncRequests)for(;Current_Jx_Requests.length>0;){var a=Current_Jx_Requests.shift();a.http.abort()}SetBodyStatus("Loading...");var c=0,d=-1;UpdateSiteVars(0,LIMIT,-1,"top",QUERY);window.location.hash="#site_sort";a=new jx;a.load(server+"sites/get_position/?timeframe="+TIMEFRAME+"&sort="+SORT+"&query="+escape(QUERY),function(e){var f=e.indexOf("|||");d=e.substr(0,f);e=e.substr(f+3);c=parseInt(e,10);SetBodyStatus("")},"text","post","no");HIGHLIGHT_ID=d;a=c-parseInt(LIMIT/
2,10);a%2!=0&&a--;a||(a=0);UpdateSiteVars(a,null,null,null,null);RefreshSites()}function GoToSiteAnchor(a){if(document.getElementById("site_"+a)!=null)window.location.hash="site_"+a;else setTimeout("GoToSiteAnchor("+a+");",100)}function LoadDisplayLatestPostInfo(){for(var a=0;a<MAX;a++)LoadLatestPostInfo(site_ids[a],rsss[a])}
function LoadLatestPostInfo(a,c){if(MAX!=0){CurrentAsyncLoads>=MAX_ASYNC_LOADS||CurrentAsyncLoads++;c=new jx;Current_Jx_Requests[Current_Jx_Requests.length]=c;c.load(server+"sites/load_latest_post_info/"+a,function(d){CurrentAsyncLoads--;var e=d.indexOf("|||---|||*"),f=d.substr(0,e);d=d.substr(e+10);e=d.indexOf("|||---|||*");var g=d.substr(0,e);d=d.substr(e+10);if(document.getElementById("site_preview_post_title_"+a)!=null)if(g){document.getElementById("site_preview_post_title_"+a).innerHTML=f;document.getElementById("site_preview_post_title_"+
a).href=g;document.getElementById("site_preview_post_title_"+a).title+="'s latest post: \""+f+'"';document.getElementById("site_preview_post_snippet_"+a).innerHTML=d;document.getElementById("site_preview_post_snippet_"+a).href=g;document.getElementById("site_preview_post_snippet_"+a).title+="'s latest post: \""+f+'"'}},"text","post",false)}}var pop_focus_preloader=new jolley_preloader("pop_focus_preloader","pop_sheet");
function PopFocus(a,c){c||(c=null);var d=getPageSize()[1];document.getElementById("pop_sheet").style.visibility="visible";document.getElementById("pop_sheet").style.display="block";document.getElementById("pop_sheet").style.height=d;pop_focus_preloader.start();SetHeaderStatus("Loading...");(new jx).load(server+a,function(e){pop_focus_preloader.stop();var f=getPageSize(),g=f[0];f=f[1];f=getPageScroll()[1];var h=0,j=0;j=0;h=e.indexOf("|||");j=e.substr(0,h);e=e.substr(h+3);h=e.indexOf("|||");e.substr(0,
h);e=e.substr(h+3);h=$("pop_focus_body");h.innerHTML="<div id='pop_close' onclick='"+PopCloseAction+"'>close</div>\n\n";h.innerHTML+=e;e=f+50;g=(g-j)/2;document.getElementById("pop_align").style.visibility="visible";document.getElementById("pop_align").style.display="block";document.getElementById("pop_focus").style.top=e;document.getElementById("pop_focus").style.visibility="visible";document.getElementById("pop_focus").style.display="block";document.getElementById("pop_close").style.visibility=
"visible";document.getElementById("pop_close").style.display="block";window.location.hash="#pop_focus";g=h.getElementsByTagName("input");for(f=0;f<g.length;f++)if((e=g[f])&&e.id&&e.id!="undefined"&&e.id.indexOf("error")==-1&&e.id.indexOf("form")==-1){e.focus();break}c&&eval(c);SetHeaderStatus("")},"text","post")}
function PopBlur(){document.getElementById("pop_sheet").style.visibility="hidden";document.getElementById("pop_sheet").style.display="none";document.getElementById("pop_align").style.visibility="hidden";document.getElementById("pop_align").style.display="none";document.getElementById("pop_focus").style.visibility="hidden";document.getElementById("pop_focus").style.display="none"}
function FillInSiteInfo(a,c){var d=document.getElementById("status"),e=document.getElementById("error");e.style.display="none";if(c){d.style.display="none";e.style.display="none";SetHeaderStatus("Scanning site url...");d.innerHTML="Scanning site url...";d.style.display="block";(new jx).load(server+"sites/load_site_info/?"+a+"="+escape(c),function(f){if(f!="false")if(f.indexOf("Exists")!=-1){f=f.substr(f.indexOf("|")+1);var g=f.substr(0,f.indexOf("|"));f=f.substr(f.indexOf("|")+1);var h=document.getElementById("add_site_checkbox");
if(h&&h.checked)if(register_username=="NONE"||register_username=="")window.location=server+"sites/my/"+g;else{PopFocus("user/claim","ShowTrackerVideo('2d4f2d47')");AddTracker(f)}else{d.innerHTML="This site already exists <a href='"+server+"sites/view/"+g+"'>here</a>.";d.style.display="block"}}else if(f.indexOf("404")!=-1){e.style.display="block";e.innerHTML="Site cannot be found. Please check the site address.";document.getElementById("www").select()}else if(a=="rss"){var j=f.indexOf("|||---|||*");
g=f.substr(0,j);f=f.substr(j+10);j=f.indexOf("|||---|||*");h=f.substr(0,j);f=f.substr(j+10);j=f.indexOf("|||---|||*");var k=f.substr(0,j),l=f.substr(j+10);document.getElementById("title").value=g;document.getElementById("www").value=h;document.getElementById("rss").value=k;document.getElementById("description").value=l}else{if(a=="www"){j=f.indexOf("|||---|||*");g=f.substr(0,j);f=f.substr(j+10);j=f.indexOf("|||---|||*");h=f.substr(0,j);f=f.substr(j+10);j=f.indexOf("|||---|||*");k=f.substr(0,j);f=
f.substr(j+10);j=f.indexOf("|||---|||*");l=f.substr(0,j);f=f.substr(j+10);document.getElementById("title").value=g;document.getElementById("www").value=h;document.getElementById("rss").value=k;document.getElementById("description").value=l;document.getElementById("tags").value=f;document.getElementById("saved_www1").innerHTML=h;if(document.getElementById("saved_www2"))document.getElementById("saved_www2").innerHTML=h;showSiteParts(2)}}else{document.getElementById("error").innerHTML="I couldn't find any data at that "+
a.toUpperCase()+" url.  Make sure it's a correct web address (including the http://)!";document.getElementById("error").style.display="block"}SetHeaderStatus("")},"text","post")}else{e.innerHTML="You can't submit a blank url!";e.style.display="block"}}
function showSiteParts(a){var c=document.getElementById("add_site_checkbox");if(c&&c.checked){if(document.getElementById("not_owner_submit"))document.getElementById("not_owner_submit").style.display="none";if(document.getElementById("owner_continue"))document.getElementById("owner_continue").style.display=""}else if(document.getElementById("owner_continue")){document.getElementById("owner_continue").style.display="";document.getElementById("owner_continue").style.display="none"}document.getElementById("error").style.display=
"none";document.getElementById("error").innerHTML="";document.getElementById("status").style.display="none";document.getElementById("status").innerHTML="";if(a){c=document.getElementById("site_www_part");var d=document.getElementById("site_info_part"),e=document.getElementById("site_verification_part");if(c)c.style.display="none";if(d)d.style.display="none";if(e)e.style.display="none";switch(a){case 1:c.style.display="block";break;case 2:d.style.display="block";break;case 3:var f=document.getElementById("saved_www1").innerHTML;
(new jx).load(server+"sites/verify_tracker/?www="+f,function(g){var h=g.indexOf("|||---|||*"),j=g.substr(0,h);g=g.substr(h+10);if(j=="true"){e.style.display="block";ShowTrackerVideo("2d4f2d47");AddTracker(f)}else if(g=="Unclaimed"){e.style.display="block";ShowTrackerVideo("2d4f2d47");AddTracker(f)}else if(g=="Not Found"){document.getElementById("error").style.display="block";document.getElementById("error").innerHTML="The site you're trying to claim, "+VerifyTrackerWWW+", does not exist on Viralogy"}else window.top.location=
g},"text","post");break}}}function AddTracker(a){VerifyTrackerWWW=a;PopCloseAction="clearTimeout(VerifyTrackerTimeout);"+PopCloseAction;setTimeout("touchJSPage(VerifyTrackerWWW)",500);VerifyTrackerTimeout=setTimeout("VerifyTracker(VerifyTrackerWWW)",1E3)}var VerifyTrackerTimeout=null,VerifyTrackerWWW=null,is_site_verified=false;
function VerifyTracker(a){document.getElementById("tracker_status").style.display="block";var c=document.getElementById("tracker_status_indicator");is_site_verified=false;(new jx).load(server+"sites/verify_tracker/?www="+a,function(d){var e=d.indexOf("|||---|||*"),f=d.substr(0,e);d=d.substr(e+10);if(f=="true"){e=d.indexOf("|||---|||*");f=d.substr(0,e);d=d.substr(e+10);is_site_verified=ret=true;if(e=document.getElementById("tracker_status"))e.innerHTML="Congratulations!<br>Your site has been verified and its traffic is counting towards your rank!";
setTimeout("DoClaim('"+f+"', '"+d+"')",500)}else if(d=="Unclaimed"){if(c&&c.innerHTML.length<10)c.innerHTML+=".";else if(c)c.innerHTML=".";touchJSPage(a);VerifyTrackerTimeout=setTimeout("VerifyTracker(VerifyTrackerWWW)",8E3)}else if(d=="Not Found"){if(e=document.getElementById("tracker_status"))e.innerHTML="The site you're trying to claim, "+VerifyTrackerWWW+", does not exist on Viralogy"}else window.top.location=d},"text","post")}
function touchJSPage(a){var c="viralogy_tracker_check_"+(new Date).getTime(),d=document.getElementById(c);if(!d){d=document.createElement("iframe");d.setAttribute("id",c);_setStyle(d,"width:0px;height:0px;visibility:hidden;display:none");document.body.appendChild(d)}d.src=a}register_username="NONE";
function DoRegister(){var a=false;if(document.getElementById("email").disabled!=true){if(document.getElementById("email").value.length<2){document.getElementById("error").innerHTML="Please enter an email address so we can verify your account";document.getElementById("error").style.display="block";return false}if(document.getElementById("username").value.length<4){document.getElementById("error").innerHTML="Please enter a username longer than 4 characters";document.getElementById("error").style.display=
"block";return false}if(document.getElementById("password").value.length<2){document.getElementById("error").innerHTML="Your password is too short!";document.getElementById("error").style.display="block";return false}if(document.getElementById("password").value!=document.getElementById("password2").value){document.getElementById("error").innerHTML="Your passwords don't match!  See, sometimes it's helpful to enter it twice!";document.getElementById("error").style.display="block";return false}document.getElementById("md5password").value=
hex_md5(document.getElementById("password").value);document.getElementById("password").value="";document.getElementById("password2").value="";document.getElementById("error").innerHTML="";document.getElementById("error").style.display="none";var c=new Date;SetHeaderStatus("Loading...");(new jx).load(server+"user/do_register/?email="+document.getElementById("email").value+"&username="+document.getElementById("username").value+"&md5password="+document.getElementById("md5password").value+"&timezone_offset="+
c.getTimezoneOffset(),function(d){if(d.indexOf("|||")!=-1){var e=d.indexOf("|||");register_username=d.substr(0,e);a=true}else{document.getElementById("error").innerHTML=d;document.getElementById("error").style.display="block";a=false}SetHeaderStatus("")},"text","post","no")}else a=true;if(a&&register_username!="NONE"){document.getElementById("error").innerHTML="";document.getElementById("error").style.display="none";document.getElementById("email").disabled=true;document.getElementById("username").disabled=
true;document.getElementById("password").disabled=true;document.getElementById("password2").disabled=true}return a}function DoRegisterFinish(){DoRegister()&&PopBlur()}function DoRegisterContinue(){if(DoRegister()){document.getElementById("register_1").style.display="none";document.getElementById("register_2").style.display="block"}}
function DoSiteRegister(){ret=false;document.getElementById("status").innerHTML="Scanning site url...";document.getElementById("status").style.display="block";(new jx).load(server+"sites/do_add/?username="+register_username+"&title="+escape(document.getElementById("title").value)+"&author="+escape(document.getElementById("author").value)+"&www="+escape(document.getElementById("www").value)+"&rss="+escape(document.getElementById("rss").value)+"&description="+escape(document.getElementById("description").value)+
"&tags="+escape(document.getElementById("tags").value)+"&twitter_username="+document.getElementById("twitter_username").value,function(a){document.getElementById("status").style.display="none";if(a=="true"){document.getElementById("error").style.display="none";PopBlur();ret=true}else{document.getElementById("error").innerHTML=a;document.getElementById("error").style.display="block";ret=false}SetHeaderStatus("")},"text","post","no");if(ret==true)if(PopCloseAction.indexOf("history")>-1){evale(PopCloseAction);
PopCloseAction="PopBlur()"}else window.location.reload(true)}
function DoClaim(a,c){c||(c=null);var d=false;if(a){d=true;register_username=a}else if(document.getElementById("email")&&document.getElementById("email").disabled!=true){if(document.getElementById("email").value.length<2){document.getElementById("error").innerHTML="Please enter an email address so we can verify your account";document.getElementById("error").style.display="block";return false}if(document.getElementById("username").value.length<4){document.getElementById("error").innerHTML="Please enter a username longer than 4 characters";
document.getElementById("error").style.display="block";return false}if(document.getElementById("password").value.length<2){document.getElementById("error").innerHTML="Your password is too short!";document.getElementById("error").style.display="block";return false}if(document.getElementById("password").value!=document.getElementById("password2").value){document.getElementById("error").innerHTML="Your passwords don't match!  See, sometimes it's helpful to enter it twice!";document.getElementById("error").style.display=
"block";return false}document.getElementById("md5password").value=hex_md5(document.getElementById("password").value);document.getElementById("password").value="";document.getElementById("password2").value="";document.getElementById("error").innerHTML="";document.getElementById("error").style.display="none";var e=new Date;SetHeaderStatus("Loading...");document.getElementById("status").innerHTML="Loading...";document.getElementById("status").style.display="block";(new jx).load(server+"user/do_register/?email="+
document.getElementById("email").value+"&username="+document.getElementById("username").value+"&md5password="+document.getElementById("md5password").value+"&timezone_offset="+e.getTimezoneOffset(),function(f){document.getElementById("status").style.display="none";if(f.indexOf("|||")!=-1){document.getElementById("error").style.display="none";var g=f.indexOf("|||");register_username=f.substr(0,g);d=true}else{document.getElementById("error").innerHTML=f;document.getElementById("error").style.display=
"block";d=false}SetHeaderStatus("")},"text","post","no")}else d=true;if(d&&register_username!="NONE"&&!a){document.getElementById("error").style.display="none";document.getElementById("email").disabled=true;document.getElementById("username").disabled=true;document.getElementById("password").disabled=true;document.getElementById("password2").disabled=true}a=document.getElementById("tracker_status");c=c?c:document.getElementById("site_id").value;if(d&&register_username!="NONE"&&is_site_verified){clearTimeout(VerifyTrackerTimeout);
d=false;SetHeaderStatus("Loading...");if(document.getElementById("error"))document.getElementById("error").style.display="none";document.getElementById("tracker_status").innerHTML="Loading...";document.getElementById("tracker_status").style.display="block";(new jx).load(server+"sites/do_add/?username="+register_username+"&site_id="+c,function(f){document.getElementById("tracker_status").style.display="none";if(f.indexOf("|||")!=-1){if(document.getElementById("error"))document.getElementById("error").style.display=
"none";var g=f.indexOf("|||");c=f.substr(0,g);d=true;ShowSiteClaimParts("FirstTimeClaimBadge")}else{if(document.getElementById("tracker_status")){document.getElementById("tracker_status").innerHTML=f;document.getElementById("tracker_status").style.display="block"}else{document.getElementById("error").innerHTML=f;document.getElementById("error").style.display="block"}d=false}SetHeaderStatus("")},"text","post","no")}else if(d&&register_username!="NONE"&&!is_site_verified){document.getElementById("register_about_you").style.display=
"none";document.getElementById("site_verification_part").style.display="block";ShowTrackerVideo("2d4f2d47");a=GetSiteWWWFromId(c);AddTracker(a);d=false}return d}
function GetSiteWWWFromId(a){document.getElementById("status").innerHTML="Loading...";document.getElementById("status").style.display="block";var c="";(new jx).load(server+"sites/get_www_from_id/?site_id="+a,function(d){document.getElementById("status").style.display="none";if(d.indexOf("|||")!=-1){var e=d.indexOf("|||");c=d.substr(0,e)}},"text","post","no");return c}
function DoAddSite(a,c){c||(c=false);var d=false,e=null;document.getElementById("error").style.display="none";document.getElementById("status").innerHTML="Loading...";document.getElementById("status").style.display="block";SetHeaderStatus("Loading...");(new jx).load(server+"sites/do_add/?username="+a+"&title="+escape(document.getElementById("title").value)+"&author="+escape(document.getElementById("author").value)+"&www="+escape(document.getElementById("www").value)+"&rss="+escape(document.getElementById("rss").value)+
"&description="+escape(document.getElementById("description").value)+"&tags="+escape(document.getElementById("tags").value),function(f){document.getElementById("status").style.display="none";document.getElementById("error").style.display="none";if(f.indexOf("|||")!=-1){var g=f.indexOf("|||");e=f.substr(0,g);if(document.getElementById("add_site_checkbox").checked){if(register_username&&register_username!="NONE")showSiteParts(3);else window.location=server+"sites/view/"+e;d=false}else{document.getElementById("status").innerHTML=
'Site Successfully Added. Redirecting... (<a href="'+server+"sites/view/"+e+'">or click here</a>)';document.getElementById("status").style.display="block";document.getElementById("error").style.display="none";d=true}}else{document.getElementById("error").innerHTML=f;document.getElementById("error").style.display="block";d=false}SetHeaderStatus("")},"text","post","no");if(d==true&&!c)window.location=server+"sites/my/"+e;return d}
function DoAddSiteAfter(a){var c=new jx;document.getElementById("error").style.display="none";document.getElementById("status").innerHTML="Loading...";document.getElementById("status").style.display="block";c.load(server+"sites/do_add/?username="+a+"&title="+escape(document.getElementById("title").value)+"&author="+escape(document.getElementById("author").value)+"&www="+escape(document.getElementById("www").value)+"&rss="+escape(document.getElementById("rss").value)+"&description="+escape(document.getElementById("description").value)+
"&tags="+escape(document.getElementById("tags").value),function(d){if(d=="true"){document.getElementById("status").innerHTML="Success!";document.getElementById("error").style.display="none";setTimeout("window.location.href=window.location.href;",1E3)}else{document.getElementById("error").innerHTML=d;document.getElementById("error").style.display="block"}},"text","post","no")}
function DoLogin(a){a||(a=0);var c=false;document.getElementById("md5password").value=hex_md5(document.getElementById("password").value);document.getElementById("password").value="";document.getElementById("error").style.display="none";var d=new Date,e=null;SetHeaderStatus("Loading...");(new jx).load(server+"user/do_login/?username="+document.getElementById("username").value+"&md5password="+document.getElementById("md5password").value+"&remember="+document.getElementById("remember").value+"&timezone_offset="+
d.getTimezoneOffset(),function(f){if(f.indexOf("true|||")!=-1){var g=f.indexOf("|||");e=f.substr(g+3);if(document.getElementById("site_id")){window.location=server+"sites/my/"+document.getElementById("site_id").value+"/"+a;c=false}else c=true}else{document.getElementById("error").innerHTML=f;document.getElementById("error").style.display="block";c=false}SetHeaderStatus("")},"text","post","no");if(c==true)window.location=e?e:server;return c}
function DoForgotPass(){document.getElementById("error").innerHTML="";var a=new Date;SetHeaderStatus("Sending...");(new jx).load(server+"user/forgot_password/?email="+escape(document.getElementById("email").value),function(c){if(c=="true"){document.getElementById("error").innerHTML="Username and password sent!";setTimeout("PopBlur()",3E3)}else document.getElementById("error").innerHTML=c;SetHeaderStatus("")},"text","post")}
function hide_help_message(a){SetHeaderStatus("Hiding...");(new jx).load(server+"user/hide_help_message/?id="+a,function(c){document.getElementById("help_message_"+a).innerHTML="";document.getElementById("help_message_"+a).style.display="none";document.getElementById("help_message_"+a).style.visibility="hidden";SetHeaderStatus("")},"text","post")}
function DoReport(){SetHeaderStatus("Reporting...");(new jx).load(server+"sites/report/?site_id="+document.getElementById("site_id").value+"&reason="+escape(document.getElementById("reason").value),function(a){document.getElementById("error").innerHTML="Abuse report filed.  Thanks!";setTimeout("PopBlur()",2E3);SetHeaderStatus("")},"text","post")}
function HideSiteLinks(a){a=document.getElementById("site_preview_report_"+a);a.style.filter="alpha(opacity=0)";a.style.opacity="0";a.style.mozOpacity="0"}function ShowSiteLinks(a){a=document.getElementById("site_preview_report_"+a);a.style.filter="alpha(opacity=100)";a.style.opacity="1";a.style.mozOpacity="1"}
function ShowTrackerVideo(a){document.getElementById("tracker_video").innerHTML='<h3 style=\'margin-bottom:5px\'>Viralogy Tutorial</h3><embed style="float:left" src="http://www.viddler.com/player/'+a+'/" width="280" height="210" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler_'+a+'"></embed>'}
function clippy(a){return'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="110" height="14" id="clippy" ><param name="movie" value="/images/clippy.swf"/><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="text='+a+'"><param name="bgcolor" value="#FFFFFF"><embed src="/images/clippy.swf" width="110" height="14" name="clippy" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="text='+
a+'" bgcolor="#FFFFFF" /> </object>'}
function updateCode(a){$$("#tracker_claim_site_form .disabled").removeClass("disabled");var c=document.getElementById("claim_code_text");switch(a){case "1":c.disabled=false;c.value='<script language="javascript" type="text/javascript">\n if (typeof ViralogyDI=="undefined") {\n  var protocol = ("https:" == document.location.protocol) ? "https" : "http";\n  document.write(unescape("%3Cscript type=\'text/javascript\' src=\'" + protocol + "://www.viralogy.com/javascript/vdi.js\'%3E%3C/script%3E"));\n }\n <\/script>';$$("dl .disabled").removeClass("disabled");
ShowTrackerVideo("2d4f2d47");break;case "2":c.disabled=false;c.value="<img src='http://insights.viralogy.com/api/xml/site.logPageView' style='visibility:hidden;height:0px;width:0px' alt='The Viralogy Tracker'/>";$$("dl .disabled").removeClass("disabled");ShowTrackerVideo("ff5ec200");break;case "3":c.disabled=false;c.value='<script language="javascript" type="text/javascript">\n if (typeof ViralogyDI=="undefined") {\n  var protocol = ("https:" == document.location.protocol) ? "https" : "http";\n  document.write(unescape("%3Cscript type=\'text/javascript\' src=\'" + protocol + "://www.viralogy.com/javascript/vdi.js\'%3E%3C/script%3E"));\n }\n <\/script>';
$$("dl .disabled").removeClass("disabled");ShowTrackerVideo("e88ecb06");break;default:c.value="Select a Site Type";c.disabled=true;$("step_2").addClass("disabled");$$("#step_2 + dd").addClass("disabled");$("step_3").addClass("disabled");$$("#step_3 + dd").addClass("disabled")}}
function DoAddCC(){SetHeaderStatus("Saving...");document.getElementById("error").innerHTML="Verifying...";(new jx).load(server+"user/do_add_creditcard/?type="+document.getElementById("cc_type").value+"&cc_number="+document.getElementById("cc_number").value+"&expiration_month="+document.getElementById("expiration_month").value+"&expiration_year="+document.getElementById("expiration_year").value+"&security_code="+document.getElementById("security_code").value+"&first_name="+escape(document.getElementById("first_name").value)+
"&last_name="+escape(document.getElementById("last_name").value)+"&address="+escape(document.getElementById("address").value)+"&city="+escape(document.getElementById("city").value)+"&state="+document.getElementById("state").value+"&zip="+document.getElementById("zip").value+"&country_code="+document.getElementById("country_code").value,function(a){if(a=="true"){document.getElementById("error").style.display="none";PopBlur();AMOUNT&&PlaceBid(AMOUNT);document.getElementById("add_cc")&&window.location.reload(false)}else{document.getElementById("error").innerHTML=
a;document.getElementById("error").style.display="block"}SetHeaderStatus("")},"text","post")}function MakeMoneySafe(a){a.value=a.value.replace(/\s+/,"");a.value=a.value.replace(/\$/gi,"");a.value=a.value.replace(/\-/gi,"");a.value=a.value.replace(/[a-zA-Z]+/gi,"");a.value=a.value.replace(/([0-9]+\.[0-9][0-9]).+/gi,"$1")}function LoadIntoDiv(a,c){SetHeaderStatus("Loading...");(new jx).load(server+c,function(d){if(d!="false")a.innerHTML=d;SetHeaderStatus("")},"text","post")}
function DoUpdateAccountSettings(){var a=false;if(document.getElementById("password").value!=document.getElementById("password2").value){document.getElementById("error").innerHTML="Your passwords don't match!  See, sometimes it's helpful to enter it twice!";document.getElementById("error").style.display="block";return false}if(document.getElementById("password").value!="")document.getElementById("md5password").value=hex_md5(document.getElementById("password").value);document.getElementById("password").value=
"";document.getElementById("password2").value="";document.getElementById("error").innerHTML="";SetHeaderStatus("Saving...");(new jx).load(server+"user/save_settings/?md5password="+document.getElementById("md5password").value,function(c){document.getElementById("error").innerHTML="Saved!";document.getElementById("error").style.display="block";a=true;SetHeaderStatus("")},"text","post","no");return a}
function DoUpdateSiteSettings(){var a=false;document.getElementById("error").innerHTML="";SetHeaderStatus("Saving...");(new jx).load(server+"sites/do_update/?title="+escape(document.getElementById("my_title").value)+"&author="+escape(document.getElementById("my_author").value)+"&rss="+escape(document.getElementById("my_rss").value)+"&www="+escape(document.getElementById("my_www").value)+"&description="+escape(document.getElementById("my_description").value)+"&tags="+escape(document.getElementById("my_tags").value)+
"&twitter_username="+document.getElementById("twitter_username").value,function(c){document.getElementById("error").innerHTML="Saved!";document.getElementById("error").style.display="block";a=true;SetHeaderStatus("")},"text","post","no");return a}
function RefreshBadge(a){a="";for(key in BadgeOptions)a+=key+"="+BadgeOptions[key]+"&";$("dummybadge").style.display="block";$("dummybadge_status").innerHTML="Loading badge...";$("dummybadge").src="";$("dummybadge").onload=function(){$("dummybadge_status").innerHTML="Your Badge Preview"};$("dummybadge").src=server+"sites/get_badge/1/"+escape(a).replace(/%/g,"_P")+"/"+escape($("claim_badge_tags").value).replace(/%/g,"_P")}
function ShowSiteClaimParts(a){$("claim_site").style.display="none";$("FirstTimeClaimBadge").style.display="none";$("RepeatClaimBadge").style.display="none";$("MoreInfoClaimBadge").style.display="none";$("Step1ClaimBadge").style.display="none";$("Step2ClaimBadge").style.display="none";$("Step3ClaimBadge").style.display="none";$("BadgePreview").style.display="none";if(a=="Step1ClaimBadge"||a=="Step2ClaimBadge"||a=="Step3ClaimBadge"||a=="RepeatClaimBadge")$("BadgePreview").style.display="block";if(a)$(a).style.display=
"block"}function SaveBadge(a,c){var d=false,e="";for(key in a)e+=key+"="+a[key]+"&";SetHeaderStatus("Saving...");(new jx).load(server+"sites/save_badge/?data="+escape(e)+"&tags="+escape(c),function(f){d=true;SetHeaderStatus("")},"text","post","no");return d}function rzCC(a){for(var c=/-([a-z])/;c.test(a);a=a.replace(c,RegExp.$1.toUpperCase()));return a}
function _setStyle(a,c){if(c.charAt(c.length-1)==";")c=c.slice(0,-1);for(var d=c.split(";"),e=0,f=d.length;e<f;e++){a=rzCC(d[e].split(":")[0]);c=d[e].split(":")[1];a=="undefined"||c=="undefined"||eval("element.style."+a+"='"+c+"'")}};

