function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function abrirs(URL, width, height) {
	window.open(URL,'Galeria', 'width='+width+', height='+height+', scrollbars=yes, status=yes, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function MM_findObj(n, d) { //v4.0
	var p,i,x;	if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
	var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
		if (val) { nm=val.id; if ((val=val.value)!="") {
			if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
				if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve conter um endereço de e-mail.\n';
			} else if (test!='R') {
				if (isNaN(val)) errors+='- '+nm+' deve conter caracteres numéricos.\n';
				if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
					min=test.substring(8,p); max=test.substring(p+1);
					if (val<min || max<val) errors+='- '+nm+' deve conter números entre '+min+' e '+max+'.\n';
		} } } else if (test.charAt(0) == 'R') errors += '- Por favor, digite '+nm+'.\n'; }
	} if (errors) alert('Verifique:\n'+errors);
	document.MM_returnValue = (errors == '');
}

function MM_validateFormP1() { //v4.0
	var i,p,q,nm,test,num,min,max,errors='',args=MM_validateFormP1.arguments;
	for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
		if (val) { nm=val.id; if ((val=val.value)!="") {
			if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
				if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve conter um endereço de e-mail.\n';
			} else if (test!='R') {
				if (isNaN(val)) errors+='- '+nm+' deve conter caracteres numéricos.\n';
				if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
					min=test.substring(8,p); max=test.substring(p+1);
					if (val<min || max<val) errors+='- '+nm+' deve conter números entre '+min+' e '+max+'.\n';
		} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' deve conter dados.\n'; }
	}

	if(document.forms["cadastro"].hotresponsavelsenha.value != document.forms["cadastro"].hotresponsavelsenha1.value){
		errors += '- Senha diferente da confirmação de senha. Digite novamente!';
	}
	if (errors) alert('Verifique:\n'+errors);
	document.MM_returnValue = (errors == '');
}


function valida(){ 
  
var i; 
  
s = document.cadastro.clicpf.value; 
  
var c = s.substr(0,9); 
  
var dv = s.substr(9,2); 
  
var d1 = 0; 
  
for (i = 0; i < 9; i++) 
  
{ 
  
d1 += c.charAt(i)*(10-i); 
  
} 
  
if (d1 == 0){ 
  
alert(" Invalido") 
document.cadastro.clicpf.focus();  
  
return false; 
  
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(0) != d1) 
  
{ 
  
alert(" Invalido") 
document.cadastro.clicpf.focus();  
  
return false; 
  
} 
  
  
d1 *= 2; 
  
for (i = 0; i < 9; i++) 
  
{ 
  
d1 += c.charAt(i)*(11-i); 
  
} 
  
d1 = 11 - (d1 % 11); 
  
if (d1 > 9) d1 = 0; 
  
if (dv.charAt(1) != d1) 
  
{ 
  
alert(" Invalido") 
document.cadastro.clicpf.focus();  
return false; 
  
} 
  
return true; 
  
} 


//*******************************************************************************************

//************************************************************************************
//***************************** CPFS DOS SÓCIOS **************************************
//************************************************************************************
function validacpfresponsavel() {
// inicio de verificacao de cnpj ou cpf
	if (document.cadastro.hotresponsavelcpf.value.length > 0) {
		var invalid, s;
		invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;

		var s;
		
		s = limpa_string(document.cadastro.hotresponsavelcpf.value);
	
		// checa se é cpf	
		if (s.length == 11) {
			if (valida_CPF(document.cadastro.hotresponsavelcpf.value) == false ) {
				alert("O CPF não é válido !");
				document.cadastro.hotresponsavelcpf.focus();
				return false;
			}
	    }else {
			alert("O CPF não é válido !");
			document.cadastro.hotresponsavelcpf.focus();
			return false;
		}

		

		//return true;
	}
	// fim da funcao validar()

	function limpa_string(S){
		// Deixa so' os digitos no numero
		var Digitos = "0123456789";
		var temp = "";
		var digito = "";

		for (var i=0; i<S.length; i++)	{
			digito = S.charAt(i);
			if (Digitos.indexOf(digito)>=0)	{
				temp=temp+digito
			}
		} //for


		return temp
	}
}

function validacpf() {
// inicio de verificacao de cnpj ou cpf
	if (document.cadastro.hotcnpj.value.length > 0) {
		var invalid, s;
		invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;

		var s;
		
		s = limpa_string(document.cadastro.hotcnpj.value);
	
		// checa se é cpf	
		if (s.length == 14) {
			if (valida_CGC(document.cadastro.hotcnpj.value) == false ) {
				alert("O CNPJ não é válido !");
				document.cadastro.hotcnpj.focus();
				return false;
			}
		}else {
			alert("O CNPJ não é válido !");
			document.cadastro.hotcnpj.focus();
			return false;
		}

		

		//return true;
	}
	// fim da funcao validar()

	function limpa_string(S){
		// Deixa so' os digitos no numero
		var Digitos = "0123456789";
		var temp = "";
		var digito = "";

		for (var i=0; i<S.length; i++)	{
			digito = S.charAt(i);
			if (Digitos.indexOf(digito)>=0)	{
				temp=temp+digito
			}
		} //for


		return temp
	}
}


function valida_CPF(s)	{
	var i;
	//s = limpa_string(s);
	var c = s.substr(0,9);
	var dv = s.substr(9,2);
	var d1 = 0;
	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(10-i);
	}
        if (d1 == 0) return false;
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(0) != d1)
	{
		return false;
	}

	d1 *= 2;
	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(11-i);
	}
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(1) != d1)
	{
		return false;
	}
        return true;
}

function valida_CGC(s)
{
	var i;
	//s = limpa_string(s);
	var c = s.substr(0,12);
	var dv = s.substr(12,2);
	var d1 = 0;
	for (i = 0; i < 12; i++)
	{
		d1 += c.charAt(11-i)*(2+(i % 8));
	}
        if (d1 == 0) return false;
        d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(0) != d1)
	{
		return false;
	}

	d1 *= 2;
	for (i = 0; i < 12; i++)
	{
		d1 += c.charAt(11-i)*(2+((i+1) % 8));
	}
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(1) != d1)
	{
		return false;
	}
	return true;
}
// fim da funcao

//************************************************************************************
//***************************** CPFS LOGIN      **************************************
//************************************************************************************
function validacpflogin() {
// inicio de verificacao de cnpj ou cpf
	if (document.login.hotcnpj.value.length > 0) {
		var invalid, s;
		invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;

		var s;
		
		s = limpa_string(document.login.hotcnpj.value);
	
		// checa se é cpf	
		if (s.length == 14) {
			if (valida_CGC(document.login.hotcnpj.value) == false ) {
				alert("O CNPJ não é válido !");
				document.login.hotcnpj.focus();
				return false;
			}
		}else {
			alert("O CNPJ não é válido !");
			document.login.hotcnpj.focus();
			return false;
		}

		

		//return true;
	}
	// fim da funcao validar()

	function limpa_string(S){
		// Deixa so' os digitos no numero
		var Digitos = "0123456789";
		var temp = "";
		var digito = "";

		for (var i=0; i<S.length; i++)	{
			digito = S.charAt(i);
			if (Digitos.indexOf(digito)>=0)	{
				temp=temp+digito
			}
		} //for


		return temp
	}
}

function valida_CPF(s)	{
	var i;
	//s = limpa_string(s);
	var c = s.substr(0,9);
	var dv = s.substr(9,2);
	var d1 = 0;
	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(10-i);
	}
        if (d1 == 0) return false;
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(0) != d1)
	{
		return false;
	}

	d1 *= 2;
	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(11-i);
	}
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(1) != d1)
	{
		return false;
	}
        return true;
}

function valida_CGC(s)
{
	var i;
	//s = limpa_string(s);
	var c = s.substr(0,12);
	var dv = s.substr(12,2);
	var d1 = 0;
	for (i = 0; i < 12; i++)
	{
		d1 += c.charAt(11-i)*(2+(i % 8));
	}
        if (d1 == 0) return false;
        d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(0) != d1)
	{
		return false;
	}

	d1 *= 2;
	for (i = 0; i < 12; i++)
	{
		d1 += c.charAt(11-i)*(2+((i+1) % 8));
	}
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(1) != d1)
	{
		return false;
	}
	return true;
}
// fim da funcao

function SoLetra (keypress){
	if((keypress > 48) && (keypress < 57)){
		window.event.keyCode=0;
		window.event.returnValue=false;
	}
}
function SoNumero (keypress){
	if(keypress < 48){
		window.event.keyCode=0;
		window.event.returnValue=false;
	}
	if(keypress > 57){
		window.event.keyCode=0;
		window.event.returnValue=false;
	}
}
function Mascara (formato, keypress, objeto){
	if(keypress < 48){
		window.event.keyCode=0;
		window.event.returnValue=false;
	}
	if(keypress > 57){
		window.event.keyCode=0;
		window.event.returnValue=false;
	}
	campo = eval (objeto);
		
	
		// cep
		if (formato=='cep'){
		separador = '-';
		conjunto1 = 5;
		if (campo.value.length == conjunto1){
		campo.value = campo.value + separador;}
		}
		
		// cpf
		if (formato=='cpf'){
		separador1 = '.'; 
		separador2 = '-'; 
		conjunto1 = 3;
		conjunto2 = 7;
		conjunto3 = 11;
		if (campo.value.length == conjunto1)
		  {
		  campo.value = campo.value + separador1;
		  }
		if (campo.value.length == conjunto2)
		  {
		  campo.value = campo.value + separador1;
		  }
		if (campo.value.length == conjunto3)
		  {
		  campo.value = campo.value + separador2;
		  }
		}
		
		// cnpj
		if (formato=='cnpj'){
		separador1 = '.'; 
		separador2 = '/'; 
		separador3 = '-'; 
		conjunto1 = 2;
		conjunto2 = 6;
		conjunto3 = 10;
		conjunto4 = 15;
		if (campo.value.length == conjunto1)
		  {
		  campo.value = campo.value + separador1;
		  }
		if (campo.value.length == conjunto2)
		  {
		  campo.value = campo.value + separador1;
		  }
		if (campo.value.length == conjunto3)
		  {
		  campo.value = campo.value + separador2;
		  }
		if (campo.value.length == conjunto4)
		  {
		  campo.value = campo.value + separador3;
		  }
		}
		
		// nascimento
		if (formato=='nascimento'){
		separador = '/'; 
		conjunto1 = 2;
		conjunto2 = 5;
		if (campo.value.length == conjunto1)
		  {
		  campo.value = campo.value + separador;
		  }
		if (campo.value.length == conjunto2)
		  {
		  campo.value = campo.value + separador;
		  }
		}
		
		// telefone
		if (formato=='telefone'){
		separador1 = '(';
		separador2 = ')';
		separador3 = '-';
		conjunto1 = 0;
		conjunto2 = 3;
		conjunto3 = 8;
		if (campo.value.length == conjunto1){
		campo.value = campo.value + separador1;
		}
		if (campo.value.length == conjunto2){
		campo.value = campo.value + separador2;
		}
		if (campo.value.length == conjunto3){
		campo.value = campo.value + separador3;
		}
		}
}
function moeda(cur,len)
{
   n='__0123456789';
   d=cur.value;
   l=d.length;
   r='';
   if (l > 0)
   {
	z=d.substr(0,l-1);
	s='';
	a=2;
	for (i=0; i < l; i++)
	{
		c=d.charAt(i);
		if (n.indexOf(c) > a)
		{
			a=1;
			s+=c;
		};
	};
	l=s.length;
	t=len-1;
	if (l > t)
	{
		l=t;
		s=s.substr(0,t);
	};
	if (l > 2)
	{
		r=s.substr(0,l-2)+','+s.substr(l-2,2);
	}
	else
	{
		if (l == 2)
		{
			r='0,'+s;
		}
		else
		{
			if (l == 1)
			{
				r='0,0'+s;
			};
		};
	};
	if (r == '')
	{
		r='0,00';
	}
	else
	{
		l=r.length;
		if (l > 6)
		{
			j=l%3;
			w=r.substr(0,j);
			wa=r.substr(j,l-j-6);
			wb=r.substr(l-6,6);
			if (j > 0)
			{
				w+='.';
			};
			k=(l-j)/3-2;
			for (i=0; i < k; i++)
			{
				w+=wa.substr(i*3,3)+'.';
			};
			r=w+wb;
		};
	};
   };
   if (r.length <= len)
   {
	cur.value=r;
   }
   else
   {
	cur.value=z;
   };
   return 'ok';
};

//Desabilitar botão direito
/**/
//Evita usar el boton derecho del ratón
document.oncontextmenu = function(){return false}
//No permite seleccionar el contenido de una página 
<!-- Begin
function disableselect(e){
 return true
}
function reEnable(){
 return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
 document.onmousedown=disableselect
 document.onclick=reEnable
}