function StringBuilder(value) { this.strings = new Array(""); this.append(value); } StringBuilder.prototype.append = function (value) { if (value) { this.strings.push(value); } } StringBuilder.prototype.clear = function () { this.strings.length = 1; } StringBuilder.prototype.toString = function () { return this.strings.join(""); } 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)) { 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/CustomerService.aspx?anthem=" + result.error; } Event.observe(window, 'load', positionFooter); function divVisibility () { var div1 = document.getElementById("showText"); div1.style.display ="none"; var div2 = document.getElementById("emptyText"); div2.style.display = "inline"; var txt =document.getElementById("email"); txt.focus(); } var strUptickEmail = "Email address seems incorrect (check @ and .\\'s)"; var strUptickUsername = "The username doesn\\'t seem to be valid."; var strUptickIP = "Destination IP address is invalid!"; var strUptickDomain = "The domain name doesn\\'t seem to be valid."; var strUptickAddress = "The address must end in a three-letter domain, or two letter country."; var strUptickHostname = "This address is missing a hostname!"; var strThankYou = "Thank you for signing up!"; function emailCheck (emailStr) { var emailPat=/^(.+)@(.+)$/; var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"; var validChars="\[^\\s" + specialChars + "\]"; var quotedUser="(\"[^\"]*\")"; var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/; var atom=validChars + '+'; var word="(" + atom + "|" + quotedUser + ")"; var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); var matchArray=emailStr.match(emailPat); if (matchArray==null) { alert(strUptickEmail); return false; } var user=matchArray[1]; var domain=matchArray[2]; if (user.match(userPat)==null) { alert(strUptickUsername); return false; } var IPArray=domain.match(ipDomainPat); if (IPArray!=null) { for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert(strUptickIP); return false; } } return true; } var domainArray=domain.match(domainPat); if (domainArray==null) { alert(strUptickDomain); return false; } var atomPat=new RegExp(atom,"g"); var domArr=domain.match(atomPat); var len=domArr.length; if ((domArr[domArr.length-1] != "info") && (domArr[domArr.length-1] != "name") && (domArr[domArr.length-1] != "arpa") && (domArr[domArr.length-1] != "coop") && (domArr[domArr.length-1] != "aero")) { if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { alert(strUptickAddress); return false; } } if (len<2) { alert(strUptickHostname); return false; } return true; } function UPTvalidateform(document){ if (emailCheck(document.getElementById('email').value)){ window.alert(strThankYou); document.forms['UPTml15643'].email.value = document.forms['PageForm'].email.value; document.forms['UPTml15643'].submit(); return false; } else { return false; } } function trim(cadena) { for(i=0; i=0; i=cadena.length-1) { if(cadena.charAt(i)==" ") cadena=cadena.substring(0,i); else break; } return cadena; } function CheckEmptyUser(user) { if (user.value == '' || trim(user.value) == '') user.value = 'LC # or EMail'; } function defaultIfEmpty(control, defaultText) { if (control.value == '' || trim(control.value) == '') control.value = defaultText; } function CheckEmptyPass(pass) { if (pass.value == '' || trim(pass.value) == '') { var div1 = document.getElementById("showPassword"); div1.style.display = "inline"; var div2 = document.getElementById("encryptPassword"); div2.style.display = "none"; } } var flag = null; function showError() { var divError = $('showError'); if(flag == null) { flag = 1; var body = divError.up('body'); divError = divError.remove() body.appendChild(divError); } divError.setStyle({ left: $('LoginError').cumulativeOffset()['left'] - divError.getWidth() + 235 + 'px', top: '65px', display: 'block' }); } function DisplayDivRelocated(divToRelocated , paramParentDivS,leftDiv,topDiv) { var divRelocate = $(divToRelocated); var parentDivShorError = $(paramParentDivS); divRelocate = divRelocate.remove(); parentDivShorError.appendChild(divRelocate); divRelocate.style.display = 'block' ; divRelocate.style.top = topDiv+'px'; divRelocate.style.left = leftDiv+'px' ; } function hideError() { $('showError').hide(); } function divPassVisibility(pwdId) { var div1 = document.getElementById("showPassword"); div1.style.display = "none"; var div2 = document.getElementById("encryptPassword"); div2.style.display = "inline"; var txt = document.getElementById(pwdId); txt.focus(); } 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 txtEnterKeyClick(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 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 hideDiv(div) { $(div).update(''); $(div).hide(); } function hideAndToggleFocus(div, divFocus) { hideDiv(div); $(divFocus).focus(); } function ChangeLinkStyleOver(link) { link = $(link); link.removeClassName('lnkBCCommon'); link.addClassName('lnkBCOrangeUnderline'); } function ChangeLinkStyleOut(link) { link = $(link); link.removeClassName('lnkBCOrangeUnderline'); link.addClassName('lnkBCCommon'); } var parentIsReached = function(divToCalc,divToStop,divActual) { var isParent = true; var parent = divToCalc.up(); while (parent != divToStop) { if (parent == divActual) { return false; } parent = parent.up(); } return isParent; } var calculateOffsetToDiv = function(divToCalc, divToStop) { var divOffset = divToCalc.positionedOffset()[1]; var parent = divToCalc.getOffsetParent(); while (!parentIsReached(divToCalc,divToStop,parent)) { divOffset += parent.positionedOffset()[1]; parent = parent.getOffsetParent(); } return divOffset; } var calculateTotalDivHeight = function(divToCalc) { var content = divToCalc; var innerDivs = content.getElementsBySelector('div'); var max = Try.these( function() { return parseInt(document.defaultView.getComputedStyle(divToCalc, null).getPropertyValue('height', null)) }, function() { return divToCalc.getHeight() } ); 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)) { return; } } var height = Try.these( function() { return parseInt(document.defaultView.getComputedStyle(o, null).getPropertyValue('height', null)) }, function() { return o.getHeight() } ); var thisMax = calculateOffsetToDiv(o,content) + height; if (thisMax > max) { max = thisMax; } } }); return max; }; var rightBarPosition = function(rightbar) { var bar = $(rightbar); var bardivs = bar.childElements().grep(new Selector("div")); var firstBar = bardivs[0]; var topPod = firstBar.childElements()[0]; var header = topPod.childElements()[0]; var content = topPod.childElements()[1]; var totalHeightDiv = (calculateTotalDivHeight(content) + calculateTotalDivHeight(header)) + 'px' topPod.setStyle({height: totalHeightDiv}); var i=1; for (i=1;i<= bardivs.size()-1;i=i+1) { var pod = bardivs[i]; var uppod = bardivs[i-1]; var top = parseInt(uppod.style['top'].substring(0,uppod.style['top'].length - 2)) + calculateTotalDivHeight(uppod) - 1; pod.style['top'] = top + 'px'; } positionFooter(); }; var rightBarPositionAdjust = function(rightbar) { var bar = $(rightbar); var bardivs = bar.childElements().grep(new Selector("div")); var i=0; for (i=0;i< bardivs.size();i=i+1) { var barpods = bardivs[i].childElements().grep(new Selector("div")) var j=0; for (j=0;j< barpods.size();j=j+1) { var header = barpods[j].childElements()[0]; var content = barpods[j].childElements()[1]; var totalHeightDiv = (calculateTotalDivHeight(content) + calculateTotalDivHeight(header)) + 'px' barpods[j].setStyle({height: totalHeightDiv}); if (j > 0) { var pod = barpods[j]; var uppod = barpods[j-1]; var top = parseInt(uppod.style['top'].substring(0,uppod.style['top'].length - 2)) + calculateTotalDivHeight(uppod) - 1; pod.style['top'] = top + 'px'; } } if (i > 0) { var bar = bardivs[i]; var upbar = bardivs[i-1]; var top = parseInt(upbar.style['top'].substring(0,upbar.style['top'].length - 2)) + calculateTotalDivHeight(upbar) - 1; bar.style['top'] = top + 'px'; } } positionFooter(); }; function MouseOverRegion(map, continent, region, move, clientid){ $('divCountryList' + clientid).select("ul li").each(function(x) { x.removeClassName(map.highlightClassName); }, map); if (continent > 0) { if (map.regions.get(continent) != null && map.selectedRegion == 0) { $('divCountryList' + clientid).select("ul li").each(function(x) { if (x['IsRegion']) { if (x['RegionID'] == continent) { x.addClassName(map.highlightClassName); } else { x.removeClassName(map.highlightClassName); } } }, map); } } if (region > 0) { if (map.countriesByRegion.get(region) != null && map.regions.get(map.selectedRegion).get('parent') == 0) { $('divCountryList' + clientid).select("ul li").each(function(x) { if (!x['IsRegion']) { if (x['RegionID'] == region) { x.addClassName(map.highlightClassName); } else { x.removeClassName(map.highlightClassName); } } }, map); } } } function HideResults(clientid){ try{ var left = $('TextOfferInDivCloudLeft' + clientid); if (left != null) { left.hide(); } }catch(e){} try{ var right = $('TextOfferInDivCloudRight' + clientid); if (right != null) { right.hide(); } }catch(e){} $('divResultsLegend' + clientid).style['display']='none'; $('divInitialLegend' + clientid).style['display']='block'; } function ShowResults(clientid){ try{ var left = $('TextOfferInDivCloudLeft' + clientid); if (left != null) { left.show(); } }catch(e){} try{ var right = $('TextOfferInDivCloudRight' + clientid); if (right != null) { right.show(); } }catch(e){} } function ClickRegion(map, clientid, panelResults, clienturl){ ShowResults(); var ulcount = $('divCountryList' + clientid).select("ul li").size(); if (ulcount > 0) { $('divResultsLegend' + clientid).style['display']='block'; $('divInitialLegend' + clientid).style['display']='none'; } else { $('divResultsLegend' + clientid).style['display']='none'; $('divInitialLegend' + clientid).style['display']='block'; } $('divCountryList' + clientid).innerHTML = ""; try { var p = map; var a = map.regions.findAll(function(x) {return x.value.get('parent') == p.selectedRegion}, p); if (a.length == 0) { a = map.regions.findAll(function(x) {return x.key == p.selectedRegion }, p); } ul = new Element('ul'); ul.className = "listCountriesLeft"; ulr = new Element('ul'); ulr.className = "listCountriesRight"; var totalListlenght = 0; if (map.selectedRegion != 0) { var li = new Element('li'); li.update(' '); ulr.appendChild(li); li = new Element('li'); var lnk = new Element('a', {'href': '#', 'style': 'font-style: italic; color: #f15a22;text-decoration:underline;'}).update('[Back]'); lnk.observe('click', function(e) { map.back(); Event.stop(e); }.bind(this)); li.appendChild(lnk); ul.appendChild(li); totalListlenght = 2; } for (var i = 0; i < a.length; i++) { totalListlenght = totalListlenght + 1; if (map.selectedRegion != 0 && map.countriesByRegion.get(a[i].key) != null) { totalListlenght = totalListlenght + map.countriesByRegion.get(a[i].key).size(); } } listLenghtul = Math.ceil(totalListlenght/2); var ultemp = ul; for (var i = 0; i < a.length; i++) { if (totalListlenght > 3 && ul.childNodes.length >= listLenghtul) ultemp = ulr; var style = map.selectedRegion != 0 ? {'style': 'font-weight: bold'} : {}; var li = new Element('li', style).update(a[i].value.get('name')); li['RegionID'] = a[i].key; li['IsRegion'] = true; ultemp.appendChild(li); if (map.selectedRegion != 0 && map.countriesByRegion.get(a[i].key) != null) { map.countriesByRegion.get(a[i].key).each(function(c) { var li = new Element('li'); var lnk = new Element('a', {'class': 'hmpLinks','style': 'font-weight: bold', 'href': 'searchresults.aspx?countryid=' + c.get('id') + '&' + clienturl}).update(c.get('name')); li.appendChild(lnk); li['RegionID'] = a[i].key; li['IsRegion'] = false; ultemp.appendChild(li); }); } } $('divCountryList' + clientid).appendChild(ul); $('divCountryList' + clientid).appendChild(ulr); $(panelResults).setStyle({'display':'block'}); Scroll.showScrollbar(panelResults); } catch (e) { } } function controlTextAreaLength(control, length) { var nMaxLength = length - 1; var oTextArea = control; if( oTextArea.value.length > nMaxLength ) { oTextArea.value = oTextArea.value.substring( 0, nMaxLength ); } } function Slideshow(slideshow, timeout) { this.slides = []; var nl = $(slideshow).getElementsByTagName('div'); for (var i = 0; i < nl.length; i++) { if (Element.hasClassName(nl[i], 'slide')) { this.slides.push(nl[i]); } } this.timeout = timeout; this.current = 0; for (var i = 0; i < this.slides.length; i++) { this.slides[i].style.zIndex = this.slides.length - i; } Element.show(slideshow); setTimeout((function(){this.next();}).bind(this), this.timeout + 850); } Slideshow.prototype = { next: function() { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides[(this.current + i) % this.slides.length]; slide.style.zIndex = this.slides.length - i; } Effect.Fade(this.slides[this.current], { afterFinish: function(effect) { effect.element.style.zIndex = 0; Element.show(effect.element); Element.setOpacity(effect.element, 1); } }); this.current = (this.current + 1) % this.slides.length; setTimeout((function(){this.next();}).bind(this), this.timeout + 850); } }