function c_Mascara()
{
	this.Mascara = function(o,f)
	{
		this.setFun(f);
		this.setObj(o);		
		setTimeout("classMascara.exe()",1);
	}
	
	this.exe = function()
	{
		switch (this.getFun())
		{
			case "Telefone" : 	obj = this.getObj();
								obj.value = this.Telefone(this.getObj());
								break;
		}
	}
	
	this.Telefone = function(o)
	{
		valor = o.value;
		valor=valor.replace(/\D/g,"")
		valor=valor.replace(/^(\d\d)(\d)/g,"($1) $2")
		valor=valor.replace(/(\d{4})(\d)/,"$1-$2")
		return valor;
	}
	
	this.getObj = function(){return ob;}
	this.setObj = function(o){ob = o;}
	this.getFun = function(){return fun;}
	this.setFun = function(f){fun = f;}
}
classMascara = new c_Mascara();
