/*
######################## anthrazit online ag ########################
### |-----------------------------------------------------------| ###
### |      Project Name: PocketGuide                            | ###
### |      Version: 2.5                                         | ###
### |      Author: Lukas Stalder, bitsolution                   | ###
### |      (c) anthrazit online ag                              | ###
### |      -----------------------------------------------      | ###
### |      Changing other code may result in errors and not     | ### 
### |      properly working of this application, so be aware!   | ### 
### |                                                           | ### 
### |      07/08/2007, Lukas Stalder, info@bitsolution.ch       | ### 
### |-----------------------------------------------------------| ###
#####################################################################
*/

// JAVASCRIPT Lib



function getElement(id){
	var obj;
	if (document.getElementById){
		obj = document.getElementById(id);	
	}else if (document.all){
		obj = document.all.id;	
	}
	return obj;
}


function countChars(obj, displayid){
	var mlength = obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : "";
	if (obj.getAttribute && obj.value.length > mlength){
		obj.value = obj.value.substring(0, mlength);
	}
	if (displayid){
		var disp = getElement(displayid);
		disp.innerHTML = (mlength - obj.value.length);
	}
}

