<!--


// ---- Função da parte Administrativa - HMTL
function checkWebmail(form) {
  if ( (form.username.value.indexOf('@', 0) == -1) || (form.username.value.indexOf('.', 0) == -1) ) {
    alert('Por favor, digite um e-mail válido');
    form.username.focus();
    return false;
  }
  else if (form.password.value == '' || form.password.value.length < 8) {
    alert('Por favor, digite uma senha válida');
    form.password.focus();
    return false;
  }
  return true;
}

var editor = null;
function initEditor() {
  // create an editor for the "ta" textbox
  editor = new HTMLArea("ta");

  // register the TableOperations plugin with our editor
  editor.registerPlugin("TableOperations");

  editor.generate();
  return false;
}

function insertHTML() {
  var html = prompt("Enter some HTML code here");
  if (html) {
    editor.insertHTML(html);
  }
}
function highlight() {
  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
}

function mySubmit() {
// document.edit.save.value = "yes";
document.edit.onsubmit(); // workaround browser bugs.
document.edit.submit();
}





// ----------------------------------FUNÇÔES MANGUEIRA-----------------------------------------------------

function jkpopimage(imgpath, popwidth, popheight, textdescription){
	
	function getpos(){
		leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
		toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
			if (window.opera){
				leftpos-=screenLeft
				toppos-=screenTop
			}
	}
	
	getpos()
	var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,left='+leftpos+',top='+toppos
	var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
		if (typeof jkpopwin=="undefined" || jkpopwin.closed)
			jkpopwin=window.open("","",winattributes)
		else{
			jkpopwin.resizeTo(popwidth, popheight+30)
		}
	jkpopwin.document.open()
	jkpopwin.document.write('<html><title>'+windowtitle+'</title><body leftmargin="1" topmargin="0" bgproperties="fixed" marginwidth="0" marginheight="0" '+bodyattribute+'><img src="'+imgpath+'" style="margin-bottom: 0.5em"><br>'+textdescription+'</body></html>')
	jkpopwin.document.close()
	jkpopwin.focus()
}

function validarcampo3()
{
		
	if(document.enquete.resposta = "undefined"){
		alert("Informe sua opção na enquete, por favor!");
		return(false);
		alert("Informe sua opção na enquete, por favor!");
		return(false);
	}
}

// ------------ Indique ---------------------------------
				function validarCampo()
				{
				// Nome
					if(document.formrec.nome.value == "")
					{
									alert("Campo ausente.\rFavor informar o seu Nome.");
									document.formrec.nome.focus();				
									return(false);
					}
					
				// E-mail
					if(document.formrec.email.value == "")
					{
									alert("Campo ausente.\rFavor informar o seu E-mail.");
									document.formrec.email.focus();				
									return(false);
					}
				
				// Nome Amigo
					if(document.formrec.nomeamigo.value == "")
					{
									alert("Campo ausente.\rFavor informar o Nome do seu amigo(a).");
									document.formrec.nomeamigo.focus();				
									return(false);
					}
				// e-mail	
					if(document.formrec.emailamigo.value == "")
					{
									alert("Campo ausente.\rFavor informar o E-mail do seu amigo(a).");
									document.formrec.emailamigo.focus();				
									return(false);
					}
				// mensagem
					if(document.formrec.msgrec.value == "")
					{
									alert("Campo ausente.\rFavor informar a mensagem.");
									document.formrec.msgrec.focus();				
									return(false);
					}
					
					document.formrec.submit();
				}
				
				//--------------------------------------------------- 

function checkWebmail(form) {
  if ( (form.username.value.indexOf('@', 0) == -1) || (form.username.value.indexOf('.', 0) == -1) ) {
    alert('Por favor, digite um e-mail válido');
    form.username.focus();
    return false;
  }
  else if (form.password.value == '' || form.password.value.length < 8) {
    alert('Por favor, digite uma senha válida');
    form.password.focus();
    return false;
  }
//  return true;
	document.formWebmail2.submit();
}


img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"
ns6_index=0

function change(e){
		if(!document.all&&!document.getElementById)
		return
		
		if (!document.all&&document.getElementById)
		ns6_index=1
	
	var source=document.getElementById&&!document.all? e.target:event.srcElement
		if (source.className=="folding"){
		var 	source2=document.getElementById&&!document.all? source.parentNode.childNodes:source.parentElement.all
			if (source2[2+ns6_index].style.display=="none"){
				source2[2+ns6_index].style.display=''
			}
			else{
				source2[2+ns6_index].style.display="none"
			}
		}
}
	document.onclick=change
// ----------------------------------FUNÇÔES GERAIS-----------------------------------------------------


	function SubmitForm1()
	{
		Exec_AbrirFormPopUp(form1,475,170);
		//form1.submit();
	}		

// Abrir um formulario em uma nova pagina - Formulario
	function Exec_Blank() {
		//form.submit();
	}
	function Exec_AbrirFormPopUp(form,width,height) {
		form.target = 'newWin';
		displayWindow = window.open('', "newWin","scrollbars=1,menubar=0,toolbar=0,location=0,status=1,width=" + width + ",height=" + height);
		//form.submit();
	}

// Abrir uma nova pagina - Link
	function abrir(Arquivolink,width,height){
			window.open(Arquivolink, '', "resizable=no,location=no,directories=no,status=no,toolbar=no,menubar=no,scrollbars=yes,width=" + width + ",height=" + height + "")
	}
	
 // Mostrar Tabelas nas paginas X_?
	function mostra(item){
				//var obj = document.getElementById(it);
				if (item.style.display=='none'){
				item.style.display='';
				//alert('entrou');
				}
				else{
				item.style.display='none'; //alert('entro no else');
				}
			}
			
	function mostraEnt(item,anterior){
				//var obj = document.getElementById(it);
				//alert(document.form1.Temp_Controle_Ent.value + 'f');
				//alert('a' + anterior);

				if (item.style.display=='none'){
				ocultartabelaEntALL(); // Diverença entre as funções mostraArq e  mostraEnt
				item.style.display='';
				document.formENT.Temp_Controle_Ent.value = anterior // Diverença entre as funções mostraArq e  mostraEnt
				document.formENT.Temp_Controle_Ent.value
//alert('Entrou no if')
				}
				else{
					if (document.formENT.Temp_Controle_Ent.value != anterior){ // Diverença entre as funções mostraArq e  mostraEnt
						item.style.display='none'; //alert('entro no else');
					}
				}
			}

		function mostraArq(item,anterior){
				//var obj = document.getElementById(it);
				//alert(document.form1.Temp_Controle_Ent.value + 'f');
				//alert('a' + anterior);
				if (item.style.display=='none'){
				ocultartabelaArqALL(); // Diverença entre as funções mostraArq e  mostraEnt
				item.style.display='';
				document.form2.Temp_Controle_Arq.value = anterior // Diverença entre as funções mostraArq e  mostraEnt
				//alert('Entrou no if')
				}
				else{
					if (document.form2.Temp_Controle_Arq.value != anterior){ // Diverença entre as funções mostraArq e  mostraEnt
						item.style.display='none'; //alert('entro no else');
					}
				}
			}		
			
			
			
 // Mostrar Tabelas nas paginas X_?
	function ocultartabela(item){
				item.style.display='none'; //alert('entro no else');
			}			
 // Mostrar Tabelas nas paginas X_?
	function Mostrartabela(item){
				item.style.display=''; //alert('entro no else');
			}				



function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

// ----- Data -------

var dtCh= "/";
var minYear=1900;
var maxYear=2100;


function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}



function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}



function isDate(dtStr){
		var daysInMonth = DaysArray(12)
		var pos1=dtStr.indexOf(dtCh)
		var pos2=dtStr.indexOf(dtCh,pos1+1)
		var strDay=dtStr.substring(0,pos1)
		var strMonth=dtStr.substring(pos1+1,pos2)
		var strYear=dtStr.substring(pos2+1)
		strYr=strYear
		if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
		if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
		for (var i = 1; i <= 3; i++) {
			if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
		}
		month=parseInt(strMonth)
		day=parseInt(strDay)
		year=parseInt(strYr)
		if (pos1==-1 || pos2==-1){
			alert("O formato das datas deve ser: dd/mm/aaaa")
			return false
		}
		if (strMonth.length<1 || month<1 || month>12){
			alert("Por favor entre com um mês válido")
			return false
		}
		if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
			alert("Por favor entre com um dia válido")
			return false
		}
		if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
			alert("Por favor entre com um ano válido, com os valores entre "+minYear+" e "+maxYear)
			return false
		}
		if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
			alert("Por favor entre com uma data válida")
			return false
		}
	return true
}

function isDate2(dtStr){
		var daysInMonth = DaysArray(12)
		var pos1=dtStr.indexOf(dtCh)
		var pos2=dtStr.indexOf(dtCh,pos1+1)
		var strDay=dtStr.substring(0,pos1)
		var strMonth=dtStr.substring(pos1+1,pos2)
		var strYear=dtStr.substring(pos2+1)
		strYr=strYear
		if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
		if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
		for (var i = 1; i <= 3; i++) {
			if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
		}
		month=parseInt(strMonth)
		day=parseInt(strDay)
		year=parseInt(strYr)
		if (pos1==-1 || pos2==-1){
			alert("O formato de datas deve ser: dd/mm/aaaa")
			return false
		}
		if (strMonth.length<1 || month<1 || month>12){
			alert("Por favor entre com um mês válido")
			return false
		}
		if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
			alert("Por favo entre com um dia válido")
			return false
		}
		if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
			alert("Por favor entre com um ano válido, com os valores entre "+minYear+" e "+maxYear)
			return false
		}
		if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
			alert("Por favor entre com uma data válida")
			return false
		}
	return true
}



// Flash - Carregar Imagens ---------------------

if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;


// Flash - Pagina Principal ---------------------
function insertObject(str) {    document.write(str);}

// Flash - Pagina Principal ---------------------

// ----------------------------------VALIDACAO-----------------------------------------------------
// Validar a tela Criação/Alteração/Exclução Menu  -- Ad_Acao.asp / Ad_menu.asp
	function validarAdmMenu()
	{
		// Acao Excluir ----------
		if(document.form1.SubAcaoMenu.value == "EXECDELETEARITEMMENU")
		{
			if(document.form1.NomeMenu.value == "")
			{
				alert("Campo ausente.\rFavor informar o nome do item para confirmar a exclusão.");
				document.form1.NomeMenu.focus();				
				return(false);
			}
			
		}
	
		// Acao Alterar e Criar ----------
		if(document.form1.SubAcaoMenu.value == "EXECALTERARITEMMENU" || document.form1.SubAcaoMenu.value == "EXECCRIARITEMMENU")
		{
			if(document.form1.NomeMenu.value == "")
			{
							alert("Campo ausente.\rFavor informar o nome do item.");
							document.form1.NomeMenu.focus();				
							return(false);
			}
			
			if(document.form1.DescMenu.value == "")
			{
							alert("Campo ausente.\rFavor informar a descrição do item.");
							document.form1.DescMenu.focus();				
							return(false);
			}
			
			if(document.form1.OrdemMenu.value == "")
			{
							alert("Campo ausente.\rFavor informar a ordem do item.");
							document.form1.OrdemMenu.focus();				
							return(false);
			}
		}
	}
	
	// Validar a tela Login  -- Default.asp
	function validarAdmLogin()
	{
		if(document.form1.login.value == "")
		{
			alert("Campo ausente.\rFavor informar o login.");
			document.form1.login.focus();				
			return(false);
		}

		if(document.form1.password.value == "")
		{
			alert("Campo ausente.\rFavor informar sua senha.");
			document.form1.password.focus();				
			return(false);
		}
	}
// Validar a tela de Inserção de Páginas  -- Ad_Lista_informacao.asp/Ad_Lista_Informacao_Novo.asp
	function validarAdPag()
	{
		if(document.form1.tituloInfo.value == "")
		{
			alert("Campo ausente.\rFavor informar o título da nova página.");
			document.form1.tituloInfo.focus();				
			return(false);
		}
	}
// Validar a tela de Inserção de Páginas  -- Ad_Lista_informacao.asp/Ad_Lista_Informacao_Novo.asp	
	function validarAdPagEsp()
	{	
		if(document.form2.LinkArquivoInfo.value == "")
		{
			alert("Campo ausente.\rFavor informar o nome do arquivo.");
			document.form2.LinkArquivoInfo.focus();				
			return(false);
		}
		if(document.form2.targetInfo.value == "")
		{
			alert("Campo ausente.\rFavor informar a forma de abertura da página.");
			document.form2.targetInfo.focus();				
			return(false);
		}
		if(document.form2.tituloInfo.value == "")
		{
			alert("Campo ausente.\rFavor informar o título da nova página especial.");
			document.form2.tituloInfo.focus();				
			return(false);
		}
	}
// Validar a tela de Adição de Parâmetros  -- Ad_Lista_Parametro.asp
	function validarAdParam()
	{
		if(document.form1.BuscaParametro.value == "")
		{
			alert("Campo ausente.\rFavor informar o parâmetro.");
			document.form1.BuscaParametro.focus();				
			return(false);
		}
	}
// Validar a tela de Alteração de senha  -- Ad_Usuario.asp
	function validarAdAltPasswd()
	{
		if (document.form1.SubAcaoLogin.value == 'EXECALTERARLOGIN')
		{	
			if(document.form1.password.value == "")
			{
				alert("Campo ausente.\rFavor informar a nova senha.");
				document.form1.password.focus();				
				return(false);
			}
		}
		
		if (document.form1.SubAcaoLogin.value == 'EXECCRIARLOGIN')
		{	
			if(document.form1.loginNovo.value == "")
			{
				alert("Campo ausente.\rFavor informar o novo login.");
				document.form1.loginNovo.focus();				
				return(false);
			}
			if(document.form1.passwordNovo.value == "")
			{
				alert("Campo ausente.\rFavor informar a senha.");
				document.form1.passwordNovo.focus();				
				return(false);
			}
		}
	}


	
// Validar a tela de Alteração de senha  -- Ad_Lista_Parametro_Item.asp / Ad_Acao.asp
	function validarParametroItem()
	{
		
		if (document.form1.SubAcaoParametro.value == 'EXECCRIAPARAMETRO' || document.form1.SubAcaoParametro.value == 'EXECALTERARPARAMETRO' )
		{	
			if(document.form1.Nome_parametro.value == "")
			{
				alert("Campo ausente.\rFavor informar o nome do parametro.");
				document.form1.Nome_parametro.focus();				
				return(false);
			}
			if(document.form1.Desc_Parametro.value == "")
			{
				alert("Campo ausente.\rFavor informar a descrição.");
				document.form1.Desc_Parametro.focus();				
				return(false);
			}
			
			if(document.form1.Value.value == "")
			{
				alert("Campo ausente.\rFavor informar o valor.");
				document.form1.Value.focus();				
				return(false);
			}
			

			
		}
	}

	
// Validar a tela de Alteração de senha  -- Ad_Lista_Parametro_Item.asp / Ad_Acao.asp
	function validarNoticia()
	{
		
		if (document.edit.SubAcaoInformacao.value == 'EXECALTERARINFOMACAO' || document.edit.SubAcaoInformacao.value == 'EXECCRIARINFOMACAO' )
		{	
			
			if(document.edit.IdMenu.value == "")
			{
				alert("Campo ausente.\rFavor informar menu.");
				document.edit.IdMenu.focus();				
				return(false);
			}
			
			if(document.edit.tituloInfo.value == "")
			{
				alert("Campo ausente.\rFavor informar o titulo.");
				document.edit.tituloInfo.focus();				
				return(false);
			}
			
			if(document.edit.dataInfo.value == "")
			{
				alert("Campo ausente.\rFavor informar a data.");
				document.edit.dataInfo.focus();				
				return(false);
			}
			
			//if(document.edit.ta.value == "")
			//{
				//alert("Campo ausente.\rFavor informar o texto da informação.");
				//document.edit.ta.focus();				
				//return(false);
			//}
			if(document.edit.CaminhoImagem.value == "")
			{
				alert("Campo ausente.\rFavor informar a imagem lateral.");
				document.edit.CaminhoImagem.focus();				
				return(false);
			}
			if(document.edit.LinkArquivoInfo.value == "")
			{
				alert("Campo ausente.\rFavor informar o link.");
				document.edit.LinkArquivoInfo.focus();				
				return(false);
			}
			
			if(document.edit.targetInfo.value == "")
			{
				alert("Campo ausente.\rFavor informar o abrir em.");
				document.edit.targetInfo.focus();				
				return(false);
			}
			
		}
		
		Exec_AbrirFormPopUp(edit,475,170);
	}
	
	
	
	
	// Validar as telas RRTIM
	function validarArquivo(Id_Arq)
	{
		if (Id_Arq != '')
		{	
			document.form2.Id_Arq_FormAtualizacao.value = Id_Arq;
		}
		else
		{
			alert("Campo de identificação ausente.\rFavor informar um item.");
			return(false);
		}
		
		Exec_AbrirFormPopUp(form2,475,170);
		form2.submit();
	}
	
	// Validar as telas RRTIM
	function validarEntrante(Id_Ent)
	{
		if (document.formENT.SubAcaoInformacaoEnt.value == 'INSERIRINFOMACAO' )
		{	
			if (document.formENT.Id_Cliente.value == '')
			{
				alert("Campo de identificação ausente.\rFavor informar um cliente.");
				return(false);
			}
		}
		
		if (document.formENT.SubAcaoInformacaoEnt.value == 'EXCLUIRINFOMACAO')
		{	
			if (confirm('Deseja realmente apagar este registro?'))
			{
				// confirm('Nada');
			}
			else
			{	
				return(false);
			}
		}
		
		
		if (document.formENT.SubAcaoInformacaoEnt.value == 'ALTERARINFOMACAO')
		{	
			//document.formENT.Id_Entrante.value = Id_Ent;
		}
		
		document.formENT.Id_Entrante.value = Id_Ent;
		
		Exec_AbrirFormPopUp(formENT,475,170);
		formENT.submit();
	}

	function validarCliente()
	{
			if (document.formCLI.txt_no_cliente.value == '')
			{
				alert("Campo de identificação ausente.\rFavor informar um cliente.");
				document.formCLI.txt_no_cliente.focus();	
				return(false);
			}
			if (document.formCLI.num_cpf.value == '')
			{
				alert("Campo de identificação ausente.\rFavor informar um cliente.");
				document.formCLI.num_cpf.focus();	
				return(false);
			}

		if (document.formCLI.SubAcaoInformacaoCli.value == 'ALTERARCLIENTE')
		{
			Exec_AbrirFormPopUp(formCLI,475,170);
		}
		formCLI.submit();
	}
	
	
	
	
// ------ Relação Dinamica	
	function validarRelDinamica()
	{
			if(document.form1.DescItemRelDin.value == "")
			{
				alert("Campo ausente.\rFavor informar a descrição.");
				document.form1.DescItemRelDin.focus();				
				return(false);
			}
						
	
			if(document.form1.IdMenuReferencia.value == "")
			{
				alert("Campo ausente.\rFavor informar o menu de referencia:.");
				document.form1.IdMenuReferencia.focus();				
				return(false);
			}
			

	}
	
	
	
	

	/// ------------------------------------------------------------- /// ----------------------------------
	
	
		function abrir2(arquivo, orientacao)
	{
			window.open(arquivo, '', 'resizable=no,location=no,directories=no,status=no,toolbar=no,menubar=no,scrollbars=yes,width=430,height=580')
	}
	
	function abrirsamba(arquivo, orientacao)
	{
			window.open(arquivo, '', 'resizable=no,location=no,directories=no,status=no,toolbar=no,menubar=no,scrollbars=yes,width=560,height=450')
	}
	
	function abrirfantasia(arquivo, orientacao)
	{
			window.open(arquivo, '', 'resizable=no,location=no,directories=no,status=no,toolbar=no,menubar=no,scrollbars=yes,width=600,height=470')
	}
	
	function abriraudio(arquivo, orientacao)
	{
			window.open(arquivo, '', 'resizable=no,location=no,directories=no,status=no,toolbar=no,menubar=no,scrollbars=no,width=219,height=276')
	}
	
	// Album
	function MM_openBrWindow(theURL,winName,features) {
  		window.open(theURL,winName,features);
	}

	function irpara(destino)
	{
			location.href = destino
	}
	
	function msgAlert(msg)
	{
			alert(msg);
	}

	function EnviarEmail()
	{
		Exec_AbrirFormPopUp(form1,475,170);
		form1.submit();
	}


//-----------------------------------------
//function OnClick(redirecionar){
//} - Funcao localizada em Funcoes Asp
//-----------------------------------------

function imprimir(){
	window.print();
}
function fechar(){
	window.close();
}
function SubmitForm(){
	document.formWebmail.submit();
}

function limpa () {
	document.registro1.nome.value = ''
	document.registro1.email.value = ''
	document.registro1.assunto.value = ''
	document.registro1.msg.value = ''
	document.registro1.qqemail.value = 'm1'
}
function enviarformulario() {
	document.registro1.submit();
}
function enviarBusca() {
	if (document.busca.p.value != '')
	{	
		document.busca.submit();
	}
}
function LimparBusca() {
	document.busca.p.value = ''	
	document.busca.submit();
}


function detectexist(obj){
	return (typeof obj !="undefined");
}
var popbackground="#FFCCFF" 
var windowtitle="" 

function jkpopimage(imgpath, popwidth, popheight, textdescription){
	
	function getpos(){
		leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
		toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/2 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/2 : 0
			if (window.opera){
				leftpos-=screenLeft
				toppos-=screenTop
			}
	}
	
	getpos()
	var winattributes='width='+popwidth+',height='+popheight+',resizable=yes,left='+leftpos+',top='+toppos
	var bodyattribute=(popbackground.indexOf(".")!=-1)? 'background="'+popbackground+'"' : 'bgcolor="'+popbackground+'"'
		if (typeof jkpopwin=="undefined" || jkpopwin.closed)
			jkpopwin=window.open("","",winattributes)
		else{
			jkpopwin.resizeTo(popwidth, popheight+30)
		}
	jkpopwin.document.open()
	jkpopwin.document.write('<html><title>'+windowtitle+'</title><body leftmargin="1" topmargin="0" bgproperties="fixed" marginwidth="0" marginheight="0" '+bodyattribute+'><img src="'+imgpath+'" style="margin-bottom: 0.5em"><br>'+textdescription+'</body></html>')
	jkpopwin.document.close()
	jkpopwin.focus()
}

function validarcampo3()
{
		
	if(document.enquete.resposta = "undefined"){
		alert("Informe sua opção na enquete, por favor!");
		return(false);
		alert("Informe sua opção na enquete, por favor!");
		return(false);
	}
}

// ------------ Indique ---------------------------------
				function validarCampo()
				{
				// Nome
					if(document.formrec.nome.value == "")
					{
									alert("Campo ausente.\rFavor informar o seu Nome.");
									document.formrec.nome.focus();				
									return(false);
					}
					
				// E-mail
					if(document.formrec.email.value == "")
					{
									alert("Campo ausente.\rFavor informar o seu E-mail.");
									document.formrec.email.focus();				
									return(false);
					}
				
				// Nome Amigo
					if(document.formrec.nomeamigo.value == "")
					{
									alert("Campo ausente.\rFavor informar o Nome do seu amigo(a).");
									document.formrec.nomeamigo.focus();				
									return(false);
					}
				// e-mail	
					if(document.formrec.emailamigo.value == "")
					{
									alert("Campo ausente.\rFavor informar o E-mail do seu amigo(a).");
									document.formrec.emailamigo.focus();				
									return(false);
					}
				// mensagem
					if(document.formrec.msgrec.value == "")
					{
									alert("Campo ausente.\rFavor informar a mensagem.");
									document.formrec.msgrec.focus();				
									return(false);
					}
					
					document.formrec.submit();
				}
				
				//--------------------------------------------------- 


//rrr

	function validarAlterarDados()
	{
		
		if (document.formCLI.SubAcaoInformacaoCli.value == 'ALTERARDEPENDENTE' )
		{	
		// Dependente - Alteração de Dados
			if(document.formCLI.NOME_DEPENDENTE.value == "")
			{
				alert("Campo ausente.\rFavor informar o nome.");
				document.formCLI.NOME_DEPENDENTE.focus();				
				return(false);
			}
			
			if(document.formCLI.DTNASC.value == "")
			{
				alert("Campo ausente.\rFavor informar a data nascimento.");
				document.formCLI.DTNASC.focus();				
				return(false);
			}
			
			var dt2=document.formCLI.DTNASC;
			if (isDate(dt2.value)==false){
				dt2.focus();
				return false;
			}
			
			if(document.formCLI.MAE.value == "")
			{
				alert("Campo ausente.\rFavor informar a mãe.");
				document.formCLI.MAE.focus();				
				return(false);
			}

			if(document.formCLI.Sexo.value == "")
			{
				alert("Campo ausente.\rFavor informar o sexo.");
				document.formCLI.Sexo.focus();				
				return(false);
			}
			if(document.formCLI.GP.value == "")
			{
				alert("Campo ausente.\rFavor informar o grau de parentesco.");
				document.formCLI.GP.focus();				
				return(false);
			}
//			if(document.formCLI.MOTitular.value == "")
//			{
//				alert("Campo ausente.\rFavor informar a M.O.");
//				document.formCLI.MOTitular.focus();				
//				return(false);
//			}
//			if(document.formCLI.ObsChm.value == "")
//			{
//				alert("Campo ausente.\rFavor informar a observação. \rColocar N/A caso não tenha observação");
//				document.formCLI.ObsChm.focus();				
//				return(false);
//			}
			
			
		}
		else
		{
		// Titular - Alteração ou inclusão de um novo titular
			if(document.formCLI.ID_EMPRESA.value == "")
			{
				alert("Campo ausente.\rFavor informar a empresa.");
				document.formCLI.ID_EMPRESA.focus();				
				return(false);
			}
			
			if(document.formCLI.MATRICULA_FUNCIONARIO.value == "")
			{
				alert("Campo ausente.\rFavor informar a matricula.");
				document.formCLI.MATRICULA_FUNCIONARIO.focus();				
				return(false);
			}
			
			if(document.formCLI.NOME_FUNCIONARIO.value == "")
			{
				alert("Campo ausente.\rFavor informar o nome.");
				document.formCLI.NOME_FUNCIONARIO.focus();				
				return(false);
			}
			if(document.formCLI.DTNASC.value == "")
			{
				alert("Campo ausente.\rFavor informar o data nascimento.");
				document.formCLI.DTNASC.focus();				
				return(false);
			}
			var dt2=document.formCLI.DTNASC;
			if (isDate(dt2.value)==false){
				dt2.focus();
				return false;
			}
			
			
			if(document.formCLI.DATAADM.value == "")
			{
				alert("Campo ausente.\rFavor informar o data admissão.");
				document.formCLI.DATAADM.focus();				
				return(false);
			}
			var dt3=document.formCLI.DATAADM;
			if (isDate(dt3.value)==false){
				dt3.focus();
				return false;
			}
			
			if(document.formCLI.CPF.value == "")
			{
				alert("Campo ausente.\rFavor informar o CPF.");
				document.formCLI.CPF.focus();				
				return(false);
			}
			
			if(isInteger(document.formCLI.CPF.value))
			{
				//alert("passou");
			}
			else
			{
				alert("Favor informar o CPF, composto apenas com numeros.");
				document.formCLI.CPF.focus();				
				return(false);
			}
			
			var strCPF = document.formCLI.CPF.value;
			if (strCPF.length != 11)
			{
				alert('Favor informar o CPF, composto por 11 numeros.');
				document.formCLI.CPF.focus();				
				return(false);
			}
			
			if(document.formCLI.IDENTIDADE.value == "")
			{
				alert("Campo ausente.\rFavor informar a identidade.");
				document.formCLI.IDENTIDADE.focus();				
				return(false);
			}
			if(document.formCLI.PIS.value == "")
			{
				alert("Campo ausente.\rFavor informar o PIS.");
				document.formCLI.PIS.focus();				
				return(false);
			}			
			if(document.formCLI.ESTADOCIVI.value == "")
			{
				alert("Campo ausente.\rFavor informar o estado civil.");
				document.formCLI.ESTADOCIVI.focus();				
				return(false);
			}	
			if(document.formCLI.CONJUGUE.value == "")
			{
				alert("Campo ausente.\rFavor informar o cônjuge. \rFavor colocar N\A se não for casado.");
				document.formCLI.CONJUGUE.focus();				
				return(false);
			}	
			if(document.formCLI.PAI.value == "")
			{
				alert("Campo ausente.\rFavor informar o pai.");
				document.formCLI.PAI.focus();				
				return(false);
			}	
			if(document.formCLI.MAE.value == "")
			{
				alert("Campo ausente.\rFavor informar a mãe.");
				document.formCLI.MAE.focus();				
				return(false);
			}	
			if(document.formCLI.END_COMPLETO.value == "")
			{
				alert("Campo ausente.\rFavor informar o endereço.");
				document.formCLI.END_COMPLETO.focus();				
				return(false);
			}	
			
			if(document.formCLI.END_MUNICIPIO.value == "")
			{
				alert("Campo ausente.\rFavor informar o município.");
				document.formCLI.END_MUNICIPIO.focus();				
				return(false);
			}	

			if(document.formCLI.END_CEP.value == "")
			{
				alert("Campo ausente.\rFavor informar o CEP.");
				document.formCLI.END_CEP.focus();				
				return(false);
			}	
			if(document.formCLI.POSTO.value == "")
			{
				alert("Campo ausente.\rFavor informar o posto.");
				document.formCLI.POSTO.focus();				
				return(false);
			}	
			if(document.formCLI.CONTROLE.value == "")
			{
				alert("Campo ausente.\rFavor informar o controle.");
				document.formCLI.CONTROLE.focus();				
				return(false);
			}				
			
		}
		
		Exec_AbrirFormPopUp(formCLI,475,170);
		formCLI.submit();
	}
	
	
	function validarCancelarChamado()
	{
		Exec_AbrirFormPopUp(edit,475,170);
	}
	
	
	function AbrirFormCLIAcoes()
	{
		Exec_AbrirFormPopUp(formCLI,475,170);
		formCLI.submit();
	}
	
	
	
	
	// ------------------------------------
	
	function AbrirFormCLIAcoesSeguradora(xacao)
	{
		
		if (xacao == 'ABRIRCHAMADOPARAEXCLUIR')
		{	
			if (confirm('Deseja abrir um chamado para \rexcluir este usuário?'))
			{
				// confirm('Nada');
			}
			else
			{	
				return(false);
			}
		}

		if (xacao == 'ABRIRCHAMADOPARASEGVIA')
		{	
			if (confirm('Deseja abrir um chamado para \rsolicitar seg. via deste usuário?'))
			{
				// confirm('Nada');
			}
			else
			{	
				return(false);
			}
		}
		
		if (xacao == 'EXCLUIRBD')
		{	
			if (confirm('Deseja excluir este usuário do banco de dados?'))
			{
				// confirm('Nada');
			}
			else
			{	
				return(false);
			}
		}



		document.formCLI.SubAcaoChamado.value = xacao;
		
		Exec_AbrirFormPopUp(formCLI,475,170);
		formCLI.submit();
	}	
	
	
	function ValidarAlteracaoDetalhesdoChamado()
	{
		
			if(document.formCLI.COD_CARTAO_DO_TITULAR.value == "")
			{
				alert("Campo ausente.\rFavor informar a M.O.");
				document.formCLI.COD_CARTAO_DO_TITULAR.focus();				
				return(false);
			}		
			if(document.formCLI.STATUS.value == "")
			{
				alert("Campo ausente.\rFavor informar o status.");
				document.formCLI.STATUS.focus();				
				return(false);
			}		
			
			
			AbrirFormCLIAcoes();
	}	
	
	
	function ValidarAlteracaoRelacaoItemSeguradora()
	{
		
			if (confirm('Deseja alterar os dados enviados pela seguradora? \rDependendo da alteração, esta linha pode ser duplicada na prox. atualização.'))
			{

				if(document.formCLI.FormUpdate_NOME_NA_SEGURADORA.value == "")
				{
					alert("Campo ausente.\rFavor informar a nome.");
					document.formCLI.FormUpdate_NOME_NA_SEGURADORA.focus();				
					return(false);
				}		
				
				if(document.formCLI.FormUpdate_COD_CARTAO.value == "")
				{
					alert("Campo ausente.\rFavor informar a M.O.");
					document.formCLI.FormUpdate_COD_CARTAO.focus();				
					return(false);
				}	
				
				if(document.formCLI.FormUpdate_CPF.value == "")
				{
					alert("Campo ausente.\rFavor informar o CPF");
					document.formCLI.FormUpdate_CPF.focus();				
					return(false);
				}
				
				if(document.formCLI.FormUpdate_GRAUPARENTESCO.value == "")
				{
					alert("Campo ausente.\rFavor informar o G.P.");
					document.formCLI.FormUpdate_GRAUPARENTESCO.focus();				
					return(false);
				}
				
				if(document.formCLI.FormUpdate_Status.value == "")
				{
					alert("Campo ausente.\rFavor informar o Status.");
					document.formCLI.FormUpdate_Status.focus();				
					return(false);
				}
				
				if(document.formCLI.FormUpdate_ID_EMPRESA.value == "")
				{
					alert("Campo ausente.\rFavor informar a Empresa.");
					document.formCLI.FormUpdate_ID_EMPRESA.focus();				
					return(false);
				}
				
			}
			else
			{	
				return(false);
			}
		
			
			AbrirFormCLIAcoes();
	}	


	function ValidarDeletarRelacaoItemSeguradora(xacao)
	{
		
			if (confirm('Deseja realmente deletar esta cliente do banco de dados?\rEsta exclusão não tem retorno.'))
			{
				// confirm('Nada');
			}
			else
			{	
				return(false);
			}

		document.formCLI.SubAcaoChamado.value = xacao;
		
		Exec_AbrirFormPopUp(formCLI,475,170);
		formCLI.submit();
	}	
	
	
	// ----------------------------------
	
	function AbrirFormCLIAcoesSeguradoraAlteracao(xacao)
	{
		
			if(document.formCLI.Alt_Campo.value == "")
			{
				alert("Campo ausente.\rFavor informar o nome do campo.");
				document.formCLI.Alt_Campo.focus();				
				return(false);
			}		
			
			if(document.formCLI.Alt_Valor.value == "")
			{
				alert("Campo ausente.\rFavor informar o valor do campo.");
				document.formCLI.Alt_Valor.focus();				
				return(false);
			}		
		
	
		document.formCLI.SubAcaoChamado.value = xacao;
		document.formCLI.Executar.value = 'SIM';

		formCLI.submit();
	}	
	
	
		function ValidarBuscaCliente()
	{
		
			if(document.form1.BuscaRegistroEmpresa.value == "")
			{
				alert("Campo ausente.\rFavor informar a empresa.");
				document.form1.BuscaRegistroEmpresa.focus();				
				return(false);
			}		
			
			var strRegistro = document.form1.BuscaRegistro.value;
			if(document.form1.BuscaRegistro.value == "" || strRegistro.length < 3)
			{
				alert("Campo ausente.\rFavor informar o valor da busca com 3 caracteres.");
				document.form1.BuscaRegistro.focus();				
				return(false);
			}		


	}	
	

	function ValidarBuscaRelacaoChamado()
	{
				
			if(document.form1.BuscaRegistroEmpresa.value == "")
			{
				alert("Campo ausente.\rFavor informar a empresa.");
				document.form1.BuscaRegistroEmpresa.focus();				
				return(false);
			}		
			
			if(document.form1.DT_CADASTRO.value != "")
			{
				
				var dt3=document.form1.DT_CADASTRO;
				if (isDate(dt3.value)==false){
					dt3.focus();
					return false;
				}
			}	
			
			if(document.form1.DT_CADASTRO_FIM.value != "")
			{
				
				var dt4=document.form1.DT_CADASTRO_FIM;
				if (isDate(dt4.value)==false){
					dt4.focus();
					return (false);
				}
			}	
			
			if(document.form1.DT_PROCESSAMENTO.value != "")
			{
				
				var dt3=document.form1.DT_PROCESSAMENTO;
				if (isDate(dt3.value)==false){
					dt3.focus();
					return false;
				}
			}	
			
			if(document.form1.DT_PROCESSAMENTO_FIM.value != "")
			{
				
				var dt4=document.form1.DT_PROCESSAMENTO_FIM;
				if (isDate(dt4.value)==false){
					dt4.focus();
					return (false);
				}
			}	
			
			if(document.form1.DT_PREV_CONCLUSAO.value != "")
			{
				
				var dt3=document.form1.DT_PREV_CONCLUSAO;
				if (isDate(dt3.value)==false){
					dt3.focus();
					return false;
				}
			}	
			
			if(document.form1.DT_PREV_CONCLUSAO_FIM.value != "")
			{
				
				var dt4=document.form1.DT_PREV_CONCLUSAO_FIM;
				if (isDate(dt4.value)==false){
					dt4.focus();
					return (false);
				}
			}	


			if(document.form1.DT_CONCLUSAO.value != "")
			{
				
				var dt3=document.form1.DT_CONCLUSAO;
				if (isDate(dt3.value)==false){
					dt3.focus();
					return false;
				}
			}	
			
			if(document.form1.DT_CONCLUSAO_FIM.value != "")
			{
				
				var dt4=document.form1.DT_CONCLUSAO_FIM;
				if (isDate(dt4.value)==false){
					dt4.focus();
					return (false);
				}
			}	
					
			if( document.form1.NUMEROCHAMADO.value != "")
			{
				var strChamado = document.form1.NUMEROCHAMADO.value;
				if(isInteger(document.form1.NUMEROCHAMADO.value) && strChamado.length > 1)
				{
					//alert("passou");
				}
				else
				{
					alert("Favor informar o numero do chamado, \rcomposto apenas por numeros e \rcom mais de 2 caracteres.");
					document.form1.NUMEROCHAMADO.focus();				
					return(false);
				}
			}		

	}	
	
	
	function ValidarBuscaRelacaoSeguradora()
	{
				
			if(document.form1.BuscaRegistroEmpresa.value == "")
			{
				alert("Campo ausente.\rFavor informar a empresa.");
				document.form1.BuscaRegistroEmpresa.focus();				
				return(false);
			}		
			
			if(document.form1.SEGURADORA.value == "")
			{
				alert("Campo ausente.\rFavor informar a seguradora.");
				document.form1.SEGURADORA.focus();				
				return(false);
			}		
			
			var strRegistro = document.form1.BuscaRegistro.value;
			if(document.form1.BuscaRegistro.value == "" || strRegistro.length < 3)
			{
				alert("Campo ausente.\rFavor informar o valor da busca com 3 caracteres.");
				document.form1.BuscaRegistro.focus();				
				return(false);
			}		
			
		//document.form1.action = "X_Ad_RelacaoSeguradora_Join.asp";
		document.form1.SubAcaoJoin.value = "";
		
		form1.target = '';
		form1.submit();

	}		
	
		
	function ValidarRelSegExecutarJoin()
	{
		
		
		if( document.form1.IdFunc.value == '' ||  document.form1.IdSeg.value == '')
			{

					if( document.form1.IdFunc.value == "" )
						{
						alert("Campo ausente.\rFavor informar o Id do Funcionário.");
						document.form1.IdFunc.focus();				
						return(false);
						}
					if( document.form1.IdSeg.value == "" )
						{
						alert("Campo ausente.\rFavor informar o Id da Seguradora.");
						document.form1.IdSeg.focus();				
						return(false);
						}						

					if(isInteger(document.form1.IdSeg.value) && isInteger(document.form1.IdFunc.value) )
					{
						//alert("passou");
					}
					else
					{
						alert("Favor informar os numero dos Id's, \rcomposto apenas por numeros.");
						document.form1.IdFunc.focus();				
						return(false);
					}
			}		
		
		
		document.form1.action = "X_Ad_Acao.asp?acao=JOIN";
		document.form1.SubAcaoJoin.value = "JoinFuncSegu";
		
		Exec_AbrirFormPopUp(form1,475,170);
		form1.submit();

	}		
	
		function ValidarRelSegExcluirJoin()
	{
		
		
					//if( document.form1.IDJOIN.value == "" )
						//{
						//alert("Campo ausente.\rFavor informar o Id do Funcionário.");
						//document.form1.IdFunc.focus();				
						//return(false);
						//}
		
		document.form1.action = "X_Ad_Acao.asp?acao=JOIN";
		document.form1.SubAcaoJoin.value = "ExcluirJoinFuncSegu";
		
		Exec_AbrirFormPopUp(form1,475,170);
		form1.submit();

	}		
	
	
	function ValidarRelPreparacao()
	{
		
		
			 for (i=0;i<document.formPrep.Prep_Referencia_Radio.length;i++){ 
		
					if( document.formPrep.Prep_Referencia_Radio[i].value == "old" )
						{
							if( document.formPrep.Prep_Referencia_Radio[i].checked)
							{	
							document.formPrep.action = 'X_Ad_RelacaoCliente_Preparacao.asp';
								if( document.formPrep.Prep_Referencia.value == "" )
								{
									alert("Campo ausente.\rFavor informar a referência.");
									document.formPrep.Prep_Referencia.focus();				
									return(false);
								}
								else
								{
									document.formPrep.Prep_Referencia_nova.value = "";
									//alert("aasdasd");
								}
								
							}
						}
			
			
					if( document.formPrep.Prep_Referencia_Radio[i].value == "nova" )
						{
							if( document.formPrep.Prep_Referencia_Radio[i].checked)
							{	
							document.formPrep.action = "X_Ad_RelacaoCliente_Referencia_Preparacao.asp";
								if( document.formPrep.Prep_Referencia_nova.value == "" )
									{
										alert("Campo ausente.\rFavor informar a referência nova.");
										document.formPrep.Prep_Referencia_nova.focus();				
										return(false);
									}
									else
									{
										document.formPrep.Prep_Referencia.value = "";
										
									}
							}
						}
						
			 }

		// Exec_AbrirFormPopUp(formPrep,600,370);
		formPrep.submit();

	}		
	
	function ValidarRelPreparacao_Excel(caminho)
	{

			if (confirm('Esta solicitação vai alterar o status da referência.\rDeseja continuar?'))
			{
				if(document.formPrep.Prep_Referencia.value == "")
				{
					alert("Campo ausente.\rFavor informar a referência.");
					document.formPrep.Prep_Referencia.focus();				
					return(false);
				}	
			}
			else
			{	
				return(false);
			}
				
		formPrep.target = '';
		document.formPrep.action = caminho;
		
		formPrep.submit();

	}			
	
	
	
	
	
	
	
	
	
	
	
	function EnviarFormExcel(caminho,acao)
	{
				
			if(acao == "EXCEL")
			{			
				if(document.form1.RelacaoEmpresa.value == "")
				{
					alert("Campo ausente.\rFavor informar a empresa.");
					document.form1.RelacaoEmpresa.focus();				
					return(false);
				}		
				
				if(document.form1.RelacaoTipodeRelacao.value == "")
				{
					alert("Campo ausente.\rFavor informar a empresa.");
					document.form1.RelacaoEmpresa.focus();				
					return(false);
				}		
				
				form1.target = '_blank';
				form1.target = '';
			}
			else
			{
				form1.target = '';
			}
			
			
		document.form1.action = caminho;
		
		
		form1.submit();

	}			
	
//---------------- Atualizar Rel Seguradora Cancelados
	function ValidarRelSegAtuCancelados()
	{
		
		Exec_AbrirFormPopUp(form1,475,170);
		form1.submit();

	}		
	
	
// ----- 	
	
function RedirectLink(zona) {

	if (zona == "ZONANORTE" ) { location.href="RDinamica.asp?Id=36&IdInformacao=100"; }
	if (zona == "CENTRO" ) { location.href="RDinamica.asp?Id=39&IdInformacao=101";}
	if (zona == "ZONASUL" ) { location.href="RDinamica.asp?Id=35&IdInformacao=102";}
	if (zona == "ZONAOESTEBARRA" ) { location.href="RDinamica.asp?Id=38&IdInformacao=104";}
	if (zona == "ZONAOESTE" ) { location.href="RDinamica.asp?Id=37&IdInformacao=103";}
 
}