var wordcounter = 0;

function showResult(str){
	
	wordcounter = str.length;
    wordcounter = 140 - wordcounter;
	
	//check if we are over 140
	if(wordcounter < 0){
	document.getElementById("TextCounter").style.color="#ec1a23";
	}else{
	document.getElementById("TextCounter").style.color="";		
	}
		
	//update the counter
	document.getElementById("TextCounter").innerHTML=wordcounter;


}

