
Util = function()
{

	/**  
	 * Method  getClassName 
	 * @param  void
	 * @return String className
	 * @desc: 
	 */	
	this.getClassName = function()
	{
		return "Util";
	}	
	
	/**  
	 * M?todo  url_encode 
	 * @param  String str
	 * @return String strEncode
	 * @desc: url_encode version 1.0 
	 */	
	this.url_encode = function(str) 
	{ 
	    var hex_chars = "0123456789ABCDEF"; 
	    var noEncode = /^([a-zA-Z0-9\_\-\.])$/; 
	    var n, strCode, hex1, hex2, strEncode = ""; 
	
	    for(n = 0; n < str.length; n++) { 
	        if (noEncode.test(str.charAt(n))) { 
	            strEncode += str.charAt(n); 
	        } else { 
	            strCode = str.charCodeAt(n); 
	            hex1 = hex_chars.charAt(Math.floor(strCode / 16)); 
	            hex2 = hex_chars.charAt(strCode % 16); 
	            strEncode += "%" + (hex1 + hex2); 
	        } 
	    } 
	    return strEncode; 
	} 
	
	/**  
	 * M?todo  url_decode 
	 * @param  string str
	 * @return string strDecode
	 * @desc:  url_decode version 1.0   
	 */	
	this.url_decode = function(str) 
	{ 
	    var n, strCode, strDecode = ""; 
	
		for (n = 0; n < str.length; n++) { 
			if (str.charAt(n) == "%") { 
				strCode = str.charAt(n + 1) + str.charAt(n + 2); 
				strDecode += String.fromCharCode(parseInt(strCode, 16)); 
				n += 2; 
			} 
			else { 
				strDecode += str.charAt(n); 
			} 
		} 
	
		return strDecode;
	} 
	
	/**  
	 * M?todo  converteDataBA
	 * @param  data
	 * @return new_date
	 * @desc:   
	 */	
	this.converteDataBA = function(data)
	{
		var new_date = data.split("/");
		
		return new_date[2] + "-" + new_date[1] + "-" + new_date[0];
	}
	
	/**  
	 * M?todo  converteDataAB 
	 * @param  data
	 * @return new_date
	 * @desc:   
	 */	
	this.converteDataAB = function(data)
	{
		var new_date = data.split("-");
		
		return new_date[2] + "/" + new_date[1] + "/" + new_date[0];
	}
	
	
	/**  
	 * M?todo  changeForm 
	 * @param  void
	 * @return string
	 * @desc:   
	 *
	this.changeForm = function(obj, newClass) 
	{
		if (document.getElementById) 
			obj.className = newClass;
	}
	
	*/

};