function findObject(objectId) { if(window.document.getElementById && window.document.getElementById(objectId)) return window.document.getElementById(objectId); else if (window.document.all && window.document.all(objectId)) return window.document.all(objectId); else if (window.document.layers && window.document.layers[objectId]) return window.document.layers[objectId]; else return null; } function getWindowHeight() { var windowHeight = 0; if (typeof(window.innerHeight) == 'number') windowHeight = window.innerHeight; else { if (document.documentElement && document.documentElement.clientHeight) windowHeight = document.documentElement.clientHeight; else { if (document.body && document.body.clientHeight) windowHeight = document.body.clientHeight; } } return windowHeight; } function getFormData(formName) { var _form = null; var _responseBody = ''; var _elm = null; if (typeof(findObject)=='function') { _form = findObject(formName); } else { alert('Form object ' + formName + ' could not be found'); } if (_form == null) return null; for(i=0;i<_form.elements.length;i++) { _elm = _form.elements[i]; switch(_elm.type) { case 'submit' : break; case 'checkbox' : case 'radio' : { if(_elm.checked == true) _responseBody += '&'+ encodeURIComponent(_elm.name)+'='+encodeURIComponent(_elm.value); break; } default : { _responseBody += '&'+ encodeURIComponent(_elm.name)+'='+encodeURIComponent(_elm.value); break; } } } return _responseBody; } function submitForm(formname) { try { var obj = findObject(formname); if (obj != null) obj.submit(); } catch(e) {} return false; }