function get_flash(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento,transparente,pgphp) {

	obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'">';

	obj+= '<param name="allowScriptAccess" value="sameDomain" />';

	obj+= '<param name="movie" value="'+arquivo+'" />';

	obj+= '<param name="quality" value="'+qualidade+'" />';

	if(transparente == true) {

		obj+= '<param name="wmode" value="transparent" />';

	}

	obj+= '<param name="bgcolor" value="'+bgcolor+'" />';

	obj+= '<param name="FlashVars" value="pg='+pgphp+'" />';

	obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" quality="'+qualidade+'" bgcolor="'+bgcolor+'" FlashVars="pg='+pgphp+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';

	obj+= '</object>';

	document.write(obj);

}

function checaCadastro() {

	if (document.frmCadastro.nm_pssoa.value == "" && document.frmCadastro.nm_pssoa_juri.value == ""){

		alert("Preencha o campo Nome completo ou Nome da empresa!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_cpf.value == "" && document.frmCadastro.ds_pssoa_cnpj.value == ""){

		alert("Preencha o campo CPF ou CNPJ");

		return false;

	}

	if (document.frmCadastro.dt_pssoa_nasci.value == "" && document.frmCadastro.id_pssoa.value == 1){

		alert("Preencha o campo Data de Nascimento!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_email.value == ""){

		alert("Preencha o campo E-mail!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_tel.value == ""){

		alert("Preencha o campo Telefone!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_ender.value == ""){

		alert("Preencha o campo Endereço!");

		return false;

	}

	if (document.frmCadastro.cd_local.value == ""){

		alert("Preencha o campo Bairro!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_cidad.value == ""){

		alert("Preencha o campo Cidade!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_refer.value == ""){

		alert("Preencha o campo Ponto de Refência!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_login.value == ""){

		alert("Preencha o campo LOGIN!");

		return false;

	}

	if (document.frmCadastro.ds_pssoa_senha.value == ""){

		alert("Preencha o campo SENHA!");

		return false;

	}

	if (document.frmCadastro.ds_contato.value == "" && document.frmCadastro.ds_pssoa_cnpj.value != ""){

		alert("Preencha o campo Nome do Contato!");

		return false;

	}

	if (document.frmCadastro.ds_contato_email.value == "" && document.frmCadastro.ds_pssoa_cnpj.value != ""){

		alert("Preencha o campo E-mail do Contato!");

		return false;

	}

	if (document.frmCadastro.ds_contato_tel.value == "" && document.frmCadastro.ds_pssoa_cnpj.value != ""){

		alert("Preencha o campo Telefone do Contato!");

		return false;

	}



	javascript:window.document.frmCadastro.submit();

}

function checaContato() {

	if (document.frmContato.nome.value == ""){

		alert("Preencha o campo Nome!");

		return false;

	}

	if (document.frmContato.email.value == ""){

		alert("Preencha o campo E-mail!");

		return false;

	}

	if (document.frmContato.tel.value == ""){

		alert("Preencha o campo Telefone!");

		return false;

	}

	if (document.frmContato.assunto.value == ""){

		alert("Preencha o campo Assunto!");

		return false;

	}

	if (document.frmContato.mensagem.value == ""){

		alert("Preencha o campo Mensagem!");

		return false;

	}

	window.document.frmContato.submit();

}



function pessoa(id){

	if(id == 'juridica'){

		window.document.getElementById('nome').style.display = 'none';	

		window.document.getElementById('razao').style.display = '';	

		window.document.getElementById('cpf').style.display = 'none';

		window.document.getElementById('cnpj').style.display = '';

		window.document.getElementById('data_nascimento').style.display = 'none';

		window.document.getElementById('contato').style.display = '';

		

		window.document.frmCadastro.id_pssoa.value = '2';

	}

	if(id == 'fisica'){

		window.document.getElementById('nome').style.display = '';	

		window.document.getElementById('razao').style.display = 'none';	

		window.document.getElementById('cpf').style.display = '';

		window.document.getElementById('cnpj').style.display = 'none';

		window.document.getElementById('data_nascimento').style.display = '';

		window.document.getElementById('contato').style.display = 'none';

		

		window.document.frmCadastro.id_pssoa.value = '1';

	}

}

function enfocus(id)

{

	if(id == 'ds_pssoa_tel'){

	   var tel = document.frmCadastro.ds_pssoa_tel.value;

	   document.frmCadastro.ds_pssoa_login.value = tel.substring(1,3)+tel.substring(5,9)+tel.substring(10,14)

	   setTimeout("enblur('ds_pssoa_tel')", 1000)

	}

	if(id == 'ds_pssoa_cep'){

	   document.frmCadastro.ds_entre_cep.value = document.frmCadastro.ds_pssoa_cep.value

	   setTimeout("enblur('ds_pssoa_cep')", 1000)

	}

	if(id == 'ds_pssoa_ender'){

	   document.frmCadastro.ds_entre_ender.value = document.frmCadastro.ds_pssoa_ender.value

	   setTimeout("enblur('ds_pssoa_ender')", 1000)

	}

	if(id == 'ds_pssoa_bairr'){

	   document.frmCadastro.ds_entre_bairr.value = document.frmCadastro.ds_pssoa_bairr.value

	   setTimeout("enblur('ds_pssoa_bairr')", 1000)

	}

	if(id == 'ds_pssoa_cidad'){

	   document.frmCadastro.ds_entre_cidad.value = document.frmCadastro.ds_pssoa_cidad.value

	   setTimeout("enblur('ds_pssoa_cidad')", 1000)

	}

	if(id == 'ds_pssoa_compl'){

	   document.frmCadastro.ds_entre_compl.value = document.frmCadastro.ds_pssoa_compl.value

	   setTimeout("enblur('ds_pssoa_compl')", 1000)

	}

	if(id == 'ds_pssoa_refer'){

	   document.frmCadastro.ds_entre_refer.value = document.frmCadastro.ds_pssoa_refer.value

	   setTimeout("enblur('ds_pssoa_refer')", 1000)

	}

}

function enblur(id){

	if(id == 'ds_pssoa_tel'){

	   setTimeout("enfocus('ds_pssoa_tel')", 5)

	}

	if(id == 'ds_pssoa_cep'){

	   setTimeout("enfocus('ds_pssoa_cep')", 5)

	}

	if(id == 'ds_pssoa_ender'){

	   setTimeout("enfocus('ds_pssoa_ender')", 5)

	}

	if(id == 'ds_pssoa_bairr'){

	   setTimeout("enfocus('ds_pssoa_bairr')", 5)

	}

	if(id == 'ds_pssoa_cidad'){

	   setTimeout("enfocus('ds_pssoa_cidad')", 5)

	}

	if(id == 'ds_pssoa_compl'){

	   setTimeout("enfocus('ds_pssoa_compl')", 5)

	}

	if(id == 'ds_pssoa_refer'){

	   setTimeout("enfocus('ds_pssoa_refer')", 5)

	}

}

function popup(Url, Titulo, Width, Height, Scroll, Status) {

	

	if(Width == "")

		Width = screen.availWidth;

	if(Height == "")

		Height = screen.availHeight;		

		





    window.open(Url, Titulo, 'width='+Width+', height='+Height+', scrollbars='+Scroll+', status=no, top='+((screen.availHeight/2)-(Height/2))+', left='+((screen.availWidth/2)-(Width/2)));

}
