	

$(function(){  

$("a.vote_up").click(function(){  

 the_id = $(this).attr('id');  

 $(this).parent().html("<span id='vote_buttons'><img src='images/spinner.gif' style='margin-left:17px; border:0px; text-align:center; width:20px;' /></span>");  

 $("span#votes_count"+the_id).fadeOut("fast");  

  $.ajax({  

   type: "POST",  

   data: "action=vote_up&id="+$(this).attr("id"),  

   url: "votes.php",  

   success: function(msg)  

   {  

    $("span#votes_count"+the_id).html(msg);  

    $("span#votes_count"+the_id).fadeIn();  

    $("span#vote_buttons"+the_id).remove();  

   }  

  });  

 });  

});  



	

function clicklink(linkid)

{  

	var the_id=linkid;

  $.ajax({  

   type: "POST",  

   data: "id="+linkid,  

   url: "link_click.php",  

   success: function(msg)  

   {  

    }  

  });  



};  

function clickblog(linkid,page)

{  
    var the_id=linkid;
    $.ajax({
    type: "POST",
    data: "id="+linkid+"&page="+page,
    url: "blog_click.php",
    success: function(msg)
        {
        }
  });  
};  	

function clickonblog(blogid,page)

{
    var the_id=blogid;
    $.ajax({
    type: "POST",
    data: "id="+blogid+"&page="+page,
    url: "blog_click2.php",
    success: function(msg)
        {
        }
  });
};




function followblog(blogid,ident)

{  

 $("span#followblog").html("<div style='display:block; border:1px solid #000; margin-top:5px; border:0px; text-align:center; width:20px;'><img src='images/spinner.gif' /></div>");  

  $.ajax({  

   type: "POST",  

   data: "id="+blogid+"&ident="+ident, 

   url: "follow_blog.php",  

   success: function(msg)  

   {  

       $("span#followblog").html(msg);  



    }  

  });  



};  

function unfollowblog(blogid,ident) {  
 $("span#followblog").html("<div style='display:block; border:1px solid #000; margin-top:5px; border:0px; text-align:center; width:20px;'><img src='images/spinner.gif' /></div>");  
  $.ajax({  
   type: "POST",  
   data: "id="+blogid+"&ident="+ident, 
   url: "unfollow_blog.php",  
   success: function(msg)  
   {  
       $("span#followblog").html(msg);  
    }  
  });  
};  



function openLiveStats(blogid){
  if (xx){
    OW = window.open("","popLiveStats","fullscreen,"+dims)     
    OW.blur()
    window.focus()       
    OW.resizeTo(windowWidth,windowHeight)
    OW.moveTo(windowX,windowY)
    OW.document.open();
    OW.document.close()
  } else {
    OW=window.open("http://myscoop.co.za/livestats/"+blogid,"popLiveStats","scrollbars,"+dims)
    OW.blur()
    window.focus() 
    OW.resizeTo(windowWidth,windowHeight)
    OW.moveTo(windowX,windowY)
  }   
  OW.focus()   
}

function popupLiveStats(blogid) {
var windowX = (screen.width/2)-(windowWidth/2);
var windowY = (screen.height/2)-(windowHeight/2);
url = 'http://myscoop.co.za/livestats/'+blogid
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=550,height=250,screenX=150,screenY=150,top=150,left=150')
}
/*
function openLiveStats(blogid){
 OW=window.open('http://myscoop.co.za/livestats/'+blogid,'Live Blog Stats');
 OW.focus()
}
*/