function addTWSS(){
	$("#btnAddTWSS").attr("disabled", "disabled");
	var url = "/index.php?c=2&ajax=true";
	var get = {twss: escape($("#txtTWSS").val()),context: escape($("#txtTWSSContext").val()),wsi: $("#selWhoSaid :selected").val(), recaptcha_response_field: escape($("#recaptcha_response_field").val()) ,recaptcha_challenge_field: escape($("#recaptcha_challenge_field").val())};
	
	$("#addTWSSThrobber").show("slow",function(){
		$("addTWSSThrobber").fadeIn("slow");
	});
	$.get(url,get,function(data){
						
		$("#addTWSSResponse").hide();
		
		$("#addTWSSThrobber").fadeOut("slow",function(){
			$("#addTWSSResponse").show("slow",function(){
				$("#addTWSSResponse").fadeIn();
				$("#addTWSSThrobber").hide("slow");
				var resp = "<strong>Status: </strong>"+data;
				$("#ui_notification").html(resp);
				$("#notification").fadeIn();
				$("#btnAddTWSS").removeAttr("disabled");
			});	
		});
	});
	
	return true;
}


function rateTWSS(story,score){
	$("#notification").fadeOut('slow');
	var i=0;
	for(i=1;i<=5;i++){
		$("#"+story+"_"+i).attr("onmouseover","");
		$("#"+story+"_"+i).attr("onmouseout","");
		$("#"+story+"_"+i).attr("onclick","");
	}
	for(i=1;i<=score;i++){
		$("#"+story+"_"+i).attr("src","/images/star_blue.png");
	}
	
	var url = "/?c=1&ajax=true&task=rateTWSS&story="+story+"&score="+score;
	$.get(url,function(data){
		var resp = "<strong>Status: </strong>"+data;
		$("#ui_notification").html(resp);
		$("#notification").fadeIn('slow');	
	});
}
function changeRateTWSS(story,score){
	var i=0;
	for(i=1;i<=5;i++){
		$("#"+story+"_"+i).attr("src","/images/star_blank.png");
	}
	for(i=1;i<=score;i++){
		$("#"+story+"_"+i).attr("src","/images/star_yellow.png");
	}
}
function undoChangeRateTWSS(story,score){
	var old_score = $("#rating_"+story).val();
	var i=0;
	for(i=1;i<=5;i++){
		$("#"+story+"_"+i).attr("src","/images/star_blank.png");
	}
	for(i=1;i<=old_score;i++){
		$("#"+story+"_"+i).attr("src","/images/star_blue.png");
	}
}