/**
 * @author Edu
 */
/* lights element */
function rollover(element) {
  element.className = element.className.replace(/_down/gi,"_up");
}

/* unlights element */
function rollout(element) {
  element.className = element.className.replace(/_up/gi,"_down");
}

/* Votes */
function voteUp(game) {
	$.ajax({  
		    type: "GET",  
		    data: "p=vote_up&jocid="+game,  
		    url:  "index.php",  
		    success: function(msg) {
		     $("#total_votes").html(msg);  
		     //remove the spinner  
		     $("#vote_up_div").html('&nbsp;');  
		     $("#vote_down_div").html('&nbsp;');
		    }
	});
}

function voteDown(game) {
	$.ajax({  
		    type: "GET",  
		    data: "p=vote_down&jocid="+game,  
		    url:  "index.php",  
		    success: function(msg) {  
		     $("#total_votes").html(msg);  
		     //remove the spinner  
		     $("#vote_up_div").html('&nbsp;');  
		     $("#vote_down_div").html('&nbsp;');
		    }
	});
}

/* ADS */
sas_tmstp=Math.round(Math.random()*10000000000);sas_masterflag=1;
function SmartAdServer(sas_pageid,sas_formatid,sas_target) {
if (sas_masterflag==1) {sas_masterflag=0;sas_master='M';} else {sas_master='S';};
document.write('<scr'+'ipt SRC="http://ads.publicidad.net/call/pubj/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?"></scr'+'ipt>');
}