if (location.href.indexOf('https') != -1) { var httpUrl = 'http://' + location.hostname + location.pathname + location.search; location.href = httpUrl; } function writeLayer(layerName, content) { if (document.getElementsByTagName("div")[layerName]) { document.getElementsByTagName("div")[layerName].innerHTML = content; document.getElementsByTagName("div")[layerName].style.visibility = "visible"; } } function openLayer(layerName, header, contentURL, contentWidth, contentHeight, rootModulePath) { content = ''; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += ' '; content += '

' + header + '
'; writeLayer(layerName, content); } function closeLayer(layerName) { if (document.getElementsByTagName("div")[layerName]) { document.getElementsByTagName("div")[layerName].innerHTML = ''; document.getElementsByTagName("div")[layerName].style.visibility = "hidden"; } } function getAbsoluteLeft(obj) { var x = 0; while (obj.offsetParent) { x += obj.offsetLeft; obj = obj.offsetParent; } x += obj.offsetLeft; return x; } function getAbsoluteTop(obj) { var y = 0; while (obj.offsetParent) { y += obj.offsetTop; obj = obj.offsetParent; } y += obj.offsetTop; return y; } function getClientWidth() { if (window.innerWidth && window.innerHeight) { // mozilla; return window.innerWidth; } else if (document.all || window.opera) { // msie && opera; return document.body.clientWidth; } } function getClientHeight() { if (window.innerWidth && window.innerHeight) { // mozilla; return window.innerHeight; } else if (document.all || window.opera) { // msie && opera; if (document.documentElement && document.documentElement.clientHeight != 0) { return document.documentElement.clientHeight; } else { return document.body.clientHeight; } } } function getScrollWidth() { return document.body.scrollWidth; } function getScrollHeight() { return document.body.scrollHeight; } function autoResize(bottomImageName, rightImageName) { var imageBottom = new Image(); var imageRight = new Image(); var nameBottom = (bottomImageName ? bottomImageName : "imageBottom"); var nameRight = (rightImageName ? rightImageName : "imageRight"); var pageWidth = 0; var pageHeight = 0; var currWidth = 0; var currHeight = 0; imageRight = document.images[nameRight]; // will be null if image doesn't exist; imageBottom = document.images[nameBottom]; // will be null if image doesn't exist; pageWidth = ((imageRight) ? (getAbsoluteLeft(imageRight) + imageRight.width) : ((document.all) ? (document.body.clientWidth) : (window.innerWidth))); pageHeight = ((imageBottom) ? (getAbsoluteTop(imageBottom) + imageBottom.height) : ((document.all) ? (document.body.clientHeight) : (window.innerHeight))); currWidth = ((document.all) ? (document.body.clientWidth) : (window.innerWidth)); currHeight = ((document.all) ? (document.body.clientHeight) : (window.innerHeight)); var deltaX = pageWidth - currWidth; // if no matching image was found deltaX turns out as 0 since "pageWidth" and "currWidth" feature the same data; var deltaY = pageHeight - currHeight; // if no matching image was found deltaY turns out as 0 since "pageHeight" and "currHeight" feature the same data; window.resizeBy(deltaX, deltaY); } function isScrolling() { topWidth = 0; topHeight = 0; if (document.all) { topWidth = top.document.body.clientWidth; topHeight = top.document.body.clientHeight; } else { topWidth = top.window.innerWidth; topHeight = top.window.innerHeight; } return (topWidth < 1000 || topHeight < 560); } function resizeContentList() { if (this.name != "uic_content") return; minWindowHeight = (isScrolling()) ? 490 : 0; windowHeight = (getClientHeight() > minWindowHeight) ? getClientHeight() : minWindowHeight; contentListPos = getAbsoluteTop(document.getElementById('content_list')); contentList = document.getElementById('content_list'); contentList.height = windowHeight - contentListPos - 1; // hidden request has height of 5px } function resizeContentFrame() { if (this.name != "uic_frame") return; minWindowHeight = (isScrolling()) ? 490 : 0; windowHeight = (getClientHeight() > minWindowHeight) ? getClientHeight() : minWindowHeight; contentListPos = getAbsoluteTop(document.getElementById('content_frame')); contentList = document.getElementById('content_frame'); contentList.height = windowHeight - contentListPos - 6; } function changeBackground(backId, backColor) { if (document.getElementById(backId)) { document.getElementById(backId).bgColor = backColor; } } function highlight(whichValue, whichLink1, whichLink2, whichLink3, whichLink4, whichLink5) { if (whichLink1 && document.getElementsByTagName('a')[whichLink1]) document.getElementsByTagName('a')[whichLink1].style.color = (whichValue == '1') ? '#003399' : '#666666'; if (whichLink2 && document.getElementsByTagName('a')[whichLink2]) document.getElementsByTagName('a')[whichLink2].style.color = (whichValue == '1') ? '#003399' : '#666666'; if (whichLink3 && document.getElementsByTagName('a')[whichLink3]) document.getElementsByTagName('a')[whichLink3].style.color = (whichValue == '1') ? '#003399' : '#666666'; if (whichLink4 && document.getElementsByTagName('a')[whichLink4]) document.getElementsByTagName('a')[whichLink4].style.color = (whichValue == '1') ? '#003399' : '#666666'; if (whichLink5 && document.getElementsByTagName('a')[whichLink5]) document.getElementsByTagName('a')[whichLink5].style.color = (whichValue == '1') ? '#003399' : '#666666'; } function isTokenValid(pageToken, requestToken) { return (pageToken && requestToken && pageToken == requestToken); } function isBrandTokenValid(pageToken, requestToken) { brandPart = (pageToken && pageToken.indexOf('_') != -1) ? pageToken.substr(0, pageToken.indexOf('_')) : pageToken; return (brandPart && requestToken && requestToken.indexOf(brandPart) == 0); } function logEMailRequest(hiddenFrame, offerId) { if (hiddenFrame && hiddenFrame.document.forms && hiddenFrame.document.forms["searchForm"]) { hiddenFrame.document.forms["searchForm"].elements['action'].value = 'logEMailRequest'; hiddenFrame.document.forms["searchForm"].elements['redirectWhere'].value = '_lib/uic_hidden_search_request.jsp'; hiddenFrame.document.forms["searchForm"].elements['offerId'].value = offerId; hiddenFrame.document.forms["searchForm"].submit(); } }