////////////////////////////////////////////////////////////////////////////////
//   generic function to get reference to object by id                        //
////////////////////////////////////////////////////////////////////////////////
<!--
function getObject(id) {
	if (document.all){return(document.all(id))}
	if (document.getElementById){return(document.getElementById(id))}
	}


////////////////////////////////////////////////////////////////////////////////
//   Selector de Sector                                                       //
////////////////////////////////////////////////////////////////////////////////
function SelectSector(strValue) {
    if ( strValue != "" ) {
            location.href = "casestudies.aspx?ids=" + strValue + "&id=" + strValue;
    } else {
            location.href = "casestudies.aspx?idcod=CASSTU";
    }
}

////////////////////////////////////////////////////////////////////////////////
//   Selector de Filtros                                                      //
////////////////////////////////////////////////////////////////////////////////
function SelectVerResultados(strMsg)
    {
    if ( getObject("selectSector").value != 0 || getObject("selectPratica").value != 0 )
        {
        
        if ( getObject("selectPratica").value > 0 ){
            location.href = "casestudies.aspx?ids=" + getObject("selectSector").value + "&idp=" + getObject("selectPratica").value + "&id=" + getObject("selectPratica").value;            
        } else {
            location.href = "casestudies.aspx?ids=" + getObject("selectSector").value + "&id=" + getObject("selectSector").value; 
        }

        } else {
        alert(strMsg);
        }    
    }


////////////////////////////////////////////////////////////////////////////////
//   Pesquisa                                                                 //
////////////////////////////////////////////////////////////////////////////////          
function SearchEngine(){
   
    var strSearchTerm = getObject("inputSearch").value;
    var MsgTxt = "Por favor, preencha o campo de Pesquisa.";
 
    if ( strSearchTerm != "" && strSearchTerm == "Pesquisar                   ." )
        {
            alert(MsgTxt);
        }
    else
        {
            location.href = "search.aspx?Term=" + strSearchTerm;
        }
  }

////////////////////////////////////////////////////////////////////////////////
//   Mensagem de Página em Construção                                         //
////////////////////////////////////////////////////////////////////////////////
function Construcao() {
    alert("P\u00e1gina em constru\u00e7\u00e3o.");
    }

////////////////////////////////////////////////////////////////////////////////
//   Formulário com o Botão de Enter Activo                                   //
////////////////////////////////////////////////////////////////////////////////
var button;
function KeyDownHandler(){
    // process only the Enter key
    if (event.keyCode == 13){
        if (button){
			// cancel the default submit
			event.returnValue=false;
			event.cancel = true;
			// submit the form by programmatically clicking the specified button
			button.click();
        }else{
			// cancel the default submit
			event.returnValue=false;
			event.cancel = true;
        }
    }
}
function setButton(id){
	button = document.getElementById(id)
}

//-->