var positionFooter = function() { var footer = $('footer'); var content = $('content'); var innerDivs = content.getElementsBySelector('div'); var max = 0; var lastHidden = null; innerDivs.each(function(o) { if (o.visible() && o.getStyle('display') != 'none') { var overflow = o.getStyle('overflow'); if (overflow == 'hidden') { lastHidden = o; } else { if (lastHidden != null && o.descendantOf(lastHidden)) { // Skip this div, since it's inside of an overflow: hidden one return; } } var height = Try.these( function() { return parseInt(document.defaultView.getComputedStyle(o, null).getPropertyValue('height', null)) }, function() { return o.getHeight() } ); var thisMax = Position.cumulativeOffset(o)[1] + height; if (thisMax > max) { max = thisMax; } } }); max += 30; footer.setStyle({'top': max + 'px'}); footer.show(); }; function Anthem_PostCallBack(o) { positionFooter(); } function Anthem_Error(result) { window.location = "http://www.lhw.com/groups/error.aspx?anthem=" + result.error; } Event.observe(window, 'load', positionFooter); function defaultIfEmpty(control, defaultText) { if (control.value == '' || trim(control.value) == '') control.value = defaultText; } function enterKey(event, controlID, methodName){ if(event.which || event.keyCode) { if ((event.which == 13) || (event.keyCode == 13)) { Anthem_InvokeControlMethod(controlID, methodName, [], null); return false; } } return true; } function enterKeyPostback(event, btn) { if(event.which || event.keyCode) { if ((event.which == 13) || (event.keyCode == 13)) { __doPostBack(btn,''); return false; } } return true; } function hideShow(toHide, toShow) { if (toHide != null) { for (var i = 0; i < toHide.length; i++) { $(toHide[i]).hide(); } } if (toShow != undefined) { for (var i = 0; i < toShow.length; i++) { $(toShow[i]).show(); } } } function textboxEnterKey(event, btn){ if(event.which || event.keyCode) { if ((event.which == 13) || (event.keyCode == 13)) { var button = $(btn); if (button.dispatchEvent) { var e = document.createEvent("MouseEvents"); e.initEvent("click", true, true); button.dispatchEvent(e); } else { button.click(); } return false; } } return true; } function OpenDimenxionPopUp(url) { window.open(url,"DimenxionPopUp", "width=790,height=595,toolbar=no,directories=no,location=no,menubar=no,resizable=yes,status=no"); return false; } function fillRelatedListBox(parentList, relatedList, relationHash, hidField) { var pList = $(parentList); var rList = $(relatedList); for (var j = rList.options.length - 1; j >= 0 ; j--) { rList.remove(j); } for (var i = 0; i < pList.options.length; i++) { var optionParentSelected = pList.options[i]; var hotelHash = relationHash.get(optionParentSelected.value); if (optionParentSelected.selected) { for (var j = 0; j < hotelHash.keys().size(); j++) { var key = hotelHash.keys()[j]; AddOptionToSelect(rList, key, hotelHash.get(key)); } } } persistOptionsList(rList, hidField); } function AddOptionToSelect(selectControl, value, text) { var hotelOption = document.createElement('option'); hotelOption.text = text; hotelOption.value = value; try { selectControl.add(hotelOption, null); } catch(ex) { selectControl.add(hotelOption); } } function persistOptionsList(rList, hidField) { var optionsList = ''; for (var i=0; i< rList.options.length; i++) { var optionText = rList.options[i].text; var optionValue = rList.options[i].value; var optionSelected = rList.options[i].selected; if ( optionsList.length > 0 ) optionsList += ';'; optionsList += optionText + ':' + optionValue + ':' + optionSelected; } $(hidField).value = optionsList; }