206
| <![CDATA[<script language="javascript" type="text/javascript">
function Verifica(f){
f.submit();
return true;
}
function mascara(o,f)
{
v_obj = o;
v_fun = f;
setTimeout("execmascara()",1);
}
function execmascara()
{
//v_obj.value=protoSPI(v_obj.value);
v_obj.value=window[v_fun](v_obj.value);
}
function processo(v)
{
v=v.replace(/\D/g,"");
if (v.length==14)
v= protoPROA(v);
else v= protoSPI(v);
return v;
}
function protoSPI(v)
{
v=v.replace(/\D/g,"");
v=v.replace(/^(\d{6})(\d)/,"$1-$2");
v=v.replace(/\-(\d{2})(\d)/,"-$1.$2");
v=v.replace(/\.(\d{2})(\d)/,".$1/$2");
v=v.replace(/\/(\d{2})(\d)/,"/$1-$2");
return v;
}
function protoPROA(v)
{
v=v.replace(/\D/g,"");
v=v.replace(/^(\d{2})(\d)/,"$1/$2");
v=v.replace(/\/(\d{4})(\d)/,"/$1-$2");
v=v.replace(/\-(\d{7})(\d)/,"-$1-$2");
return v;
}
</script>]]>
|