function getToolTip(action,boName,jsp,objID,displayText){ if(action!='' && boName!='' && objID!=''){ if (window.XMLHttpRequest) { ajaxReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { ajaxReq = new ActiveXObject("Microsoft.XMLHTTP"); } ajaxReq.open("POST", "servlet/ServletDispatcher", true); ajaxReq.onreadystatechange = function (){ if (ajaxReq.readyState == 4) { if (ajaxReq.status == 200) { //alert(ajaxReq.responseText); t1 = [displayText,ajaxReq.responseText]; t2 = ["black","#003366","","","",,"black","#D6E4F1","","","",,260,,2,"#003366",2,,,,,"",,,,]; stm(t1,t2); } } }; ajaxReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajaxReq.send("CALL=GETLOOKUPINFO&action="+action+"&business_object_name="+boName+"&BO_PARAMETER_NAME="+boName+"&object_id="+objID+"&redirect_url=../lookUpInfo.jsp?editable=false&BO_PARAMETER_NAME="+boName); } } function refreshPage(name){ try{ onLoadRefresh(); }catch(e){ // Exception handled to avoid error on the ListGrid , // since the onLoadRefresh function was in the FormGrid page. } } function checkSpecialChars(element){ var iChars = "!@#$%^&*+=[]\\\';,./{}|\":<>?"; var str = element.value; for (var i = 0; i < str.length; i++) { if (iChars.indexOf(str.charAt(i)) != -1) { alert ("Special characters are not allowed."); element.value=''; element.focus(); return false; } } return true; } function beforeEvent(eventType){ if(eventType=='create' && document.forms['form'].elements['business_object_name'].value=='applynow_bo'){ if(confirm("Are you sure that you want to apply for this job?")){ return "true"; }else{ return "false"; } } } function newWindow(url, name, w, h) { window.open(url, name, "width=" + w + ",height=" + h + ",status=yes,scrollbars=yes,toolbar=no,location=no"); } function newPDFWindow(mypage,myname,w,h){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; var settings ="height="+h+","; settings +="width="+w+","; settings +="top="+wint+","; settings +="left="+winl+","; settings +="z-lock=yes, alwaysRaised=yes, toolbar=no,location=no, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no"; window.open(mypage,myname,settings); } function getTabLinkHTML(link){ var linkLength = link.length; var orgLinkStartPosition = link.indexOf('?'); var actualLength = linkLength - orgLinkStartPosition; var orgLink = link.substr(orgLinkStartPosition+1,actualLength); if (window.XMLHttpRequest) { ajaxReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { ajaxReq = new ActiveXObject("Microsoft.XMLHTTP"); } ajaxReq.open("POST", "servlet/ServletDispatcher", true); ajaxReq.onreadystatechange = function (){if (ajaxReq.readyState == 4) { if (ajaxReq.status == 200) { var dot = document.getElementById('GridFormContainer'); dot.innerHTML = ajaxReq.responseText; } } }; ajaxReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajaxReq.send(orgLink); } function getTabLinkHTML(link){ var linkLength = link.length; var orgLinkStartPosition = link.indexOf('?'); var actualLength = linkLength - orgLinkStartPosition; var orgLink = link.substr(orgLinkStartPosition+1,actualLength); if (window.XMLHttpRequest) { ajaxReq = new XMLHttpRequest(); } else if (window.ActiveXObject) { ajaxReq = new ActiveXObject("Microsoft.XMLHTTP"); } ajaxReq.open("POST", "servlet/ServletDispatcher", true); ajaxReq.onreadystatechange = function (){if (ajaxReq.readyState == 4) { if (ajaxReq.status == 200) { var dot = document.getElementById('GridFormContainer'); dot.innerHTML = ajaxReq.responseText; } } }; ajaxReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajaxReq.send(orgLink); } function showHideLayers(name, vis) { //v6.0 obj=findObj(name); obj.style.visibility = vis; } // updateSelect(this.form, 'MATERIAL', 'ID_COLOR', 'COLOR') function updateSelect(form, parent, child, array){ var idParent = form.elements[parent].selectedIndex; idParent = form.elements[parent].options[idParent].value; var arrayName = array + '_' + idParent; var childOptions; if(idParent > 0){ var size = form.elements[child].length; var j=0; if (typeof eval("window." + arrayName) != 'undefined') { childOptions = eval(arrayName); } else { childOptions = new Array(); } for(var i = 0; i <= childOptions.length; i++){ if(i==0){ form.elements[child][j] = new Option('Select one',0, false, false); j++; } if (!(typeof childOptions[i] == 'undefined')) { form.elements[child][j] = new Option(childOptions[i][1], childOptions[i][0], false, false); j++; } } for (var foo = size-1; foo >= j; foo--){ form.elements[child].remove(foo); } } } function validate_field(form, validate,validated){ if(form.elements[validate]) { // if(!(typeof form.elements[validate] == 'undefined')){ if(form.elements[validate].value==''){ alert('no_material'); form.elements[validated].value=''; } } } function clearSelect(form, selectName){ form.elements[selectName].options[0].selected = true; } function newWindow(url, name, w, h) { window.open(url, name, "width=" + w + ",height=" + h + ",status=yes,scrollbars=yes,toolbar=no,location=no"); } // Check for indicated values on Input Fields (Only Numbers) function checkNumeric(objName){ var numberfield = objName; var value = objName.value; objName.value = ''; if (chkNumericValue(value) == false){ numberfield.focus(); return false; }else{ numberfield.value = value; return true; } }//checkNumeric(objName) function chkNumeric(objName){ return chkNumericValue(objName.value); } function chkNumericValue(objValue){ var checkOK = "0123456789.,-"; //Valores permitidos // var checkStr = objName; var allValid = true; var decPoints = 0; var noPoint = true; // for(i = 0; i < checkStr.value.length;i++){ // ch = checkStr.value.charAt(i); for(i = 0; i < objValue.length;i++){ ch = objValue.charAt(i); for(j = 0; j < checkOK.length; j++) if(ch == checkOK.charAt(j)){ if((ch == "," || ch == ".") && noPoint == true){ noPoint = false; break; } else if(ch != "," && ch != ".") break; } if(j == checkOK.length){ allValid = false; break; }//if }//for if (!allValid){ alertsay = "only_numeric"; alert(alertsay); // checkStr.value = ""; return (false); }//if }//chkNumericValue(objName) ///////////////////////////////////// // Check for indicated values on Input Fields (Alphanumerics) function checkAlphaNumeric(objName){ var numberfield = objName; if (chkAlphaNumeric(objName) == false){ numberfield.select(); numberfield.focus(); return false; }else{ return true; } }//checkAlphaNumeric(objName) function chkAlphaNumeric(objName){ var checkOK = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ0123456789-_ "; //Valores permitidos var checkStr = objName; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.value.length; i++){ ch = checkStr.value.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ allValid = false; break; }//if if (ch != ",") allNum += ch; }//for if (!allValid){ alertsay = "The_values: \"*',;:/\|<>~+()=@&%$#{}[]^} not_allowed" alert(alertsay); return (false); }//if }//chkAlphaNumeric(objName) // Check for indicated values on Input Fields (Only Letters) function checkAlpha(objName){ var numberfield = objName; if (chkAlpha(objName) == false){ numberfield.select(); numberfield.focus(); return false; }else{ return true; } }//checkAlpha(objName) function chkAlpha(objName){ var checkOK = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ-_. "; //Valores permitidos var checkStr = objName; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.value.length; i++){ ch = checkStr.value.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ allValid = false; break; }//if if (ch != ",") allNum += ch; }//for if (!allValid){ alertsay = "The_values: \"*',;:/\|<>~+()=@&%$#{}[]^} not_allowed" alert(alertsay); return (false); }//if }//chkAlpha(objName) function toTrim(objName){ var checkStr = objName; var newString = new Array(); for (i = 0; i < checkStr.value.length; i++){ ch = checkStr.value.charAt(i); if(ch != ''){ newString = checkStr.value.substring(i,checkStr.value.length); break; } } for(f = newString.length - 1;f > 0;f++){ ch = newString.charAt(f); if(ch != ''){ newString = newString.substring(0,f); break; } } objName.value = newString; }//toTrim(objName) function confirmEventGrid(eventType, event,message,formName,refreshList) { if(confirm('confirma' + message)){ document.forms[formName].elements['event'].value=eventType; document.forms[formName].submit(); } } function confirmEventAndClose(eventType, event,message,formName,refreshList) { if(confirm('confirma' + message)){ document.form.elements['event'].value=eventType; document.form.submit(); if (window.opener){ window.opener.location.reload(); } self.close(); } } function confirmEvent(eventType, event, message) { var wasOk = true; //This is used to validate that the required field were fulfilled var SELECT_ONE_TYPE = "select-one"; var TEXT_TYPE = "text"; var PASSWORD_TYPE = "password"; var TEXTAREA_TYPE = "textarea"; var HIDDEN_TYPE = "hidden"; var hasParameters = false; if (confirmEvent.arguments.length == 5 && eventType != "close" && eventType != "saveNoClose" && eventType!="route") { FieldName = confirmEvent.arguments[3]; FieldTitle = confirmEvent.arguments[4]; if(FieldName != null && FieldTitle != null) { if(FieldName.indexOf(",")!=-1 || FieldName.length > 0) { hasParameters = true; } if(hasParameters) { var FieldsArray = FieldName.split(","); var TitleArray = FieldTitle.split(","); alertsay = 'Following fields are required:' + " \n\n"; var wasEmpty; var elementType; var wasOneSelected; if(FieldsArray.length == null){ var arrayFields = new Array(); arrayFields[0] = FieldsArray; FieldsArray = arrayFields; } for(field = 0; field < FieldsArray.length; field++) { wasEmpty = false; elementType = document.form.elements[FieldsArray[field]].type; wasOneSelected = false; if(elementType == undefined) { var radioOptions = document.form.elements[FieldsArray[field]]; for(options = 0; options < radioOptions.length; options++) { if(radioOptions[options].checked == true) { wasOneSelected = true; } } } if(document.form.elements[FieldsArray[field]].value == undefined && !wasOneSelected) { wasEmpty = true; } else if(((elementType == TEXT_TYPE || elementType == PASSWORD_TYPE || elementType == TEXTAREA_TYPE || elementType == HIDDEN_TYPE) && document.form.elements[FieldsArray[field]].value.length == 0) || (elementType == SELECT_ONE_TYPE && (document.form.elements[FieldsArray[field]].selectedIndex == 0 || document.form.elements[FieldsArray[field]].value == ""))) { wasEmpty = true; } else if((elementType == TEXT_TYPE || elementType == TEXTAREA_TYPE) && document.form.elements[FieldsArray[field]].value.length > 0){ var blanks = true; var i=0; if(document.form.elements[FieldsArray[field]].value.length > 0){ for(i=0; i < document.form.elements[FieldsArray[field]].value.length; i++){ if(document.form.elements[FieldsArray[field]].value.charAt(i) != ' '){ blanks = false; } } } wasEmpty = blanks; } if(wasEmpty) { if(!wasOk) { alertsay = alertsay + "\n\t-- " + TitleArray[field]; } else { alertsay = alertsay + "\t-- " + TitleArray[field]; } wasOk = false; } } alertsay = alertsay + "\n\n" + 'Please provide a value in order to complete your registration'; if(!wasOk) { alert(alertsay); } } } } if(wasOk) { //if(confirm('confirma' + message)){ var flag='true'; if(flag=='true'){ document.form.elements['event'].value=eventType; if(document.form.elements['WASAJAX']==undefined) { if(eventType == 'saveNoClose') { document.form.elements['redirect_url'].value=location.href+ '&BO_PARAMETER_NAME=' + document.form.elements['BO_PARAMETER_NAME'].value; } document.form.submit(); } else { if(eventType!='save') { document.form.submit(); } else performAjaxEvent(); } if(eventType=='route' || eventType=='Activate'){ if(window.opener){ window.opener.location.reload(); self.close(); } } } //} } if(event=='Close' || event=='Guardar'){ if (window.opener){ window.opener.location.reload(); self.close(); } }else{ if (window.opener){ window.opener.location.reload(); } } } function encodeURIString(varData) { if(varData.indexOf("&")>-1) { var returnWhere = ""; var whereString = new Array(); whereString = varData.split("&"); for(var i=0;i < whereString.length;i++){ if(i==0) returnWhere = whereString[i]; else returnWhere = returnWhere + "%26" + whereString[i]; } return returnWhere; }else return varData; } function performAjaxEvent() { var submitString = ""; var displayString = ""; var ajaxReq; for (e=0;e0&&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 size - 1) { field.blur(); } }