var sUrl = 'proxies/getfeed.php'; var max = 4; var callback = { success: function(o) { var feed = eval("("+o.responseText+")"); updateFeed(feed); }, failure: function(o) { updateFeed(false); } }; function updateFeed(feed) { var rssLayer = document.getElementById("rssLayer"); var rssDate = document.getElementById("rssDate"); if(!feed) { rssLayer.innerHTML = "

The Newsfeed is currently unavailable.

"; return false; } var nugget = ''; var item = null; for(i=0;(i'+item.title+''; } nugget += '
'; rssLayer.innerHTML = nugget; var date = (new String(new Date())).split(" "); rssDate.innerHTML = date[0]+" "+date[1]+" "+date[2]+" "+date[3]; return true; } function timeToHuman(uTime) { var theDate = new Date(document.u2h.timeStamp.value * 1000); dateString = theDate.toGMTString(); document.u2h.result.value = dateString; } function getTopPaddingHeight(what) { var vHeight = YAHOO.util.Dom.getViewportHeight(); var wHeight = what.offsetHeight; return (wHeight < vHeight)?(vHeight - wHeight):0; } function LayoutPage() { YAHOO.util.Event.onAvailable("sidebar_a", this.handleOnAvailable, this); YAHOO.util.Event.onAvailable("document_a", this.handleOnAvailable, this); YAHOO.util.Event.onAvailable("rssLayer", this.fetchFeed, this); } LayoutPage.prototype.fetchFeed = function() { var transaction = YAHOO.util.Connect.asyncRequest("POST", sUrl, callback, null); }; LayoutPage.prototype.handleOnAvailable = function() { if(topPaddingHeight == null) topPaddingHeight = getTopPaddingHeight(this); //this.style.paddingTop = topPaddingHeight+"px"; this.style.marginTop = topPaddingHeight+"px"; }; var topPaddingHeight = null; var layout = new LayoutPage();