/* JavaScript Document
#########################################################
#														#
#	Project:	Weritech Funcions						#
#	Versie:		1.0										#
#	Filename:	Weritech.Format.js						#
#	copyright:	(c) 2005-2010 Weritech V.O.F.			#
#	Created By:	S. Riewald and N. van der Wegen			#
#	www:		info@weritech.nl						#
#														#			
#########################################################  
*/

Weritech.Format = new Format();

function Format() {	
}

// Start Public Format Functions

Weritech.Format.Float = function (Object) { CheckFormatFloat(Object); };
Weritech.Format.Int = function (Object) { CheckFormatInt(Object); };
Weritech.Format.AlphaNummeric = function (Object) { CheckFormatAlphaNummeric(Object); };

// End Public Format Functions

/////////////////////////////// < ....Private functions form here.... > \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

// Start Private Format Functions

function CheckFormatFloat(Object) {
	Object.value=Object.value.replace(/([^0-9\.])/g,""); 
  	/*var value = new String();
  	var numbers = "0123456789.,";
  	var chars = Object.value.split(""); 
  	for (i = 0; i < chars.length; i++) {
   		if (numbers.indexOf(chars[i]) != -1) {
   			if (chars[i] == ',') {
   				chars[i] = '.';
   			}
      			value += chars[i];
    		}
  	}
  	if (Object.value != value) {
   		Object.value = value; 
  	}
	*/
} 

function CheckFormatInt(Object) {
	Object.value=Object.value.replace(/([^0-9])/g,""); 
	/*var value = new String();
  	var numbers = "0123456789";
  	var chars = Object.value.split(""); 
  	for (i = 0; i < chars.length; i++) {
   		if (numbers.indexOf(chars[i]) != -1) {
      			value += chars[i];
    		}
  	}
	if (Object.value != value) {
   		Object.value = value; 
  	}
	*/
} 

function CheckFormatAlphaNummeric(Object) {
	Object.value=Object.value.replace(/([^0-9a-z\,])/g,""); 
} 



// End Private Format Functions