///////////////////////////////////////////////////////////////
//////////// FUNCTION QUE TROCA DE REGIONAL COM DADOS DA COMBO
function TrocaReg(Regional)
{	
	if(parseInt(Regional) == 0)
	{	
		alert('Escolha a regional !')
		document.frmDefault.lstArea.focus();
		return false; 
	}
	else
	{
		document.frmDefault.action = "../start/default.asp?D=" + Regional;
		document.frmDefault.submit();   
	}
}
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////
//////////// FUNCTIONS QUE TROCAM AS CORES DO MENU ////////////
function mOvr(src,clrOver)
{
	if (!src.contains(event.fromElement)) 
	{
		src.style.cursor = 'hand';
		src.bgColor = clrOver;
	}
}

function mOut(src,clrIn) 
{
	if (!src.contains(event.toElement)) 
	{
		src.style.cursor = 'default';
		src.bgColor = clrIn;
	}
}
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////
//////////// FUNCTION QUE SUBMETE DADOS PARA BUSCA ////////////
function GoSearch(Dominio)
{
	if(Trim(document.getElementById("txtBuscaConteudo").value)=='')
	{
		alert('Preencha o campo para pesquisar !')
		document.getElementById("txtBuscaConteudo").focus();
		return;
	}
	document.getElementById("frmDefault").action="/frmResultBusca.asp?D=" + Dominio;
	document.getElementById("frmDefault").submit();
}

function Trim(str)
{
	strRetorno = new String;

	for (Conta = 0 ; Conta <= str.length - 1; Conta++){
		if (str.charAt(Conta) != " "){
			strRetorno = str.substr( Conta ,  str.length );
			Conta = str.length;
	    } 
	    else{
			if (Conta != str.length - 1 ){
				strRetorno = str.substr( Conta , Conta  );
            }
            else{
				strRetorno = ""; 
	        } 
	    } 
	}
	str = strRetorno ;
	for (Conta = str.length - 1 ; Conta >= 0  ; Conta --){
		if (str.charAt(Conta) != " "){
			strRetorno = str.substr( 0 , Conta + 1 );
			Conta = -1;
	     }
	     else{
			strRetorno = str.substr( 0 , Conta - 1 );
	     }   
	}
	return (strRetorno);
}
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////
////////////////////PADRÃO DE SITES GOVERNAMENTAIS ////////////
function nova_jan(newwindow)
{
  var desktop = window.open(newwindow,'new_window','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes');
}
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////
////////////////////FUNÇÃO PARA MOSTRAR POP-UP ////////////////
function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////
///////////////FUNÇÃO PARA MOSTRAR POP-UP JANELA //////////////
function ShowPopUp()
{
	
	//var strWindowsProperties = "height=450,width=590,location=no,scrollbars=yes,menubar=no,toolbar=yes,resizable=yes";
	//var strPageToPage = "popup.asp";
	//window.open(strPageToPage,"PopUp",strWindowsProperties); 
	alert('a')
}

function popupPage() {
	
	
	//window.open("popup.asp", "Vídeos", "width=320, height=300, toolbar=no, menubar=no, location=no, directories=no")
	//window.open( "popup3.asp", "Concurso", "width=290, height=180, resizeable=no")
	
	var page = "popup.htm";
	windowprops = "height=179,width=240,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no";
	window.open(page, "Popup", windowprops);
}

///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////