/* remove text from field*/
function removeText(formField, theText) {
	if ( document.getElementById(formField).value == theText ) {
		document.getElementById(formField).value = "";
	}
}

/* replace text from field*/
function replaceText(formField, theText) {
	if ( document.getElementById(formField).value == "" ) {
		document.getElementById(formField).value = theText;
	}
}

$(document).ready(function(){

	var oo = 1;
	
	$('#network_dropdown span').addClass('down');
	$('#network_dropdown span').click(function() {
		if ( oo == 1 ) {
			$('#network_dropdown span').removeClass('down').addClass('up');
			oo = 2;
		} else {
			$('#network_dropdown span').removeClass('up').addClass('down');
			oo = 1;
		}
		$('#network_dropdown ul').slideToggle('fast');
	});
	
});

function do_rating(ent, score, root) {
 $.ajax({
   type: "POST",
   url: root+"entry_rate.php",
   data: "ent="+ent+"&rating="+score,
   success: function(msg){
     //alert( "Data Saved: " + msg );
     var info=msg.split("|");
     //$('#rate_'+tut+' .g_current').empty();
     //$('#rate_'+tut+' .g_current').append(info[1]);
     //$('#rate_'+tut+' .current').css("width", info[0]+"px");
     $('#rate_'+ent+' .star-rating').empty();
     $('#rate_'+ent+' .star-rating').html('<li class="current-rating current" style="width: '+info[0]+'px;" title="Currently '+info[1]+' out of 5">Currently <span class="g_current">'+info[1]+'</span> out of 5</li>');
     $('#rate_'+ent+' li.last').html("<span style=\"color: #DD9B0E;\">Vote Cast!</span>");
     $('#rate_'+ent+' li.last span').fadeTo(2000, 0.50);
   }
 });
 //alert($(this).text());
 return false;
};
