/**  Method to limit the number of characters written in text area of the backend pages.
			Usage:
			U have to call this method in ur pages where there is text area in the following way:
			
			onkeydown="javascript:textAreaCharacterCounter(this,no of characters,charLength_omit_clear_field)"
			onkeyup="javascript:textAreaCharacterCounter(this,no of characters,charLength_omit_clear_field)"
			
			U have to use the following code to get the text box beside the textarea which specifies the number of
			allowed characters in the textarea.<b>
			 
				<f:verbatim>
					<input readonly type="text" name="remLen2_"
						id="charLength_omit_clear_field" size="3" maxlength="3" value="5">
					characters left
				</f:verbatim>
								
			U also have to include this property.js file in ur pages using the following syntax
			<script src="../js/property.js" type="text/javascript"></script>
		*/		
		
		function textAreaCharacterCounter(element,length,charLength_omit_clear_field){
			
			if(element != null){
				if(element.value.length > length)
				
				element.value = element.value.substring(0,length);
				else
				charLength_omit_clear_field.value = length - element.value.length;
			}
			
		}			
		/**
			Method to open a new page named localityLocator.jsp
		
		*/
function charCount(){
var elems =  document.forms[0].elements;
 var mes = document.getElementById("message");
 var nos;
 var id;
 var aa;

for( var i=0; i<elems.length; i++) 
    		  {
			var id = elems[i].id;	
			if(id.indexOf('_msg')>=0)
			  {
    		var nos =elems[i]
			  }
			if(id.indexOf('_field1')>=0)
			var len = elems[i];
			var ids = id
				  }
			  textAreaCharacterCounters(nos,50,len)
}

function textAreaCharacterCounters(element,length,charLength_omit_clear_field){
			 
				charLength_omit_clear_field.value = length - element.value.length;
			
			
			}
