function Abre(url, width, height)
{
window.open(url,"_blank","resizable=no,toolbar=no,status=yes,menubar=no,scrollbars=no,width=" + width + ",height=" + height)
}
function formRadix_checkForm2(f){
	if(f.txtKeyWord.value == ""){
	alert("Por favor, preencha o campo busca!")
	return false;
	}
	engine=f.engine[f.engine.selectedIndex].value
	if(!engine)alert('Selecione um serviço de busca.')
	if(engine=='FAROLBR'){
		f.action='http://www.farolbr.com/search.asp'
		f.target='_top'
		f.txtKeyWord.name='txtKeyWord'
	}
	if(engine=='Yahoo'){
		f.action='http://br.busca.yahoo.com/search/br'
		f.target='_blank'
		f.txtKeyWord.name='p'
	}
	else if(engine=='Google'){
		f.action='http://www.google.com.br/search'	
		f.target='_blank'
		f.txtKeyWord.name='q'
	}
}
  function ChamaParceiro(url)
  {
    if(url)
    {
     window.top.location = url;
    }
  }

  var browser = navigator.appName
  var isNav, isIE
  if (browser == "Netscape") 
  { 
    isNav = true	
  }
  else 
  { 
    if (browser == "Microsoft Internet Explorer") 
    { 
      isIE = true	
    }
  }
  function combo (dest)
{
	var url_string = document.form1[dest].options[document.form1[dest].selectedIndex].value;
	if (url_string != "Nada")
	{
		if (url_string.substring(0,4) == "java")
		{
			eval(url_string.substring(11,url_string.length));
		} else
		{	
			if (navigator.appName=="Netscape")
				parent.top.location.replace(url_string);
			else 
			{
				if (navigator.appVersion<"3") 
					parent.top.location = url_string;
				else 
					parent.top.location.replace(url_string);
			}
		}
	}
}
function valida_cad() {

     var Form, URL, resposta, s, nada;
     Form = document.cadastro;

     if (Form.cpf.value.length == 0) {
	alert("O CPF é um campo obrigatório !");
        Form.cpf.focus();
        return false;
     }
     if (Form.cpf.value.length == 0) {
	 alert("O CPF é um campo obrigatório !");
        Form.cpf.focus();
        return false;
     }
     
     if (valida_CPF(Form.cpf.value) == false ) {
           alert("O CPF não é válido !");
           Form.cpf.focus();
           return false;
     }
     if (Form.nome.value.length == 0) {
	  alert("O Nome é um campo obrigatório !");
        Form.nome.focus();
        return false;
     }
     if (Form.sobrenome.value.length == 0) {
	alert("O nome de usuário é um campo obrigatório !");
        Form.sobrenome.focus();
        return false;
     }
     if (Form.endereco.value.length == 0) {
	alert("O Endereço é um campo obrigatório !");
        Form.endereco.focus();
        return false;
     }
     if (Form.cidade.value.length == 0) {
	alert("Cidade é um campo obrigatório !");
        Form.cidade.focus();
        return false;
     }
     if (Form.user.value.length == 0) {
	alert("O nome de usuário é um campo obrigatório !");
        Form.user.focus();
        return false;
     }
     if (Form.ddd.value.length == 0) {
	alert("O DDD é um campo obrigatório !");
        Form.ddd.focus();
        return false;
     }
     if (Form.fone.value.length == 0) {
	alert("O número do telefone é um campo obrigatório !");
        Form.fone.focus();
        return false;
     }
   }
   function valida_CPF(s)
   {
	var i;
	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;
  }