var membername="Hello Guest";$(document).ready(function(){$(".contactor").colorbox({iframe:true,innerWidth:600,innerHeight:400});$(".errorrpt").colorbox({iframe:true,innerWidth:600,innerHeight:460});$(".lost-pwd").colorbox({iframe:true,innerWidth:600,innerHeight:260});$(".linker,.editlink").colorbox({iframe:true,innerWidth:600,innerHeight:600,onClosed:function(){doLinks("linkerjs")}});$(".image").colorbox()});String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}; function setJS(){$(".resultGroup").hide();setStars();setToggles();setPanels(1);setPanels(2);setSwings();$("a.ui-slider-handle:first").tinyTips("wonk","<H4>What is this?</H4> This is our NEW Blue/Red Swinger. It&rsquo;s designed to help gauge if a story is more Conservative or Liberal leaning. It not to designed to repalce the stars, which rate the quality of the post. This tool will help give you a 2nd vector on what type of story is behind the link. ");$(".linker,.editlink").colorbox({iframe:true, innerWidth:600,innerHeight:600,onClosed:function(){doLinks("linkerjs")}});$(function(){$(".killbox").click(function(){var b=$(this).attr("id"),a=$(this).attr("title");a="id="+b+"&btid="+a+"&s=0";$(document.getElementById("Datawrap"+b));$.ajax({type:"POST",url:"setstatus.cfm?"+a,data:a,cache:false,success:function(){doLinks()}})})});$(function(){$(".livebox").click(function(){var b=$(this).attr("id"),a=$(this).attr("title");a="id="+b+"&btid="+a+"&s=1";$(document.getElementById("Datawrap"+b));$.ajax({type:"POST", url:"setstatus.cfm?"+a,data:a,cache:false,success:function(){doLinks()}})})});$(function(){$(".livelink").click(function(){var b=$(this).attr("id"),a="id="+b,c=$(document.getElementById("Datawrap"+b));$.ajax({type:"POST",url:"publish_link.cfm",data:a,cache:false,success:function(){$(c).removeClass("pending")}});$(this).css({display:"none"})})});$(function(){$(".story").click(function(){var b=$(this).attr("pid"),a=$(this).attr("url"),c=$(this).attr("media"),d=$(this).attr("title"),e="id="+b,g=$(document.getElementById("clickbox"+ b));switch(c){case "image":$().colorbox({href:a,title:d});break;case "YouTube":if(a.indexOf("http://www.youtube.com/watch?v=")==0)a=a.replace("http://www.youtube.com/watch?v=","http://www.youtube.com/v/");if(a.indexOf("http://youtube.com/watch?v=")==0)a=a.replace("http://youtube.com/watch?v=","http://www.youtube.com/v/");$().colorbox({iframe:true,href:a,innerWidth:425,innerHeight:344,title:d});break;default:window.open(a)}$.ajax({type:"POST",url:"saveclick.cfm",data:e,cache:false,success:function(f){g.html(f)}})})})} function setSwings(){$(".swinger").each(function(){var b="#"+$(this).attr("id"),a=$(this).attr("cnt");$(function(){$(b).slider({value:a,stop:function(c,d){$("#amount").val(d.value);scoreSwinger($(this).attr("id"),d.value,$(this).attr("rated"))}})})})}function scoreSwinger(b,a,c){a="story="+b.replace("swing_","")+"&score="+a+"&isRated="+c;$.ajax({type:"GET",url:"set_swing.cfm",data:a,cache:false,success:function(){$("#"+b).attr("rated","1")}})} function doLinks(){var b=$(document.getElementById("contentcontainer")),a=$.query.get("pg"),c=$.query.get("user");if(a==""||a==null)a=1;if(c==""||c==null||c==true)c="";$.ajax({type:"POST",url:"links_rebuild_ajax.cfm?pg="+a+"&user="+c,cache:false,success:function(d){b.html(d);setJS()}})} function setStars(){var b=$(".form_ocv1");b.children().not(":radio").hide();b.stars({captionEl:$("#hover_ocv1"),callback:function(a,c,d){a=this.title;d="id="+a+"&vote="+d;var e=$(document.getElementById("scorebox"+a)),g=$(document.getElementById("votecntbox"+a));$.ajax({type:"POST",url:"savevote.cfm",data:d,cache:false,success:function(f){e.html(f)}});$.ajax({type:"POST",url:"updatevote.cfm",data:d,cache:false,success:function(f){g.html("html");g.html(f)}})}})} function setToggles(){$(".togglebar").toggle(function(){$(this).addClass("tglactive")},function(){$(this).removeClass("tglactive")});$(".togglebar").click(function(){$(this).next(".resultGroup").slideToggle(450)})} $(function(){$("#login").click(function(){var b=$("#log").val(),a=$("#pwd").val(),c=$("#rememberme").val();b="u="+b+"&p="+a+"&r="+c;var d=$(document.getElementById("memberdata"));$(document.getElementById("namebadge"));$.ajax({type:"POST",url:"login_ajax.cfm",data:b,cache:false,success:function(e){if(e.trim()!="failure"){d.html(e);setPanels(1);setPanels(2);$(".mainmenu ul li.login").removeClass("hidden");$("#loginbox,#regbox").hide("blind",1E3);setrefresh==true?$("#memberbox,#toolbox").show("blind", 1100,function(){doLinks("login")}):$("#memberbox,#toolbox").show("blind",1100)}else alert("Login Failure")}})})}); $(function(){$("#logoutXXXXXXXXXXXXXXXXX").click(function(){var b=$(document.getElementById("memberdata")),a=$(document.getElementById("namebadge"));$.ajax({type:"POST",url:"logout_ajax.cfm",cache:false,success:function(c){b.html(c);a.html("Guest");$(".mainmenu ul li.login").addClass("hidden");$("#loginbox,#regbox").show("blind",1E3);setrefresh==true?$("#memberbox,#toolbox").hide("blind",1200,function(){doLinks("logout")}):$("#memberbox,#toolbox").hide("blind",1200)}})})}); function setPanels(b){var a=b==1?$(document.getElementById("memberbox")):$(document.getElementById("toolbox"));$.ajax({type:"POST",url:"panelview.cfm",data:"box="+b,cache:false,success:function(c){a.html(c)}})}function popup(b){window.open(b,"","menubar=1,scrollbars=1,status=1,location=1,resizable=1,toolbar=1,left=0,top=0");return false};
