function textCounter() {
	var maxlimit=150;
	if ($("#whatido").val().length > maxlimit) {// if too long...trim it!
		$("#whatido").val($("#whatido").val().substring(0, maxlimit));
	}
	else{
		$("#whatidoleft").text((maxlimit - $("#whatido").val().length) + "");
	}
}

			
function doWhatIDo(){
	var whati=$("#whatido").val();

	if(whati.length>0 && whati.length<=150){
		JsHttpRequest.query(
			'/ajaxlogin2.php', // backend
			{
				'whatido':'1',
				'message':whati,
			},
			function(result, errors) {
				if (result) {
					if(result["q"]=="no_error"){
						$("#whatido").val('');
						$("#whatidoleft").text('150');
						$("#pmess").text(""+result["currentmessage"]);
					}
				}
			},
			false  // do not disable caching
		)
	}
}

