﻿var $a=new Object();$a.constructor=function(){this.queuedEvents=new Array();this.subscribers=new Array();var $b=new Array();var $c;this.Init=function(){this.Load();};this.Dispose=function(){if($b){for(var n=0;n<$b.length;n++){var $d=$b[n];Sys.UI.DomEvent.removeHandler($d.elt,$d.type,$d.func);};$b=null;};var $e=document.body.getElementsByTagName("span");for(var n=0;n<$e.length;n++){var $f=$e[n];if($f.control){$f.control.node=null;$f.control=null;}}};this.Load=function(){alert("Did you forget to define load for child classes?");};this.getParams=function($g){var $h=new Array();for(i=0;i<$g.attributes.length;i++){var $i=$g.attributes[i];if($i.specified){$h[$i.nodeName.toLowerCase()]=$i.nodeValue;}};return $h};this.setParam=function($j,$k){if(null==this.params){this.params=new Array();};this.params[$j.toLowerCase()]=$k;};this.getParam=function($j){if(this.params){return this.params[$j.toLowerCase()];}else{return null;}};this.getLinkHref=function(){return "javascript:void(0);";};this.debug=function($l,$m,$n){if(null==$m){$m="debugDiv";};var $o=document.getElementById($m);if(!$o){$o=document.createElement("DIV");$o.id=$m;document.body.appendChild($o);};$o.appendChild(document.createTextNode($l));if($n){$o.appendChild(document.createElement("BR"));}};this.debugLine=function($l,$m){this.debug($l,$m,true);};this.cancelEvent=function(){var e=window.event;if(e&&e.preventDefault){e.preventDefault();};return false;};this.addListener=function($p,$q,func){var that=this;var args=arguments;$q=$q.toLowerCase();var $r=function(e){var $s="func.call(that, e";for(var n=3;n<args.length;n++){$s+=",args["+n+"]";};$s+=");";return eval($s);};if($q.indexOf("on")==0){$q=$q.replace(/on/,"");};Sys.UI.DomEvent.addHandler($p,$q,$r);var $t=new Object();$t.elt=$p;$t.type=$q;$t.func=$r;$b.push($t);};this.subscribeEvent=function($u,$t){if(this.subscribers){if(!this.subscribers[$u]){this.subscribers[$u]=new Array();};this.subscribers[$u].push($t);}};this.unsubscribeEvent=function($u,$t){if(this.subscribers){if(this.subscribers[$u]){this.subscribers[$u].remove($t);}}};this.fireEvent=function($u,$v){var $w=true;if(this.subscribers[$u]){for(var n=0;n<this.subscribers[$u].length;n++){try{var $x=this.subscribers[$u][n].onEvent($u,$v);if($x==false){$w=false;}}catch(e){}}};return $w;};this.onError=function(e,$y){alert("Error has occured: "+e.get_message()+e.get_stackTrace());};this.onTimeout=function(e,$y){alert("Timeout has occured: "+e.get_message()+e.get_stackTrace());};this.onComplete=function(){alert("Success");};};CoreJs=new $a.constructor();﻿$z=function(){this.Load=function(){var $e=document.body.getElementsByTagName("span");this.initializeElems($e);var $A=document.body.getElementsByTagName("DIV");this.initializeElems($A);};this.initializeElems=function($e){for(var n=0;n<$e.length;n++){var $f=$e[n];var $B=$f.getAttribute("control");if(checkString($B)){$B=$B.replace(/Core/,"CoreJs");if(eval($B)){var $t=eval("new "+$B+"()");$t.node=$f;$t.params=this.getParams($f);$t.Render($f);$f.control=$t;}else if(global["debugMode"]){this.debugLine("Control does not exist:"+$B);}};$B=null;};$e=null;};this.Render=function($c){if(this.$1p){if($c){this.$1p($c);}}};};$z.prototype=CoreJs;CoreJs.Controls=new $z();﻿$C=function(){this.formId;this.Required=false;this.Active=true;this.ClassName="";this.Name="";this.Message=null;this.ErrorMessage=null;this.DefaultValue=null;this.Value="";this.MaxLength=null;this.Type="";this.Load=function(){var $D=document.body.getElementsByTagName("form");for(var n=0;n<$D.length;n++){var $E=$D[n];var $e=$E.getElementsByTagName("SPAN");for(var i=0;i<$e.length;i++){var $f=$e[i];var $B=$f.getAttribute("ft");if(checkString($B)){$B=$B.replace(/Core/,"CoreJs");if(eval($B)){var $t=eval("new "+$B+"()");$t.params=this.getParams($f);$t.Render($f);$t.node=$f;}}};this.AddForm($E);$E.style.visibility="visible";}};this.AddForm=function($E){this.addListener($E,"onsubmit",fireSubmit,$E);};this.Render=function($c){var $F=this.getParam("formId");if($F){this.formId=$F;};if(this.getParam("fRequired")&&this.getParam("fRequired").toLowerCase()=="true"){this.Required=true;};if(this.getParam("fclass")){this.ClassName=this.getParam("fclass")};if(this.getParam("fName")){this.Name=this.getParam("fName");};if(this.getParam("fMsg")){this.Message=this.getParam("fMsg");};if(this.getParam("fError")){this.ErrorMessage=this.getParam("fError");};if(this.getParam("fDefault")){this.DefaultValue=this.getParam("fDefault");};if(this.getParam("fValue")){this.Value=this.getParam("fValue");};if(this.getParam("fMax")){this.MaxLength=this.getParam("fMax");};if(this.getParam("fType")){this.Type=this.getParam("fType");};if(this.$1p){if($c){this.$1p($c);}else{alert("Currently you need to specify a node for a form control");}}};function fireSubmit(e,$E){var $w=CoreJs.fireEvent(Event.FormSubmit,$E.id);if(!$w){if(e&&e.preventDefault){e.preventDefault();};this.cancelEvent();alert("Errors were found. Please review your input");return false;}}};$C.prototype=CoreJs;CoreJs.Forms=new $C();﻿var $G=new function(){this.isLoggedIn=function(){return parseInt(readCookie("userId"))>=0;};this.getNickname=function(){return readCookie("nickname");}};﻿var $H=false;var $I=false;var $J=false;$K=function(){if(!$J){if($H&&$I){$J=true;CoreJs.Forms.Init();CoreJs.Controls.Init();}}};function domLoaded(){$H=true;$K();};window.onload=makeDoubleDelegate(window.onload,domLoaded);function pageLoad(){$I=true;$K();};function pageUnload(){CoreJs.Forms.Dispose();CoreJs.Controls.Dispose();};﻿function checkDefined(o){return((typeof(o)!="undefined")&&(null !=o));};function checkString(s){return((s!=null)&&(typeof(s)=="string")&&(s.length>0));};function checkInt(s){return((s!=null)&&(typeof(s)=="number")&&(s.length>0));};function ll($L,$M){if($L.length>$M){return $L.substr(0,$M-3)+"...";}else{return $L;}};function getQueryVariable($N){var $O=window.location.search.substring(1);var $P=$O.split("&");for(var i=0;i<$P.length;i++){var $Q=$P[i].split("=");if($Q[0]==$N){return $Q[1];}};alert('Query Variable '+$N+' not found');};function addText($g,$R){$g.appendChild(document.createTextNode($R));};function addBr($g){$g.appendChild(document.createElement("BR"));};function SetDisplayMode($S,$T){if(checkDefined($T)&&checkString($S)){var $g=document.getElementById($S);if($g){if($T){$g.style.display="block";}else{$g.style.display="none";}}}};function SetElementValue($S,$k){var $g=document.getElementById($S);if($g){$g.value=$k;}};function SetVisibility($S,$k){var $g=document.getElementById($S);if($g){if($k){$g.style.visibility="visible";}else{$g.style.visibility="hidden";}}};function SetInnerText($S,$k){var $g=document.getElementById($S);if($g){$g.innerText=$k;}};function SetInnerHtml($S,$k){var $g=document.getElementById($S);if($g){$g.innerHTML=$k;}};function createCookie(name,$U,$V){if($V){var $W=new Date();$W.setTime($W.getTime()+($V*24*60*60*1000));var $X="; expires="+$W.toGMTString();}else var $X="";document.cookie=name+"="+$U+$X+"; path=/";};function readCookie(name){var $Y=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf($Y)==0)return c.substring($Y.length,c.length);};return null;};function eraseCookie(name){createCookie(name,"",-1);};function checkEmail($Z){var x=$Z;var $00=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if($00.test(x)){return true;}else{return false;}};function checkEmailBox($Z,$01){if($Z==$01){alert("You still have the default email. Please enter your email");}else if(checkEmail($Z)){return true;}else{alert("Your email is not valid");return false;}};function addToFavorites(){var $02="http:\\\\"+location.host;var $03=document.title;if(window.sidebar){window.sidebar.addPanel($03,$02,"");}else if(window.external){window.external.AddFavorite($02,$03);}else{alert("Sorry! Your browser doesn't support this function.");}};function saveToDelicious(){window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'delicious','toolbar=no,width=700,height=400');return false;};function makeDoubleDelegate($04,$05){return function(){if($04)$04();if($05)$05();}};function attachScript($06,$c){try{if(checkString($06)){var parent=checkDefined($c)?$c:document.body;var $07=document.createElement("SCRIPT");$07.type="text/javascript";parent.appendChild($07);$07.src=$06;}}catch(e){}};function removeChildren($c){var $08=$c.childNodes;for(var n=0;n<$08.length;n++){$c.removeChild($08[n]);}};function trackPageView($06){if(typeof(pageTracker)!="undefined"){pageTracker._trackPageview($06);}};﻿CoreJs.Controls.AutoSave=function(){var that=this;var $09=10000;var $0a=1000;var $0b="Server could not be reached. Do not publish or save until connection has been reestablished";var $0c=null;var $0d=-1;var $0e;this.ping=function(){Core.WebService.Ping(that.onPingCb,that.onTimeout,that.onError);};this.onPingCb=function(){$0c.innerText="Server connected: "+new Date();setTimeout($0e,$09);};this.autoSave=function(){var title=document.getElementById("title").value;var $0f=frames["mce_editor_0"].document.getElementById("mceContentBody").innerHTML;var $0g=document.getElementById("tags").value;if(checkString(title)||(checkString($0f)&&$0f!="<br>")){$0c.innerText="Connecting to server . . .";Core.WebService.SaveBlogPost($0d,title,$0f,$0g,that.onAutoSaveCb,that.onTimeout,that.onError);}else{setTimeout($0e,$09);}};this.onAutoSaveCb=function($0h){if($0h.Status==Core.ResultCode.NotLoggedIn){$0c.innerHTML="<font style='color:Red'>"+"You are no longer logged in"+"</font>";}else if(Core.LoginResultCode.Success==$0h.Status){$0c.innerText="Auto Saved at "+new Date();$0d=$0h.Val;}else{$0c.innerText="Server connected: "+new Date();};setTimeout($0e,$09);};this.onTimeout=function($0h){$0c.innerHTML="<font style='color:Red'>"+$0b+"</font><br/>"+new Date();setTimeout($0e,$0a);};this.onError=function($0h){$0c.innerText="Server Could not be reached";$0c.innerHTML="<font style='color:Red'>"+$0b+"</font> <br/>"+new Date();setTimeout($0e,$0a);};this.$1p=function(p){$0d=this.getParam("objectId");$0c=document.createElement("SPAN");p.appendChild($0c);{$0e=that.ping;};setTimeout($0e,1000);};};CoreJs.Controls.AutoSave.prototype=CoreJs.Controls;﻿CoreJs.Controls.DeleteCoupon=function(){var that=this;var $0i;var $0j;this.DeleteCoupon=function(){if(confirm("Are you sure you want to delete this coupon?")){Core.WebService.DeleteCoupon($0i,that.onCompleteCb,that.onTimeout,that.onError);};return false;};this.onCompleteCb=function($0k,$0l){if(Core.ResultCode.NotLoggedIn==$0k){CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);}else{$0j.innerHTML="Coupon Deleted";$0j.textContent="Coupon Deleted";}};this.$1p=function(p){$0i=this.getParam("couponId");$0j=document.createElement("SPAN");var $0m=document.createElement("A");$0m.href="#";$0m.appendChild(document.createTextNode("Delete Coupon"));that.addListener($0m,"onclick",that.DeleteCoupon);$0j.appendChild($0m);p.appendChild($0j);};};CoreJs.Controls.DeleteCoupon.prototype=CoreJs.Controls;﻿CoreJs.Controls.DeleteDeal=function(){var that=this;var $0n;var $0j;this.DeleteDeal=function(){if(confirm("Are you sure you want to delete this deal?")){Core.WebService.DeleteDeal($0n,that.onCompleteCb,that.onTimeout,that.onError);};return false;};this.onCompleteCb=function($0k,$0l){if(Core.ResultCode.NotLoggedIn==$0k){CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);}else{$0j.innerHTML="Deal Deleted";$0j.textContent="Deal Deleted";}};this.$1p=function(p){$0n=this.getParam("dealId");$0j=document.createElement("SPAN");var $0m=document.createElement("A");$0m.href="#";$0m.appendChild(document.createTextNode("Delete Deal"));that.addListener($0m,"onclick",that.DeleteDeal);$0j.appendChild($0m);p.appendChild($0j);};};CoreJs.Controls.DeleteDeal.prototype=CoreJs.Controls;﻿CoreJs.Controls.Digg=function(){var that=this;var $0d;var $0o;var $0p;var $0q=document.createElement("SPAN");var $0r=document.createElement("SPAN");var $0s;var $0t=null;this.Digg=function(){$0t=setTimeout(function(){that.showStatus("Rating . . .")},100);Core.WebService.Digg($0d,$0o,$0p,that.onDiggCb,that.onTimeout,that.onError);};this.Bury=function(){$0t=setTimeout(function(){that.showStatus("Rating . . .")},100);Core.WebService.Bury($0d,$0o,$0p,that.onBuryCb,that.onTimeout,that.onError);};this.showStatus=function(status){$0q.innerHTML=status;$0q.style.display="inline";$0r.style.display="none";};this.showButtons=function(){$0q.style.display="none";$0r.style.display="inline";};this.onDiggCb=function($0k){that.onRateCb($0k,1);};this.onBuryCb=function($0k){that.onRateCb($0k,-1);};this.onRateCb=function($0k,$0u){clearTimeout($0t);if(Core.ResultCode.NotLoggedIn==$0k.Status){CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);that.showButtons();}else{that.showStatus("Rated");if($0s){$0s($0u);}}};this.setRateCb=function(func){$0s=func;};this.$1p=function(p){$0d=this.getParam("objectId");$0o=this.getParam("objectType");$0p=this.getParam("ownerId");var $0v=this.getParam("diggImgSrc");if(!checkString($0v)){$0v="../i/thumbsUp.png";};var $0w=this.getParam("buryImgSrc");if(!checkString($0w)){$0w="../i/thumbsDown.png";};var e,$0x;p.className="rating";$0q=document.createElement("SPAN");$0r.style.textAlign="center";e=document.createElement("A");e.href="javascript:void(0);";$0x=document.createElement("IMG");$0x.src=$0v;$0x.border=0;e.appendChild($0x);that.addListener(e,"onclick",that.Digg);$0r.appendChild(e);$0r.appendChild(document.createTextNode(" "));e=document.createElement("A");e.href="javascript:void(0);";$0x=document.createElement("IMG");$0x.src=$0w;$0x.border=0;e.appendChild($0x);that.addListener(e,"onclick",that.Bury);$0r.appendChild(e);p.appendChild($0r);p.appendChild($0q);};};CoreJs.Controls.Digg.prototype=CoreJs.Controls;﻿Event=new Object();Event.LoggedIn=100;Event.LoggedOut=101;Event.ShowLoginCtrl=102;Event.ShowOverlayDiv=200;Event.HideOverlayDiv=201;Event.NotifyConfirm=300;Event.FormSubmit=301;Event.PostDealSubmit=400;Event.LogABug=500;﻿CoreJs.Controls.Favorites=function(){var that=this;var $0d;var $0o;var $0y;var $0z,$0A;this.AddFavorite=function(){if($G.isLoggedIn()){Core.WebService.AddFavorite($0d,$0o,that.onAddCb,that.onTimeout,that.onError);}else{CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);};return that.cancelEvent();};this.RemoveFavorite=function(){if($G.isLoggedIn()){Core.WebService.RemoveFavorite($0d,$0o,that.onRemoveCb,that.onTimeout,that.onError);}else{CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);};return that.cancelEvent();};this.onAddCb=function($0k){that.onCompleteCb($0k,false);};this.onRemoveCb=function($0k){that.onCompleteCb($0k,true);};this.onCompleteCb=function($0k,$0B){if(Core.ResultCode.NotLoggedIn==$0k){CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);}else{showAddMode($0B);}};function showAddMode($0B){if($0B){$0z.style.display="inline";$0A.style.display="none";}else{$0z.style.display="none";$0A.style.display="inline";}};this.$1p=function(p){var $0m;$0d=this.getParam("objectId");$0o=this.getParam("objectType");$0y=this.getParam("mode");$0z=document.createElement("SPAN");$0z.style.display="none";$0m=document.createElement("A");$0m.href="javascript:void(0)";$0m.appendChild(document.createTextNode("Add To Favorites"));that.addListener($0m,"onclick",that.AddFavorite);$0z.appendChild($0m);$0A=document.createElement("SPAN");$0A.style.display="none";$0m=document.createElement("A");$0m.href="javascript:void(0)";$0m.appendChild(document.createTextNode("Remove From Favorites"));that.addListener($0m,"onclick",that.RemoveFavorite);$0A.appendChild($0m);showAddMode(0==$0y);p.appendChild($0z);p.appendChild($0A);};};CoreJs.Controls.Favorites.prototype=CoreJs.Controls;﻿CoreJs.Controls.Flagging=function(){var groupName;var that=this;var $0d;var $0o;var $c;var $o;var $0C;var $0D=null;this.onFlag=function(){hideDiv();{var $0E=document.getElementsByName(groupName);var n;for(n=0;n<$0E.length;n++){if($0E[n].checked){$0C=$0E[n].value;Core.WebService.Flag($0d,$0o,$0C,that.onFlagCb,that.onTimeout,that.onError);}}}};this.onFlagCb=function($0k){if(Core.ResultCode.NotLoggedIn==$0k){CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);}else{var $L;switch(parseInt($0C)){case Core.ModerationType.BadLink:$L="BadLink";that.debugLine("bad");break;case Core.ModerationType.Expired:$L="Expired";break;case Core.ModerationType.Inaccurate:$L="Inaccurate";break;case Core.ModerationType.Miscategorized:$L="Miscategorized";break;case Core.ModerationType.Offensive:$L="Offensive";break;case Core.ModerationType.Spam:$L="Spam";break;default:$L="Flagged";};$c.innerHTML=$L;}};function toggleDiv(){if($o.style.visibility=="visible"){hideDiv();}else{{showDiv();}};return that.cancelEvent();};function showDiv(){cancelHideDiv();$o.style.display="block";$o.style.visibility="visible";};function scheduleHideDiv(){$0D=setTimeout(hideDiv,500);};function cancelHideDiv(){clearTimeout($0D);};function hideDiv(){$o.style.display="none";$o.style.visibility="hidden";};function onRadioSelectCb(){that.onFlag();};this.$1p=function(p){removeChildren(p);$0d=this.getParam("objectId");$0o=this.getParam("objectType");groupName="Flag"+$0d+$0o;var $f=document.createElement("SPAN");$f.style.position="relative";var $0m=document.createElement("A");$0m.href=that.getLinkHref();$0m.appendChild(document.createTextNode("Flag"));that.addListener($0m,"onclick",toggleDiv);that.addListener($0m,"onmouseover",cancelHideDiv);that.addListener($0m,"onmouseout",scheduleHideDiv);$f.appendChild($0m);$o=document.createElement("DIV");$o.className="flaggingDiv";$o.style.visibility="hidden";$o.style.display="none";that.addListener($o,"onmouseover",showDiv);that.addListener($o,"onmouseout",scheduleHideDiv);var $0F;if(4==$0o||6==$0o){$0F=document.createElement("SPAN");$0F.innerHTML="<input type=\"radio\" name=\""+groupName+"\" value=\""+Core.ModerationType.BadLink+"\"></input>";that.addListener($0F,"onclick",onRadioSelectCb);$o.appendChild($0F);addText($o," Bad Link");addBr($o);$0F=document.createElement("SPAN");$0F.innerHTML="<input type=\"radio\" name=\""+groupName+"\" value=\""+Core.ModerationType.Expired+"\"></input>";that.addListener($0F,"onclick",onRadioSelectCb);$o.appendChild($0F);addText($o," Expired");addBr($o);$0F=document.createElement("SPAN");$0F.innerHTML="<input type=\"radio\" name=\""+groupName+"\" value=\""+Core.ModerationType.Inaccurate+"\"></input>";that.addListener($0F,"onclick",onRadioSelectCb);$o.appendChild($0F);addText($o," Inaccurate");addBr($o);$0F=document.createElement("SPAN");$0F.innerHTML="<input type=\"radio\" name=\""+groupName+"\" value=\""+Core.ModerationType.Miscategorized+"\"></input>";that.addListener($0F,"onclick",onRadioSelectCb);$o.appendChild($0F);addText($o," Miscategorized");addBr($o);};$0F=document.createElement("SPAN");$0F.innerHTML="<input type=\"radio\" name=\""+groupName+"\" value=\""+Core.ModerationType.Offensive+"\"></input>";that.addListener($0F,"onclick",onRadioSelectCb);$o.appendChild($0F);addText($o," Offensive");addBr($o);$0F=document.createElement("SPAN");$0F.innerHTML="<input type=\"radio\" name=\""+groupName+"\" value=\""+Core.ModerationType.Spam+"\"></input>";that.addListener($0F,"onclick",onRadioSelectCb);$o.appendChild($0F);addText($o," Spam");addBr($o);$f.appendChild($o);p.appendChild($f);$c=p;};};CoreJs.Controls.Flagging.prototype=CoreJs.Controls;﻿CoreJs.Controls.LoginDialog=function(){CoreJs.Controls.subscribeEvent(Event.ShowLoginCtrl,this);this.onEvent=function($u,$v){switch($u){case Event.ShowLoginCtrl:that.Show();break;}};var that=this;var $0n;var $0G;var $Z;var $0H;var $0I;this.LoginSubmit=function(e){if(checkEmail($Z.value)){if(checkString($0H.value)){Core.WebService.Login($Z.value,$0H.value,$0I.checked,that.onLoginCb,that.onTimeout,that.onError);}else{alert("Incorrect email/password combination");}}else{alert("Your email is invalid");};return cancelSubmit(e,1);};function cancelSubmit(e){if(e&&e.preventDefault){e.preventDefault();};return false;};this.onLoginCb=function($0k){if(Core.LoginResultCode.Success==$0k.Result){CoreJs.Controls.fireEvent(Event.LoggedIn,$0k);that.Hide();$0H.value="";}else if(Core.LoginResultCode.Locked==$0k.Result){alert("Your account is locked due to too many failed login attempts. Please try again in a hour, or reset your password.");}else{alert("Incorrect email/password combination");}};this.Show=function(){CoreJs.Controls.fireEvent(Event.ShowOverlayDiv);if($0G){$0G.style.top=(100+document.documentElement.scrollTop)+"px";$0G.style.display="block";};if("true"==readCookie("RememberMe")&&$0H&&$0H.select){$0H.focus();}else if($Z&&$Z.select){$Z.focus();}};this.Hide=function(){CoreJs.Controls.fireEvent(Event.HideOverlayDiv);if($0G){$0G.style.display="none";};return false;};this.$1p=function(p){var h3,$0J,a,$g;$0G=document.createElement("DIV");$0G.style.display="none";$0G.className="loginMain";$g=document.createElement("DIV");$g.style.textAlign="right";a=document.createElement("A");a.href="javascript:void(0)";a.appendChild(document.createTextNode("Close"));that.addListener(a,"onclick",that.Hide);$g.appendChild(a);$0G.appendChild($g);var $0K=document.createElement("DIV");$0K.className="main loginExist";h3=document.createElement("H3");h3.appendChild(document.createTextNode("Existing Users"));$0K.appendChild(h3);var $E=document.createElement("FORM");$E.onsubmit=that.LoginSubmit;var dl,dt,dd;dl=document.createElement("DL");dt=document.createElement("DT");dt.style.width="150px";addText(dt,"Email address:");dl.appendChild(dt);dd=document.createElement("DD");dd.style.marginLeft="170px";$Z=document.createElement("INPUT");if(null !=readCookie("Username")){$Z.value=readCookie("Username");};$Z.style.width="200px";dd.appendChild($Z);dl.appendChild(dd);dt=document.createElement("DT");dt.style.width="150px";addText(dt,"Password:");dl.appendChild(dt);dd=document.createElement("DD");dd.style.marginLeft="170px";$0H=document.createElement("INPUT");$0H.type="password";$0H.size="20";$0H.style.width="200px";if(null !=readCookie("Password")){$0H.value=readCookie("Password");};dd.appendChild($0H);dl.appendChild(dd);$E.appendChild(dl);$0L=document.createElement("DIV");$0L.style.paddingTop="10px";$0L.style.clear="both";$0L.style.textAlign="center";$0J=document.createElement("INPUT");$0J.type="submit";$0J.value="Login";$0L.appendChild($0J);$0L.appendChild(document.createElement("BR"));$0I=document.createElement("INPUT");$0I.type="checkbox";$0I.style.width="20px";$0L.appendChild($0I);if(null !=readCookie("RememberMe")){if("true"==readCookie("RememberMe")){$0I.defaultChecked=true;}else{$0I.defaultChecked=false;}};$0L.appendChild(document.createTextNode("Remember me"));$0L.appendChild(document.createElement("BR"));$0L.appendChild(document.createElement("BR"));a=document.createElement("A");a.href=global["ForgotPasswordLink"];a.appendChild(document.createTextNode("Forgot your password?"));$0L.appendChild(a);$E.appendChild($0L);$0K.appendChild($E);$0G.appendChild($0K);var $0M=document.createElement("DIV");$0M.className="sidebar loginRegistration";h3=document.createElement("H3");h3.appendChild(document.createTextNode("New Users"));$0M.appendChild(h3);$g=document.createTextNode("Try our super simple registration!");$0M.appendChild($g);addBr($0M);addBr($0M);a=document.createElement("A");a.href=global["RegisterLink"];a.appendChild(document.createTextNode("Click here to sign up."));$0M.appendChild(a);$0G.appendChild($0M);p.appendChild($0G);}};CoreJs.Controls.LoginDialog.prototype=CoreJs.Controls;window.onload=makeDoubleDelegate(window.onload,function(){var $0N=new CoreJs.Controls.LoginDialog();var e=document.createElement("SPAN");$0N.Render(e);document.body.appendChild(e);});﻿CoreJs.Controls.LoginJoinLink=function(){CoreJs.Controls.subscribeEvent(Event.LoggedIn,this);CoreJs.Controls.subscribeEvent(Event.LoggedOut,this);this.onEvent=function($u,$v){switch($u){case Event.LoggedIn:setNickname($v.Nickname);toggleDiv(true);break;case Event.LoggedOut:toggleDiv(false);break;}};var that=this;var $0O;var $0P;var $0Q;var $0R;this.ShowLogin=function(){CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);};this.Logout=function(){Core.WebService.Logout(that.onLogoutCb,that.onTimeout,that.onError);};this.onLogoutCb=function(){CoreJs.Controls.fireEvent(Event.LoggedOut);};function setNickname($0O){$0R.innerHTML="";if(checkString($0O)){addText($0R,ll($0O,15));}};function toggleDiv($0S){if($0S){$0Q.style.display="none";$0P.style.display="inline";}else{$0P.style.display="none";$0Q.style.display="inline";}};this.$1p=function(p){p.innerHTML="";var $0T=this.getParam("nicknameLink");var $0U=this.getParam("myAccountLink");var a;$0O=$G.getNickname();$0P=document.createElement("SPAN");$0P.style.display="none";p.appendChild($0P);$0P.appendChild(document.createTextNode("Welcome "));a=document.createElement("A");a.href=$0T;$0R=document.createElement("SPAN");setNickname($0O);a.appendChild($0R);$0P.appendChild(a);$0P.appendChild(document.createTextNode(" | "));a=document.createElement("A");a.href=$0U;a.appendChild(document.createTextNode("My Account"));$0P.appendChild(a);$0P.appendChild(document.createTextNode(" | "));a=document.createElement("A");a.href="#";a.appendChild(document.createTextNode("Logout"));that.addListener(a,"onclick",that.Logout);$0P.appendChild(a);$0Q=document.createElement("SPAN");$0Q.style.display="none";p.appendChild($0Q);a=document.createElement("A");a.href="#";a.appendChild(document.createTextNode("Login"));that.addListener(a,"onclick",that.ShowLogin);$0Q.appendChild(a);$0Q.appendChild(document.createTextNode(" | "));a=document.createElement("A");a.href=gConfig.RegisterLink;a.appendChild(document.createTextNode("Join"));$0Q.appendChild(a);if($G.isLoggedIn()){toggleDiv(true);}else{toggleDiv(false);}};};CoreJs.Controls.LoginJoinLink.prototype=CoreJs.Controls;﻿CoreJs.Controls.LoginLink=function(){CoreJs.Controls.subscribeEvent(Event.LoggedIn,this);CoreJs.Controls.subscribeEvent(Event.LoggedOut,this);this.onEvent=function($u,$v){switch($u){case Event.LoggedIn:toggleDiv(true);break;case Event.LoggedOut:toggleDiv(false);break;}};var that=this;var $0O;var $0P;var $0Q;this.ShowLogin=function(){CoreJs.Controls.fireEvent(Event.ShowLoginCtrl);};this.Logout=function(){Core.WebService.Logout(that.onLogoutCb,that.onTimeout,that.onError);};this.onLogoutCb=function(){CoreJs.Controls.fireEvent(Event.LoggedOut);};function toggleDiv($0S){if($0S){$0Q.style.display="none";$0P.style.display="inline";}else{$0P.style.display="none";$0Q.style.display="inline";}};this.$1p=function(p){var a;$0P=document.createElement("SPAN");$0P.style.display="none";p.appendChild($0P);a=document.createElement("A");a.href="javascript:void(0)";a.appendChild(document.createTextNode("Logout"));that.addListener(a,"onclick",that.Logout);$0P.appendChild(a);$0Q=document.createElement("SPAN");$0Q.style.display="none";p.appendChild($0Q);a=document.createElement("A");a.href="javascript:void(0)";a.appendChild(document.createTextNode("Login"));that.addListener(a,"onclick",that.ShowLogin);$0Q.appendChild(a);if($G.isLoggedIn()){toggleDiv(true);}else{toggleDiv(false);}};};CoreJs.Controls.LoginLink.prototype=CoreJs.Controls;﻿CoreJs.Controls.LoginToggleDiv=function(){CoreJs.Controls.subscribeEvent(Event.LoggedIn,this);CoreJs.Controls.subscribeEvent(Event.LoggedOut,this);this.onEvent=function($u,$v){switch($u){case Event.LoggedIn:toggleDiv(true);break;case Event.LoggedOut:toggleDiv(false);break;}};var that=this;var $c;var $0V;var $0y;function toggleDiv($0S){var $0W;if($0V){if($0y==0){if($0S){$0W=true;}else{$0W=false;}}else{if(!$0S){$0W=true;}else{$0W=false;}};if($0W){$c.style.display="inline";}else{$c.style.display="none";}}};function fireMode($0y,$0X){};this.$1p=function(p){$0y=parseInt(this.getParam("mode"));$0V=this.getParam("active").toLowerCase()=="true";$c=p;toggleDiv($G.isLoggedIn());};};CoreJs.Controls.LoginToggleDiv.prototype=CoreJs.Controls;﻿CoreJs.Controls.OverlayDiv=function(){CoreJs.Controls.subscribeEvent(Event.ShowOverlayDiv,this);CoreJs.Controls.subscribeEvent(Event.HideOverlayDiv,this);this.onEvent=function($u,$v){switch($u){case Event.ShowOverlayDiv:showDiv();break;case Event.HideOverlayDiv:hideDiv(false);break;}};var that=this;var $0Y;function showDiv(){var $0Z;switch(Sys.Browser.agent){case Sys.Browser.Firefox:$0Z=document.documentElement.scrollHeight;break;case Sys.Browser.InternetExplorer:default:$0Z=document.documentElement.scrollHeight;if($0Z<document.documentElement.clientHeight){$0Z=document.documentElement.clientHeight;};break;};$0Y.style.height=$0Z+"px";$0Y.style.display="block";};function hideDiv(){$0Y.style.display="none";};this.$1p=function(p){$0Y=document.createElement("DIV");$0Y.className="overlayDiv";hideDiv();p.appendChild($0Y);};};CoreJs.Controls.OverlayDiv.prototype=CoreJs.Controls;window.onload=makeDoubleDelegate(window.onload,function(){var $0N=new CoreJs.Controls.OverlayDiv();var e=document.createElement("SPAN");$0N.Render(e);document.body.appendChild(e);});﻿CoreJs.Controls.PageRefresh=function(){CoreJs.Controls.subscribeEvent(Event.LoggedIn,this);this.onEvent=function($u,$v){switch($u){case Event.LoggedIn:refreshPage();break;}};var that=this;function refreshPage(){window.location.reload(false);};this.$1p=function(p){};};CoreJs.Controls.PageRefresh.prototype=CoreJs.Controls;﻿CoreJs.Controls.RatingControl=function(){var that=this;var $0d;var $0o;var $0p;var $10;var $11;var $12=0;this.setscore=function($13){if($11){$11.innerText=""+($12+$13);}};this.$1p=function(p){$0d=this.getParam("objectId");$0o=this.getParam("objectType");$0p=this.getParam("ownerId");$12=parseInt(this.getParam("score"));var $0G=document.createElement("DIV");$0G.className="dealVote";var $o=document.createElement("DIV");$o.style.border="solid 1px Gray";$o.style.padding="8px";$11=document.createElement("SPAN");$11.appendChild(document.createTextNode($12));$o.appendChild($11);$o.appendChild(document.createElement("BR"));$o.appendChild(document.createTextNode("Points"));$0G.appendChild($o);var $14=document.createElement("DIV");$10=new CoreJs.Controls.Digg();$10.setParam("objectId",$0d);$10.setParam("objectType",$0o);$10.setParam("ownerId",$0p);$10.setRateCb(that.setscore);$10.Render($14);$0G.appendChild($14);p.appendChild($0G);};};CoreJs.Controls.RatingControl.prototype=CoreJs.Controls;﻿CoreJs.Controls.RatingControlMini=function(){var that=this;var $0d;var $0o;var $0p;var $15;var $16;var $17=0;this.setScore=function($18){if($16){$16.innerHTML=""+($17+$18)+"pts: ";}};this.$1p=function(p){$0d=this.getParam("objectId");$0o=this.getParam("objectType");$0p=this.getParam("ownerId");$17=parseInt(this.getParam("Score"));var $19=document.createElement("SPAN");$19.style.width="300px";$16=document.createElement("SPAN");$19.appendChild($16);var $14=document.createElement("SPAN");$15=new CoreJs.Controls.Digg();$15.setParam("objectId",$0d);$15.setParam("objectType",$0o);$15.setParam("ownerId",$0p);$15.setParam("diggImgSrc",this.getParam("diggImgSrc"));$15.setParam("buryImgSrc",this.getParam("buryImgSrc"));$15.setRateCb(that.setScore);$15.Render($14);$19.appendChild($14);p.appendChild($19);};};CoreJs.Controls.RatingControlMini.prototype=CoreJs.Controls;﻿CoreJs.Controls.TagCloud=function(){var that=this;var $1a=10;var $1b=25;function findMax(){var $1c=0;for(var n=0;n<tagCloudItems.length;n++){if(tagCloudItems[n].count>$1c){$1c=tagCloudItems[n].count;}};return $1c;};this.$1p=function(p){removeChildren(p);var $o=document.createElement("DIV");var $1c=findMax();var $1d=this.getParam("maxTagLength");var $1e=this.getParam("baseUrl");for(var n=0;n<tagCloudItems.length;n++){var $0m=document.createElement("A");var $1f=tagCloudItems[n].tag;$0m.count=tagCloudItems[n].count;if(tagCloudItems[n].count==1){$0m.style.fontSize=Math.floor(($1b+$1a)/2)+"px";}else{$0m.style.fontSize=Math.floor(($1b-$1a)*tagCloudItems[n].count/$1c+$1a)+"px";};$0m.title=$1f;$0m.href=$1e+escape($1f);if($1d>0&&$1f.length>$1d){$1f=$1f.substr(0,$1d);};$0m.appendChild(document.createTextNode($1f.toLowerCase()));$o.appendChild($0m);$o.appendChild(document.createTextNode(" "));};p.appendChild($o);};};CoreJs.Controls.TagCloud.prototype=CoreJs.Controls;﻿CoreJs.Forms.AnonymousLogin=function(){CoreJs.Controls.subscribeEvent(Event.LoggedIn,this);CoreJs.Controls.subscribeEvent(Event.LoggedOut,this);this.onEvent=function($u,$v){switch($u){case Event.LoggedIn:hideIdentify();break;case Event.LoggedOut:showIdentify();break;}};var that=this;var $0n;var $0j;var $0P;var $0G;var $1g;function showIdentify(){$0G.style.display="block";$0P.style.display="none";$1g.Required=(true&&that.Required);$1g.Active=true;};function hideIdentify(){$0P.style.display="block";$0G.style.display="none";$1g.Required=(false&&that.Required);$1g.Active=false;};this.$1p=function(p){var $f;$0G=document.createElement("DIV");var $1h=document.createElement("DIV");$1h.className="anonSection";$1h.style.cssFloat="left";$1h.style.styleFloat="left";$f=document.createElement("SPAN");$f.className="anonSectionTitle";addText($f,"Have an account?");$1h.appendChild($f);addBr($1h);addText($1h,"Please ");var $1i=document.createElement("SPAN");var $0N=new CoreJs.Controls.LoginLink();$0N.Render($1i);$1h.appendChild($1i);$0G.appendChild($1h);var $1j=document.createElement("DIV");$1j.className="anonSection";$1j.style.cssFloat="right";$1j.style.styleFloat="right";$f=document.createElement("SPAN");$f.className="anonSectionTitle";addText($f,"Want to post anonymously?");$1j.appendChild($f);addBr($1j);addBr($1j);addText($1j,"Please enter your email");addBr($1j);var $0J=document.createElement("SPAN");$1g=new CoreJs.Forms.Email();$1g.Name=this.Name;$1g.DefaultValue=this.DefaultValue;$1g.Value=this.Value;$1g.ErrorMessage=this.ErrorMessage;$1g.formId=this.formId;$1g.Required=this.Required;$1g.Render($0J);$1j.appendChild($0J);addBr($1j);$f=document.createElement("SPAN");$f.style.fontSize="10px";addText($f,"(For Verification Purposes)");$1j.appendChild($f);$0G.appendChild($1j);addBr($0G);addBr($0G);$0P=document.createElement("DIV");addText($0P,"You are logged in. Life is good.");if($G.isLoggedIn()){hideIdentify();}else{showIdentify();};p.appendChild($0P);p.appendChild($0G);};};CoreJs.Forms.AnonymousLogin.prototype=CoreJs.Forms;﻿CoreJs.Forms.BotDetection=function(){CoreJs.Controls.subscribeEvent(Event.LoggedIn,this);CoreJs.Controls.subscribeEvent(Event.LoggedOut,this);this.onEvent=function($u,$v){switch($u){case Event.LoggedIn:$1k.Required=that.Required||!$v.Trusted;if($v.Trusted){toggleDiv("none");};break;case Event.LoggedOut:$1k.Required=true;toggleDiv("block");break;}};function toggleDiv($0W){var $g=document.getElementById("BotDiv");if($g){$g.style.display=$0W;}};var that=this;this.Trusted=false;var $1k;this.$1p=function(p){if(this.getParam("ftrusted")&&this.getParam("ftrusted").toLowerCase()=="true"){this.Trusted=true;};var $0J=document.createElement("SPAN");$1k=new CoreJs.Forms.TextBox();$1k.Name=this.Name;$1k.DefaultValue=this.DefaultValue;$1k.Value=this.Value;$1k.ErrorMessage=this.ErrorMessage;$1k.formId=this.formId;$1k.Required=this.Required;$1k.Render($0J);if(!this.Required&&this.Trusted){toggleDiv("none");}else{toggleDiv("block");};p.appendChild($0J);};};CoreJs.Forms.BotDetection.prototype=CoreJs.Forms;﻿CoreJs.Forms.Email=function(){CoreJs.subscribeEvent(Event.FormSubmit,this);this.onEvent=function($u,$v){switch($u){case Event.FormSubmit:if(that.formId==$v){return that.onSubmit();};break;}};var that=this;var $1l;var $c;var $1m;this.onSubmit=function(){var $0h;var $k=$1m.value;if(that.Active&&that.Required&&(!checkString($k)||$k==this.DefaultValue)){that.showError("This is a required field");$0h=false;}else if(that.Active&&checkString($k)&&!checkEmail($k)){that.showError("This is an invalid email address.");$0h=false;}else{that.hideError();$0h=true;};return $0h;};this.showError=function($l){$1l.style.display="block";$1l.innerHTML=$l;};this.hideError=function(){$1l.style.display="none";};this.$1p=function(p){$c=p;$1m=document.createElement("INPUT");$1m.className=this.ClassName;$1m.type="text";$1m.name=this.Name;$1m.value=this.Value;$1m.size=20;that.addListener($1m,"onclick",function(){if($1m.value==this.DefaultValue){$1m.value="";}});$c.appendChild($1m);if(checkString(this.Message)){var $f=document.createElement("DIV");$f.innerHTML=this.Message;$c.appendChild($f);};var $o=document.createElement("DIV");$1l=$o;$o.className="errorMsg";if(checkString(this.ErrorMessage)){this.showError(this.ErrorMessage);}else{this.hideError();};$c.appendChild($o);};};CoreJs.Forms.Email.prototype=CoreJs.Forms;﻿CoreJs.Forms.TextArea=function(){CoreJs.subscribeEvent(Event.NotifyConfirm,this);CoreJs.subscribeEvent(Event.FormSubmit,this);this.onEvent=function($u,$v){switch($u){case Event.NotifyConfirm:if($v.id==id){$1n=$v.func;};break;case Event.FormSubmit:if(that.formId==$v){return that.onSubmit();};break;}};var that=this;var id;var $1l;var $c;var $1m;var $1n=null;this.onSubmit=function(){var $0h;if(!checkString($1m.value)){if($1m.type=="password"){that.showError("Please confirm your password");}else{that.showError("This is a required field");};$0h=false;}else if($1n&&$1m.value!=$1n()){that.showError("Passwords do not match");$0h=false;}else{that.hideError();$0h=true;};return $0h;};this.showError=function($l){$1l.style.display="block";$1l.innerHTML=$l;};this.hideError=function(){$1l.style.display="none";};this.$1p=function(p){$c=p;id=this.Name;$1m=document.createElement("textarea");$1m.rows="11";$1m.name=this.Name;addText($1m,this.Value);$c.appendChild($1m);if(checkString(this.Message)){var $f=document.createElement("DIV");$f.innerHTML=this.Message;$c.appendChild($f);};var $o=document.createElement("DIV");$1l=$o;$o.style.color="RED";if(checkString(this.ErrorMessage)){this.showError(this.ErrorMessage);}else{this.hideError();};$c.appendChild($o);};};CoreJs.Forms.TextArea.prototype=CoreJs.Forms;﻿CoreJs.Forms.TextBox=function(){CoreJs.subscribeEvent(Event.FormSubmit,this);this.onEvent=function($u,$v){switch($u){case Event.FormSubmit:if(that.formId==$v){return that.onSubmit();};break;}};var that=this;var $1l;var $c;var $1m;this.onSubmit=function(){var $0h;var $k=$1m.value;if(this.Required&&!checkString($k)){that.showError("This is a required field");$0h=false;}else{that.hideError();$0h=true;};return $0h;};this.showError=function($l){$1l.style.display="block";$1l.innerHTML=$l;};this.hideError=function(){$1l.style.display="none";};this.$1p=function(p){$c=p;$1m=document.createElement("INPUT");$1m.className=this.ClassName;$1m.type=this.Type;$1m.name=this.Name;$1m.value=this.Value;that.addListener($1m,"onclick",function(){if($1m.value==this.DefaultValue){$1m.value="";}});if(checkString(this.MaxLength)){$1m.maxLength=parseInt(this.MaxLength);};$c.appendChild($1m);if(checkString(this.Message)){var $f=document.createElement("DIV");$f.innerHTML=this.Message;$c.appendChild($f);};var $o=document.createElement("DIV");$1l=$o;$o.className="errorMsg";if(checkString(this.ErrorMessage)){this.showError(this.ErrorMessage);}else{this.hideError();};$c.appendChild($o);};};CoreJs.Forms.TextBox.prototype=CoreJs.Forms;﻿CoreJs.Forms.UrlBox=function(){CoreJs.subscribeEvent(Event.FormSubmit,this);this.onEvent=function($u,$v){switch($u){case Event.FormSubmit:if(that.formId==$v){return that.onSubmit();};break;}};var that=this;var $1l;var $c;var $1m;var $1o;function checkUrl($06){return true;};this.onSubmit=function(){var $0h;var $U=$1m.value;if(!that.Required&&(!$U||$U.length==0)){$0h=true;}else if(!checkUrl($U)){that.debugLine($U);that.showError("The url address is invalid");$0h=false;}else{$0h=true;};if($0h){that.hideError();};return $0h;};this.showError=function($l){$1l.style.display="block";$1l.innerText=$l;};this.hideError=function(){$1l.style.display="none";};this.$1p=function(p){$c=p;$1m=document.createElement("INPUT");$1m.className=this.ClassName;$1m.type="text";$1m.name=this.Name;$1m.value=this.Value;$1m.size=20;if(checkString(this.MaxLength)){$1m.maxLength=parseInt(this.MaxLength);};that.addListener($1m,"onclick",function(){if($1m.value==this.DefaultValue){$1m.value="";}});$c.appendChild($1m);if(checkString(this.Message)){var $f=document.createElement("DIV");$f.innerHTML=this.Message;$c.appendChild($f);};var $o=document.createElement("DIV");$1l=$o;$o.style.color="RED";if(checkString(this.ErrorMessage)){this.showError(this.ErrorMessage);}else{this.hideError();};$c.appendChild($o);};};CoreJs.Forms.UrlBox.prototype=CoreJs.Forms;


