function changeBackground(path, extension) { var bodyWidth; if (is_safari) { bodyWidth = self.innerWidth; } else { bodyWidth = document.body.clientWidth; }        if (extension != null) { if (bodyWidth <= 1024) { document.body.style.backgroundImage = "url(" + path + "." + extension + ")";} else if (bodyWidth > 1024 && bodyWidth <= 1280) { document.body.style.backgroundImage = "url(" + path + "-1280." + extension + ")";} else if (bodyWidth > 1280) { document.body.style.backgroundImage = "url(" + path + "-1600." + extension + ")";} } } var PortletHeaderBar = {fadeIn : function (id) {var bar = document.getElementById(id);// portlet has been removed.  exit.if (bar == null)return;if (bar.startOut) {// stop fadeOut prematurelyclearTimeout(bar.timerOut);//debug_div.innerHTML += bar.timerOut + " stop OUT prematurely<br/>";bar.timerOut = 0;}bar.startOut = false;		bar.startIn = true;		bar.opac += 20;//debug_div.innerHTML += "IN "+bar.opac+"<br/>";for (var i = 0; i < bar.iconList.length; i++) {changeOpacity(bar.iconList[i], bar.opac);}bar.iconBar.style.display = "block";if (bar.opac < 100) {bar.timerIn = setTimeout("PortletHeaderBar.fadeIn(\"" + id + "\")", 50);}else {bar.timerIn = 0;bar.startIn = false;}},fadeOut : function (id) {var bar = document.getElementById(id);// portlet has been removed.  exit.if (bar == null)return;if (bar.startIn) {// stop fadeIn prematurelyclearTimeout(bar.timerIn);//debug_div.innerHTML += + bar.timerIn + " stop IN prematurely<br/>";bar.timerIn = 0;}bar.startIn = false;bar.startOut = true;		bar.opac -= 20;//debug_div.innerHTML += "OUT "+bar.opac+"<br/>";for (var i = 0; i < bar.iconList.length; i++) {changeOpacity(bar.iconList[i], bar.opac);}bar.iconBar.style.display = "block";if (bar.opac > 0) {bar.timerOut = setTimeout("PortletHeaderBar.fadeOut(\"" + id + "\")", 50);}else {bar.iconBar.style.display = "none";bar.timerOut = 0;bar.startOut = false;}},init : function (bar) {if (!bar.iconBar) {bar.iconBar = getElementByClassName(bar, "portlet-small-icon-bar");}if (!bar.iconList) {bar.iconList = bar.iconBar.getElementsByTagName("img");}},hide : function (id) {var bar = document.getElementById(id);//debug_div.innerHTML += "<br/>hide " + bar.timerIn + " " + bar.startIn + " <br/>";// If fadeIn timer has been set, but hasn't started, cancel itif (bar.timerIn && !bar.startIn) {// cancel unstarted fadeIn//debug_div.innerHTML +=  "cancel unstarted IN<br/>";clearTimeout(bar.timerIn);bar.timerIn = 0;}	if (!bar.startOut && bar.opac > 0) {if (bar.timerOut) {// reset unstarted fadeOut timerclearTimeout(bar.timerOut);//debug_div.innerHTML += "Out restarted<br/>";bar.timerOut = 0;}this.init(bar);bar.timerOut = setTimeout("PortletHeaderBar.fadeOut(\"" + id + "\")", 150);//debug_div.innerHTML += bar.timerOut + " hide OUT<br/>";}},show : function (id) {//debug_div.innerHTML += "<br/>show<br/>";var bar = document.getElementById(id);// If fadeOut timer has been set, but hasn't started, cancel itif (bar.timerOut && !bar.startOut) {// cancel unstarted fadeOut//debug_div.innerHTML +=  "cancel unstarted OUT<br/>";clearTimeout(bar.timerOut);bar.timerOut = 0;}if (!bar.startIn && (!bar.opac || bar.opac < 100)){if (!bar.opac) {bar.opac = 0;}if (bar.timerIn) {// reset unstarted fadeIn timerclearTimeout(bar.timerIn);//debug_div.innerHTML += "In restarted<br/>";bar.timerIn = 0;}this.init(bar);bar.timerIn = setTimeout("PortletHeaderBar.fadeIn(\"" + id + "\")", 150);//debug_div.innerHTML += bar.timerIn + " show IN<br/>";}}}