
/*-----------------------------------------------
	CuteEditor_OnChange(editor)
	
	overrides OnChange event in Cute Editor class
	used to count characters in a WYSIWYG
	
	This div needs to exist somewhere in the page
	<span id="<% response.Write IDofWYSIWYGEditor & "_limit" %>" title="CHAR-LIMIT">0</span>  -BL 08/29/07
-----------------------------------------------*/

function CuteEditor_OnInitialized(editor)
{
	CuteEditor_OnChange(editor);
}


function CuteEditor_OnChange(editor)
{ 
	// verify
	if (document.getElementById(editor.id + '_limit')) {

		// verify
		if(window.char_count){
		
			// declare var
		   	var activewysiwyg = document.getElementById(editor.id);
			//Set limit to the title tag of target div (verify integer)
   			var limit = document.getElementById(editor.id + '_limit').title.replace(/\D/g,'');
			//count chars & write to target div
			char_count(activewysiwyg,editor.id + '_limit',limit);
		}
	}
}

