var erroneousFields = new Array();

function addErrorInputField(aValue) {
    erroneousFields[erroneousFields.length] = aValue;
}

function changeColorErrorInputField() {
    for (var i = 0; i < erroneousFields.length; i++) {
        for (var j = 0; j < window.document.getElementsByName(erroneousFields[i]).length; j++) {
            window.document.getElementsByName(erroneousFields[i])[j].style.backgroundColor = '#FFCC00';
        }

    }
}

function PrintThisPage(divName, contextPath, width, height) {
    var sOption = "toolbar=no,location=no,directories=no,menubar=no,";
    sOption += "scrollbars=no,width=" + width + ",height=" + height + ",left=100,top=25";

    var sWinHTML = document.getElementById(divName).innerHTML;

    var winprint = window.open("", "", sOption);
    winprint.document.open();
    winprint.document.write('<html>');
    winprint.document.write('<LINK href=<s:url value="/assets/styles/vop.css" includeParams="false"/> rel=Stylesheet>');
    winprint.document.write('<body onload=window.print()>');
    winprint.document.write(sWinHTML);
    winprint.document.write('</body></html>');
    winprint.document.close();
    winprint.focus();
}

function popup(URL, width, height) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=" + width + "px,height=" + height + "px');");
}

function ismaxlength(obj, mlength) {
    if (obj.getAttribute && obj.value.length > mlength)
        obj.value = obj.value.substring(0, mlength)
}