function GFdynamicFeedControl(a,f,c){this.nodes={};this.collapseElements=[];this.feeds=[];this.results=[];if(typeof a=="string"){this.feeds.push({url:a})}else{if(typeof a=="object"){for(var b=0;b<a.length;b++){var e=a[b];var h={};var g;if(typeof e=="string"){h.url=a[b]}else{if(typeof e=="object"){h=a[b];if(h&&h.title){var d=h.title;h.title=d.replace(/</g,"&lt;").replace(/>/g,"&gt;")}}}this.feeds.push(h)}}}if(typeof f=="string"){f=document.getElementById(f)}this.parseOptions_(c);this.setup_(f)}GFdynamicFeedControl.DEFAULT_NUM_RESULTS=4;GFdynamicFeedControl.DEFAULT_NUM_FEED_ITEMS=100;GFdynamicFeedControl.DEFAULT_FEED_CYCLE_TIME=1800000;GFdynamicFeedControl.DEFAULT_DISPLAY_TIME=5000;GFdynamicFeedControl.DEFAULT_FADEOUT_TIME=1000;GFdynamicFeedControl.DEFAULT_TRANSISTION_STEP=40;GFdynamicFeedControl.DEFAULT_HOVER_TIME=100;GFdynamicFeedControl.prototype.parseOptions_=function(a){this.options={numResults:GFdynamicFeedControl.DEFAULT_NUM_RESULTS,numFeedItems:GFdynamicFeedControl.DEFAULT_NUM_FEED_ITEMS,feedCycleTime:GFdynamicFeedControl.DEFAULT_FEED_CYCLE_TIME,linkTarget:google.feeds.LINK_TARGET_BLANK,displayTime:GFdynamicFeedControl.DEFAULT_DISPLAY_TIME,transitionTime:GFdynamicFeedControl.DEFAULT_TRANSISTION_TIME,transitionStep:GFdynamicFeedControl.DEFAULT_TRANSISTION_STEP,fadeOutTime:GFdynamicFeedControl.DEFAULT_FADEOUT_TIME,scrollOnFadeOut:true,pauseOnHover:true,hoverTime:GFdynamicFeedControl.DEFAULT_HOVER_TIME,autoCleanup:true,transitionCallback:null,feedTransitionCallback:null,feedLoadCallback:null,collapseable:false,sortByDate:false,horizontal:false,stacked:false,title:null};if(a){for(var c in this.options){if(typeof a[c]!="undefined"){this.options[c]=a[c]}}}if(!this.options.stacked){this.options.collapseable=false}this.options.displayTime=Math.max(200,this.options.displayTime);this.options.fadeOutTime=Math.max(0,this.options.fadeOutTime);var b=this.options.fadeOutTime/this.options.transitionStep;this.fadeOutDelta=Math.min(1,(1/b));this.started=false};GFdynamicFeedControl.prototype.setup_=function(b){if(b==null){return}this.nodes.container=b;if(window.ActiveXObject){this.ie=this[window.XMLHttpRequest?"ie7":"ie6"]=true}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){this.safari=true}else{if(document.getBoxObjectFor!=null){this.gecko=true}}}this.feedControl=new google.feeds.FeedControl();this.feedControl.setLinkTarget(this.options.linkTarget);this.expected=this.feeds.length;this.errors=0;for(var a=0;a<this.feeds.length;a++){var c=new google.feeds.Feed(this.feeds[a].url);c.setResultFormat(google.feeds.Feed.JSON_FORMAT);c.setNumEntries(this.options.numFeedItems);c.load(this.bind_(this.feedLoaded_,a))}};GFdynamicFeedControl.prototype.bind_=function(c){var b=this;var a=[].slice.call(arguments,1);return function(){var d=a.concat([].slice.call(arguments));return c.apply(b,d)}};GFdynamicFeedControl.prototype.feedLoaded_=function(a,b){if(this.options.feedLoadCallback){this.options.feedLoadCallback(b)}if(!b.error&&b.feed.entries.length==0){b.error=true}if(b.error){if(++this.errors>=this.expected){this.nodes.container.innerHTML="Feed"+((this.expected>1)?"s ":" ")+'could not be loaded. Check the feed URLS and see the <a href="http://help.masteragenda.com/index.php/Featured_Presenters_and_Sessions_Widget#Troubleshooting">Troubleshooting section of the help page</a>'}return}if(this.feeds[a].title){b.feed.title=this.feeds[a].title}b.startIndex=0;b.firstShow=true;this.results.push(b);if(!this.started){this.createSubContainers_();b.list=this.nodes.list;this.displayResult_(0)}else{if(!this.options.horizontal&&this.options.stacked){this.addResult_(this.results.length-1)}}};GFdynamicFeedControl.prototype.addResult_=function(e){var d=this.results[e],f=this.createDiv_("gfg-subtitle");this.setTitle_(d.feed,f);var c=this.createDiv_("gfg-list");if(this.options.collapseable){var b=document.createElement("div");c.style.display="none";b.className="gfg-collapse-closed";f.appendChild(b);b.onclick=this.toggleCollapse(this,c,b);this.collapseElements.push({list:c,collapse:b})}var a=document.createElement("div");a.className="clearFloat";f.appendChild(a);this.nodes.root.appendChild(f);this.nodes.root.appendChild(c);d.list=c;this.createListEntries_(e,c)};GFdynamicFeedControl.prototype.displayResult_=function(b){this.resultIndex=b;var a=this.results[b];if(this.options.feedTransitionCallback){this.options.feedTransitionCallback(a)}this.setMainTitle_(b);this.clearNode_(this.nodes.entry);if(this.started&&!this.options.horizontal&&this.options.stacked){this.createListEntries_(b,a.list);this.entries=this.getEntries_(b)}else{this.createListEntries_(b,this.nodes.list)}this.displayEntries_()};GFdynamicFeedControl.prototype.setMainTitle_=function(a){if(this.options.title){this.setPlainTitle_(this.options.title)}else{this.setTitle_(this.results[a].feed)}};GFdynamicFeedControl.prototype.setPlainTitle_=function(b,c){var a=c||this.nodes.title;a.innerHTML=b};GFdynamicFeedControl.prototype.setTitle_=function(a,d){var b=d||this.nodes.title;this.clearNode_(b);var c=document.createElement("a");c.target=google.feeds.LINK_TARGET_BLANK;c.href=a.link;c.className="gfg-collapse-href";c.innerHTML=a.title;b.appendChild(c)};GFdynamicFeedControl.prototype.toggleCollapse=function(a,c,b){return function(){var e=a.collapseElements;for(var d=0;d<e.length;d++){var f=e[d];f.list.style.display="none";f.collapse.className="gfg-collapse-closed"}c.style.display="block";b.className="gfg-collapse-open"}};GFdynamicFeedControl.prototype.endIndexPlusOne_=function(b){var a=this.results[b];return(Math.min(a.startIndex+this.options.numResults,a.feed.entries.length))};GFdynamicFeedControl.prototype.getEntries_=function(c){var b=this.results[c],a=this.endIndexPlusOne_(c);return(this.results[c].feed.entries.slice(b.startIndex,a))};GFdynamicFeedControl.prototype.createListEntries_=function(h,e){var g=this.getEntries_(h);this.clearNode_(e);for(var b=0;b<g.length;b++){this.feedControl.createHtml(g[b]);var d=g[b];d.html.childNodes[1].innerHTML=d.content;var a="gfg-listentry ";a+=(b%2)?"gfg-listentry-even":"gfg-listentry-odd";var f=this.createDiv_(a);var c=this.createLink_(g[b].link,g[b].title,this.options.linkTarget);f.appendChild(c);if(this.options.pauseOnHover){f.onmouseover=this.bind_(this.listMouseOver_,h,b);f.onmouseout=this.bind_(this.listMouseOut_,h,b)}g[b].listEntry=f;e.appendChild(f)}if(e==this.nodes.list){this.entries=g}};GFdynamicFeedControl.prototype.displayEntries_=function(){this.entryIndex=0;this.displayCurrentEntry_();this.setDisplayTimer_();this.started=true};GFdynamicFeedControl.prototype.displayNextEntry_=function(){if(this.options.autoCleanup&&this.isOrphaned_()){this.cleanup_();return}this.results[this.resultIndex].firstShow=false;if(++this.entryIndex>=this.entries.length){if(this.results.length>1){if(++this.resultIndex>=this.results.length){this.resultIndex=0}this.nextResultChunk_();this.displayResult_(this.resultIndex);return}else{this.nextResultChunk_();this.entryIndex=0;this.displayResult_(this.resultIndex)}}if(this.options.transitionCallback){this.options.transitionCallback(this.entries[this.entryIndex])}this.displayCurrentEntry_();this.setDisplayTimer_()};GFdynamicFeedControl.prototype.nextResultChunk_=function(){var a=this.results[this.resultIndex];if(!a.firstShow){a.startIndex+=this.options.numResults}if(a.startIndex>(a.feed.entries.length-1)){a.startIndex=0}};GFdynamicFeedControl.prototype.displayCurrentEntry_=function(){this.clearNode_(this.nodes.entry);this.current=this.entries[this.entryIndex].html;this.current.style.top="0px";this.nodes.entry.appendChild(this.current);this.createOverlay_();if(this.options.collapseable){var a=null;for(var e=0;e<this.results.length;e++){if(this.results[e].feed.entries==this.entries){a=this.results[e].feed.title}}var d=this.collapseElements;for(var e=0;e<d.length;e++){var f=d[e];var g=f.collapse.previousSibling.innerHTML;var c=f.collapse;if(a==g){if(this.ie){c.click()}else{c.onclick()}}}}if(this.currentList){var b="gfg-listentry ";b+=(this.currentListIndex%2)?"gfg-listentry-even":"gfg-listentry-odd";this.currentList.className=b}this.currentList=this.entries[this.entryIndex].listEntry;this.currentListIndex=this.entryIndex;var b="gfg-listentry gfg-listentry-highlight ";b+=(this.currentListIndex%2)?"gfg-listentry-even":"gfg-listentry-odd";this.currentList.className=b};GFdynamicFeedControl.prototype.listMouseHover_=function(c,d){var b=this.getEntries_(c),a=b[d].listEntry;a.selectTimer=null;this.clearTransitionTimer_();this.clearDisplayTimer_();this.resultIndex=c;this.entries=b;this.entryIndex=d;this.setMainTitle_(c);this.displayCurrentEntry_()};GFdynamicFeedControl.prototype.listMouseOver_=function(d,e){var c=this.getEntries_(d),b=c[e].listEntry;var a=this.bind_(this.listMouseHover_,d,e);b.selectTimer=setTimeout(a,this.options.hoverTime)};GFdynamicFeedControl.prototype.listMouseOut_=function(c,d){var b=this.getEntries_(c),a=b[d].listEntry;if(a.selectTimer){clearTimeout(a.selectTimer);a.selectTimer=null}else{this.setDisplayTimer_()}};GFdynamicFeedControl.prototype.entryMouseOver_=function(a){this.clearDisplayTimer_();if(this.transitionTimer){this.clearTransitionTimer_();this.displayCurrentEntry_()}};GFdynamicFeedControl.prototype.entryMouseOut_=function(a){this.setDisplayTimer_()};GFdynamicFeedControl.prototype.createOverlay_=function(){if(this.current==null){return}if(this.overlay==null){var a=this.createDiv_("gfg-entry");a.style.position="absolute";a.style.top="0px";a.style.left="0px";this.overlay=a}this.setOpacity_(this.overlay,0);this.nodes.entry.appendChild(this.overlay)};GFdynamicFeedControl.prototype.setDisplayTimer_=function(){if(this.displayTimer){this.clearDisplayTimer_()}var a=this.bind_(this.setFadeOutTimer_);this.displayTimer=setTimeout(a,this.options.displayTime)};GFdynamicFeedControl.timeNow=function(){var a=new Date();return a.getTime()};GFdynamicFeedControl.prototype.fadeOutEntry_=function(){if(this.overlay){var g=this.fadeOutDelta;var e=this.options.transitionStep;var a=GFdynamicFeedControl.timeNow();var b=a-this.lastTick;this.lastTick=a;g*=(b/e);var f=this.overlay.opacity+g;this.setOpacity_(this.overlay,f);if(this.options.scrollOnFadeOut&&(f>0.5)){var d=(f-0.5)*2;var c=Math.round(this.current.offsetHeight*d);this.current.style.top=c+"px"}if(f<1){return}}this.clearTransitionTimer_();this.displayNextEntry_()};GFdynamicFeedControl.prototype.setFadeOutTimer_=function(){this.clearTransitionTimer_();this.lastTick=GFdynamicFeedControl.timeNow();var a=this.bind_(this.fadeOutEntry_);this.transitionTimer=setInterval(a,this.options.transitionStep)};GFdynamicFeedControl.prototype.clearTransitionTimer_=function(){if(this.transitionTimer){clearInterval(this.transitionTimer);this.transitionTimer=null}};GFdynamicFeedControl.prototype.clearDisplayTimer_=function(){if(this.displayTimer){clearTimeout(this.displayTimer);this.displayTimer=null}};GFdynamicFeedControl.prototype.createSubContainers_=function(){var a=this.nodes;var d=this.nodes.container;this.clearNode_(d);if(this.options.horizontal){d=this.createDiv_("gfg-horizontal-container");a.root=this.createDiv_("gfg-horizontal-root");this.nodes.container.appendChild(d)}else{a.root=this.createDiv_("gfg-root")}a.title=this.createDiv_("gfg-title");a.entry=this.createDiv_("gfg-entry");a.list=this.createDiv_("gfg-list");a.root.appendChild(a.title);a.root.appendChild(a.entry);if(!this.options.horizontal&&this.options.stacked){var e=this.createDiv_("gfg-subtitle");a.root.appendChild(e);this.setTitle_(this.results[0].feed,e);if(this.options.collapseable){var c=document.createElement("div");c.className="gfg-collapse-open";e.appendChild(c);c.onclick=this.toggleCollapse(this,a.list,c);this.collapseElements.push({list:a.list,collapse:c});a.list.style.display="block"}var b=document.createElement("div");b.className="clearFloat";e.appendChild(b)}a.root.appendChild(a.list);d.appendChild(a.root);if(this.options.pauseOnHover){a.entry.onmouseover=this.bind_(this.entryMouseOver_);a.entry.onmouseout=this.bind_(this.entryMouseOut_)}};GFdynamicFeedControl.prototype.clearNode_=function(a){if(a==null){return}var b;while((b=a.firstChild)){a.removeChild(b)}};GFdynamicFeedControl.prototype.createDiv_=function(a,c){var b=document.createElement("div");if(c){b.innerHTML=c}if(a){b.className=a}return b};GFdynamicFeedControl.prototype.createLink_=function(a,d,b){var c=document.createElement("a");c.href=a;c.innerHTML=d;if(b){c.target=b}return c};GFdynamicFeedControl.prototype.clearResults_=function(){for(var a=0;a<this.results.length;a++){var d=this.results[a];var c=d.feed.entries;for(var a=0;a<c.length;a++){var b=c[a];b.html=null;b.listEntry.onmouseover=null;b.listEntry.onmouseout=null;if(b.listEntry.selectTimer){clearTimeout(b.listEntry.selectTimer);b.listEntry.selectTimer=null}b.listEntry=null}}};GFdynamicFeedControl.prototype.isOrphaned_=function(){var a=this.nodes.root;var b=false;if(!a||!a.parentNode){b=true}else{if(this.options.horizontal&&!a.parentNode.parentNode){b=true}}return b};GFdynamicFeedControl.prototype.cleanup_=function(){this.started=false;this.clearDisplayTimer_();this.clearTransitionTimer_();this.clearResults_();this.clearNode_(this.nodes.root);this.nodes.container=null};GFdynamicFeedControl.prototype.setOpacity_=function(b,a){if(b==null){return}a=Math.max(0,Math.min(1,a));if(a==0){if(b.style.visibility!="hidden"){b.style.visibility="hidden"}}else{if(b.style.visibility!="visible"){b.style.visibility="visible"}}if(this.ie){var c=Math.round(a*100);b.style.filter="alpha(opacity="+c+")"}b.style.opacity=b.opacity=a};GFgadget=GFdynamicFeedControl;
