// JavaScript Document
function MensagemErroForm() {
	document.getElementById('tdMensagem').innerHTML = '<span id="ReqField"><b>Campos em negritos obrigat&oacute;rios.<b></span>';
}
function MensagemSucessoForm() {
	document.getElementById('tdMensagem').innerHTML = '<span id="ReqField"><b>Enviado com sucesso!<b></span>';
}
function MensagemErroSistema() {
	document.getElementById('tdMensagem').innerHTML = '<span id="ReqField"><b>Ops! Ocorreu um erro, tente novamente!<b></span>';
}

function MaskPhone(obj) {
   if(obj.value.length == 0)
     obj.value = '(' + obj.value;

   if(obj.value.length == 3)
      obj.value = obj.value + ')';

 if(obj.value.length == 8)
     obj.value = obj.value + '-';
}
function SendForm(objForm) {
	objForm.submit();
}
function GetObject(objId) {
	return document.getElementById(objId);
}
function Len(objId) {
	return GetObject(objId).value.length;
}
function GetValue(objId) {
	return document.getElementById(objId).value;
}
function DisableFieldsForm(idForm) {
	 var totalFields = document.getElementById(idForm).elements.length;
	 for (i = 0; i < totalFields; i++) {
        document.getElementById(idForm).elements[i].disabled = true;
	 }
}
function EnabledFieldsForm(idForm) {
	 var totalFields = document.getElementById(idForm).elements.length;
	 for (i = 0; i < totalFields; i++) {
        document.getElementById(idForm).elements[i].disabled = false;
	 }
}
function ShowContentLoading() {
	document.getElementById('ContentLoading').style.display = 'block';
}
function HideContentLoading() {
	document.getElementById('ContentLoading').style.display = 'none';
}
function verificaParametro(strParam) {
	if(strParam.length == 0) {
		return false;
	}
	else {
		return true;
	}
}

//Escreve um arquivo em flash
function WriteFlashPublicidade(Arquivo, Largura, Altura, FlashVars) {
	document.write('<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"');
	document.write('height="' + Altura + '" width="' + Largura + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT>');
	document.write('<PARAM NAME="_cx" VALUE="15425">');
	document.write('<PARAM NAME="_cy" VALUE="741">');
	document.write('<PARAM NAME="FlashVars" VALUE="' + FlashVars + '">');
	document.write('<PARAM NAME="Movie" VALUE="' + Arquivo + '">');
	document.write('<PARAM NAME="Src" VALUE="' + Arquivo + '">');
	document.write('<PARAM NAME="WMode" VALUE="Transparent">');
	document.write('<PARAM NAME="Play" VALUE="-1">');
	document.write('<PARAM NAME="Loop" VALUE="-1">');
	document.write('<PARAM NAME="Quality" VALUE="High">');
	document.write('<PARAM NAME="SAlign" VALUE="">');
	document.write('<PARAM NAME="Menu" VALUE="-1">');
	document.write('<PARAM NAME="Base" VALUE="">');
	document.write('<PARAM NAME="AllowScriptAccess" VALUE="">');
	document.write('<PARAM NAME="Scale" VALUE="ShowAll">');
	document.write('<PARAM NAME="DeviceFont" VALUE="0">');
	document.write('<PARAM NAME="EmbedMovie" VALUE="0">');
	document.write('<PARAM NAME="BGColor" VALUE="">');
	document.write('<PARAM NAME="SWRemote" VALUE="">');
	document.write('<PARAM NAME="MovieData" VALUE="">');
	document.write('<PARAM NAME="SeamlessTabbing" VALUE="1">');
	document.write('<PARAM NAME="Profile" VALUE="0">');
	document.write('<PARAM NAME="ProfileAddress" VALUE="">');
	document.write('<PARAM NAME="ProfilePort" VALUE="0">');
	document.write('<embed src="' + Arquivo + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ');
	document.write('type="application/x-shockwave-flash" width="' + Largura + '" height="' + Altura + '"> </embed>');
	document.write('</OBJECT>');
}
function WriteFlash(Arquivo, Largura, Altura, FlashVars) {
	document.write('<OBJECT codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"');
	document.write('height="' + Altura + '" width="' + Largura + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" VIEWASTEXT>');
	document.write('<PARAM NAME="_cx" VALUE="15425">');
	document.write('<PARAM NAME="_cy" VALUE="741">');
	document.write('<PARAM NAME="FlashVars" VALUE="' + FlashVars + '">');
	document.write('<PARAM NAME="Movie" VALUE="' + Arquivo + '">');
	document.write('<PARAM NAME="Src" VALUE="' + Arquivo + '">');
	document.write('<PARAM NAME="WMode" VALUE="Transparent">');
	document.write('<PARAM NAME="Play" VALUE="-1">');
	document.write('<PARAM NAME="Loop" VALUE="-1">');
	document.write('<PARAM NAME="Quality" VALUE="High">');
	document.write('<PARAM NAME="SAlign" VALUE="">');
	document.write('<PARAM NAME="Menu" VALUE="-1">');
	document.write('<PARAM NAME="Base" VALUE="">');
	document.write('<PARAM NAME="AllowScriptAccess" VALUE="">');
	document.write('<PARAM NAME="Scale" VALUE="ShowAll">');
	document.write('<PARAM NAME="DeviceFont" VALUE="0">');
	document.write('<PARAM NAME="EmbedMovie" VALUE="0">');
	document.write('<PARAM NAME="BGColor" VALUE="">');
	document.write('<PARAM NAME="SWRemote" VALUE="">');
	document.write('<PARAM NAME="MovieData" VALUE="">');
	document.write('<PARAM NAME="SeamlessTabbing" VALUE="1">');
	document.write('<PARAM NAME="Profile" VALUE="0">');
	document.write('<PARAM NAME="ProfileAddress" VALUE="">');
	document.write('<PARAM NAME="ProfilePort" VALUE="0">');
	document.write('<embed src="' + Arquivo + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ');
	document.write('type="application/x-shockwave-flash" width="' + Largura + '" height="' + Altura + '"> </embed>');
	document.write('</OBJECT>');
}

