// creates the namespace if (!waw) { var waw = {}; try{ var myDomain = document.getElementById('purefans-widget-js').getAttribute('src').split('/')[2]; var wawSiteUrl='http://' + myDomain; } catch(e){ var wawSiteUrl='http://www.purefans.com'; } if (!waw.widgets) waw.widgets = {}; Object.prototype.myextend = function (oSuper) { for (sProperty in oSuper) { this[sProperty] = oSuper[sProperty]; } } // Base is the common controller for widgets for them to communicate waw.widgets.Base = function(config) { this.config=config; this.maxZIndex=100; this.scriptCounter=100; runningWidgets=new Array(); addWidgetToBase = function(id, widget) { runningWidgets.push(Array(id, widget)); } this.writeWidget = function(name, config) { var widget=false; eval('widget=new waw.widgets.'+name+'(name);'); //if(!!config) { widget.setConfig(config); //} widget.writeToDOM(); var widgetId=widget.getId(); addWidgetToBase(widgetId, widget); widget.setBase(this); } this.getById = function(id) { for(i=0; i 0) { var parameters = this.parseParameters(message); if (parameters["height"] != null) { document.getElementById('iframe_' + this.id).height = parseInt(parameters["height"]); } if (parameters["color"] != null) { document.body.bgColor = parameters["color"]; } } } this.test = function() { var msg = window.location.hash.substring(1); if (msg != '') { alert(msg); window.location.hash=''; //window.frames['iframe_' + this.id] = ''; //clearInterval(document.IFrameMessageIntervalId); } //set above function to run every 10 msecs: //document.IFrameMessageIntervalId = } this.writeToDOM = function() { this.id=this.generateId(); dimensions=this.getDimensions('small'); if(this.config.expandDirection=='left' || this.config.expandDirection=='right') document.write('
 
'); document.write('
'); document.write('
'); document.write(''); document.write('iframe_' + this.id + '.location="' + this.url + '?api_key=' + waw_config.api_key + '";'); document.write('
'); setInterval(this.test, 10); } // initialize an instance of the widget init(in_name, this); } // fanZoneUsers extends Widget waw.widgets.fanZoneUsers = function(wargs) { this.myextend(new waw.widgets.Widget(wargs)) this.url=wawSiteUrl+'/widgets/fanZoneUsers/1'; this.defaultConfig.dimensions={small: '235x476', big:'600x476'}; this.defaultConfig.expandDirection='left'; } // forum extends Widget waw.widgets.forum = function(wargs) { this.myextend(new waw.widgets.Widget(wargs)) this.url=wawSiteUrl+'/widgets/forum/1'; this.defaultConfig.dimensions={small: '235x476', big:'600x476'}; this.defaultConfig.expandDirection='left'; } }