function focus(formName, fieldName) {
  document.forms[formName].fields[fieldName].focus();
}
function not_logged() {
	alert("Usuário deve logar-se para acessar\n esta funcionalidade");
}
/**
 * Displays an confirmation box beforme to submit a "DROP/DELETE/ALTER" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the sql query to submit
 *
 * @return  boolean  whether to run the query or not
 */
confirmMsg = "Realmente deseja apagar ";
function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function
function centerScreen(xImageSize) {
    if (document.all) { // IE
        var xMax = screen.width;
    } else { // Netscape
        var xMax = window.outerWidth;
    }
    //alert (xMax);
    if (xMax > 810) {
      return xOffset = Math.floor((xMax - xImageSize)/2);
    } else return 1;
}
function show(){
		document.getElementById('aviso').style.visibility='visible';
		document.getElementById('closeMsgBox').focus();
}
function hide(){
		document.getElementById('aviso').style.visibility='hidden';
}
