var CHPaccheight = menutop = menuheight = totalBrands = count = 0; var Pcounter = Pmenuwidth = Pmenuleft = 0; var curBrand = 1; var CHPps1 = CHPps2 = ""; function createMenus() { var menuNum = 0; var DIVs = document.all ? document.all.tags("div") : document.getElementsByTagName("div"); for (d=0; d\ 0) { if (As[0].href == "#" || As[0].href == window.location.href + "#") { As[0].className = "CHPMenuHide"; } } var H3s = document.getElementById("CHPprod" + x).getElementsByTagName("h3"); if (H3s.length > 0) { document.getElementById("CHPaccMenuTitle").innerHTML = H3s[0].innerHTML.replace("onclick","oclick"); H3s[0].className = "CHPMenuHide"; } } var DIVs = document.all ? document.all.tags("div") : document.getElementsByTagName("div"); for (d=0; d"; } if (x == "lt") Pmenuleft += 342; else if (x == "rt") Pmenuleft -= 342; if (Pmenuleft < -2*Pmenuwidth) Pmenuleft += Pmenuwidth; if (Pmenuleft > -Pmenuwidth) Pmenuleft -= Pmenuwidth; document.getElementById("CHPpromomove").style.marginLeft = Pmenuleft + "px"; if (document.getElementById("CHPpromoleft") != null) document.getElementById("CHPpromoleft").style.paddingTop = ((document.getElementById("CHPpromomove").clientHeight / 2) - 20) + "px"; if (document.getElementById("CHPpromoright") != null) document.getElementById("CHPpromoright").style.paddingTop = ((document.getElementById("CHPpromomove").clientHeight / 2) - 20) + "px"; } */ var Bcounter = Bmenuwidth = Bmenuleft = 0; function Brotate(x,y) { if (Bmenuwidth == 0) { var Bthree = document.getElementById("CHPmultiplyB").innerHTML; Bmenuwidth = document.getElementById("Bitems").offsetWidth; document.getElementById("CHPbrandsmove").innerHTML = "" + Bthree + Bthree + Bthree + "
"; } if (y == 0) document.getElementById("CHPbrandstage").style.display = "none"; if (x == "lt") Bmenuleft += 170; else if (x == "rt") Bmenuleft -= 170; if (Bmenuleft < -2*Bmenuwidth) Bmenuleft += Bmenuwidth; if (Bmenuleft > -Bmenuwidth) Bmenuleft -= Bmenuwidth; document.getElementById("CHPbrandsmove").style.marginLeft = Bmenuleft + "px"; } /*FWIP code*/ Scroller = Class.create({ defaults: { size:2, duration:800, autoscroll:false }, initialize: function(element, options) { this.element = $(element); this.options = (options != null) ? options : this.defaults; this.pageSize = this.options.size; this.duration = this.options.duration; this.auto = this.options.autoscroll; this.scroller = this.element.down('div.items'); this.items = this.scroller.childElements(); this.locked = false; this.arrowL = this.element.down('a.prev'); this.arrowR = this.element.down('a.next'); this.positions= []; this.posIndex = 1; if (this.items.length > this.options.size) { this.pageWidth = this.items[0].offsetWidth; if (this.options.size == 2) { this.scroller.insert({ bottom:'
'+this.items[0].innerHTML+'
' }); this.scroller.insert({ top:'
'+this.items[this.items.length-1].innerHTML+'
' }); this.items.unshift(this.items.last()); for (var i=0; i < this.items.length; i++) { var position = -this.pageWidth * i; this.positions.push(position); }; this.items.push(this.items[1]); } else if (this.options.size == 4) { this.scroller.insert({ bottom:'
'+this.items[0].innerHTML+'
' }); this.scroller.insert({ bottom:'
'+this.items[1].innerHTML+'
' }); this.scroller.insert({ top:'
'+this.items[this.items.length-1].innerHTML+'
' }); this.scroller.insert({ top:'
'+this.items[this.items.length-2].innerHTML+'
' }); this.items.unshift(this.items[this.items.length-2], this.items[this.items.length-1]); for (var i=0; i < this.items.length-1; i++) { var position = -this.pageWidth * i; this.positions.push(position); }; this.items.push(this.items[1]); this.items.push(this.items[2]); this.posIndex = 2; } else { if (!window.console || !console.firebug){ // CONSOLE LOGGING FOR IE var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; window.console = {}; for (var i=0; i tallest) { tallest = thisHeight; } }); group.invoke('setStyle', { height:tallest+'px' }); this.centerVertically(tallest); }, centerVertically: function(tallest) { var arrowheight = this.arrowL.getHeight(); var pad = ((tallest + 15) / 2) - 21; this.arrowL.setStyle({ paddingTop:pad+'px' }); this.arrowR.setStyle({ paddingTop:pad+'px' }); }, next: function(event) { if ((event) && typeof event != 'number') event.stop(); if (this.posIndex == this.positions.length-1 && !this.locked) { this.posIndex = 0; this.updateScroller(true, 'next'); } else if (!this.locked) { this.posIndex++; this.updateScroller(false, 'next'); } }, prev: function(e) { e.stop(); if (this.posIndex == 0 && !this.locked) { this.posIndex = this.positions.length-1; this.updateScroller(true, 'prev'); } else if (!this.locked) { this.posIndex--; this.updateScroller(false, 'prev'); } }, updateScroller: function(reset, dir) { if (reset == true && dir == 'next') { this.scroller.setStyle({ left:this.positions[this.posIndex] }); this.posIndex++; } else if (reset == true && dir == 'prev') { this.scroller.setStyle({ left:this.positions[this.positions.length-1]+'px' }); this.posIndex--; } if (!this.locked) { this.lock(); var effect = new Fx.Style(this.scroller, 'left', {duration: this.duration, onComplete: this.unlock.bind(this)}); effect.custom(this.scroller.offsetLeft, this.positions[this.posIndex]); } }, lock: function() { this.locked = true; }, unlock: function() { this.locked = false; } }); function loadPage() { if (document.getElementById('corpfooters') != null) { createMenus(); /*Protate(); if (Pmenuwidth <= (document.getElementById("CHPpromocarousel").offsetWidth + 1) && document.getElementById("CHPpromoright")) { document.getElementById("CHPpromoleft").innerHTML = " "; document.getElementById("CHPpromoright").innerHTML = " "; }*/ try { Brotate(); } catch(e) { //catch and supress error } if (location.href.toString().indexOf("menu") != -1) {toggleMenuB();displayMenu(1);} if (location.href.toString().indexOf("menu") != -1) displayMenu(1); try { OCunderline(); } catch(e) { //catch and supress error } } else { setTimeout("loadPage();",500); } } function SwitchBrandsAndPromos() { if (document.getElementById("CHPPromos") != null && document.getElementById("CHPBrands") != null) { var oldTop = document.getElementById("CHPPromos").innerHTML; document.getElementById("CHPPromos").innerHTML = document.getElementById("CHPBrands").innerHTML; document.getElementById("CHPBrands").innerHTML = oldTop; } } document.onload = setTimeout("loadPage();",1);