function redirect(action) { document.location.href = action; } function openSearchPopup(url, name, param, id, nameId, jsFunction) { window.open(url + "?jsFunction=" + jsFunction + "&id=" + id + "&nameId=" + nameId, name, param); } /* Método para forçar um submit no formulário informado */ function formSubmit(action, formId) { var form = document.getElementById(formId); form.action = action; form.submit(); } /* * This function verify if a string fieldValue is null or is empty. * * @author diego.martins */ function verifyNullAndEmptyString( fieldValue ) { if ( fieldValue == null ) { return true; } if ( fieldValue == "" ) { return true; } return false; } function getDownload(idtItemTabArq, action) { popupCenterWindow(action + "?idtItem=" + idtItemTabArq, "PortalRH_file", 100, 100, "no"); } function getUpload(idtItem, action, objectType) { popupCenterWindow(action + "?idtItem=" + idtItem + "&objectType=" + objectType, "PortalRH_file", 400, 200, "yes"); } function popupCenterWindow(url, nomUrl, wdt, hgt, scroll) { if (document.all) { var xMax = screen.width, yMax = screen.height; } else { if (document.layers) { var xMax = window.outerWidth, yMax = window.outerHeight; } else { var xMax = 800, yMax = 500; } } var xOffset = (xMax - 800) / 2, yOffset = (yMax - 500) / 2; window.open(url, nomUrl, "width=" + wdt + ",height=" + hgt + ",screenX=" + xOffset + ",screenY=" + yOffset + ",top=" + yOffset + ",left=" + xOffset + ",scrollbars=" + scroll); } function openPopupImageCenter(url, associatedId, width, height) { if (document.all) { var xMax = screen.width, yMax = screen.height; } else { if (document.layers) { var xMax = window.outerWidth, yMax = window.outerHeight; } else { var xMax = width, yMax = height; } } var winl = (xMax - width) / 2; var wint = (yMax - height) / 2; winprops = "height=" + height + ",width=" + width + ",top=" + wint + ",left=" + winl + ",resizable=0,scrollbars=true"; window.open(url + "?associatedId=" + associatedId, "PortalRH_ViewImage", winprops); } function popupPrintView(mylink, windowname) { var href; if (typeof (mylink) == "string") { href = mylink; } else { href = mylink.href; } window.open(href, windowname, "status=no,width=650,height=600,scrollbars=yes"); }