// JavaScript Document function in_array(aArray,sString){ for(var i=0;i '+sString; oDiv.scrollTop = oDiv.scrollHeight; } function getOffset(obj,which) { // Calculate and return the top and left position of an element relative to window. var amount = obj["offset"+which]; if (which=="height") amount+=obj.offsetHeight; obj = obj.offsetParent; while (obj!=null) { amount+=obj["offset"+which]; obj = obj.offsetParent; } return amount; } function setActive(oElem,bActive) { //Enables or disables one single input or select field oElem.disabled = (bActive) ? false : true; } function SelectMAXID(oSelect){ // Selects the option in a Select with the highest ID var iMaxID=0; var iSelected=0; for(var i=0;i iMaxID){ iSelected = i; iMaxID = oSelect.options[i].value; } } oSelect.selectedIndex = iSelected; oSelect.onchange(); } function findParentElem(oObj,sElement, sID){ //Returns the first parent that has the correct ID, or false if there is none while ( ((sID) ? (sID != oObj.id) : (oObj.nodeName != sElement) ) && (oObj.parentNode) ) oObj = oObj.parentNode; return ((oObj.nodeName == sElement) ? oObj : false); } function checkInput(oObj,sCheck){ //Checks if the input fields have valid data. Returns true or false if (sCheck) var sVal = oObj.value; if (sVal){ switch(sCheck){ case 'dd': return (((sVal<=31) && (sVal>0)) ? true : false); break; case 'mm': return (((sVal<=12) && (sVal>0)) ? true : false); break; case 'yyyy': return (((sVal>=1900) && (sVal<=2030)) ? true : false); break; case 'n': for(var i=0;i 0) oObj.value = "0"+oObj.value; if ((oObj.title.substr(0,5) == 'check') && (oObj.title.substr(5,1)==':')) if (!checkInput(oObj,oObj.title.substr(6))){ addClass(oObj,'inputerror'); return false; } else{ removeClass(oObj,'inputerror'); return true; } } } function isLetter(c){ //Returns true if the input is a letter, and false if it isn't return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) ); } function clearAll(oObj,aElem){ //Clears all the elements that lie beneath the input. Returns nothing for(var i=0;i= parseInt(oCompare.sTo)) : (parseInt(oCompare.sFrom) > parseInt(oCompare.sTo))) return true; else return false; } function findChild(oObj,sElem,oCheck,bMulti){ //Returns the child or children of the object that have the specified attributes, or null if there is none var result = null; var aresults = []; aChilds = oObj.getElementsByTagName(sElem); for (var i=0;i-1){ var aClass = oObj.className.split(' '); for(var i=0;i-1){ var aClass = oObj.className.split(' '); for(var i=0;i