		function length_guard( p_ta ) {
			var max = 250;
			var bg = "#ffffff";
			var fg = "#000000";
			var fw = "normal";
			if( p_ta.value.length > max ) {
				p_ta.value = p_ta.value.substr( 0, max );
			}
			switch ( max - p_ta.value.length ) {
				case 0:
					bg = "#ff0000";
					fg = "#ffffff";
					fw = "bold";
					break;
				case 1:
				case 2:
					bg = "#ff7f00";
					fg = "#ffffff";
					fw = "bold";
					break;
				case 3:
				case 4:
					bg = "#ffaf7f";
					break;
				case 5:
				case 6:
					bg = "#ffffaf";
					break;
			}
			p_ta.form.charCounterSMS.style.backgroundColor = bg;
			p_ta.form.charCounterSMS.style.color = fg;
			p_ta.form.charCounterSMS.style.fontWeight = fw;
			p_ta.form.charCounterSMS.value = p_ta.value.length
			
		}
