<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
 <ModulePrefs title="Games" title_url="http://www.meregames.com/" description="A mini game site for your web page with 50 games packed in one gadget including featured, action, adventure, racing and sports games" author="Widget Geek" author_email="widget.geek@gmail.com" screenshot="http://hosting.gmodules.com/ig/gadgets/file/104342096967082496017/game-gadget-ss.gif" thumbnail="http://hosting.gmodules.com/ig/gadgets/file/104342096967082496017/game-gadget-tn.gif" height="450" width="335" scrolling="false" singleton="true" category="games">
  <Require feature="dynamic-height" /> 
  <Require feature="setprefs" /> 
  <Require feature="tabs" /> 
<Require feature="analytics" /> 
  </ModulePrefs>
  <UserPref name="selectedTab" datatype="hidden" /> 
  <Content type="html">
  <![CDATA[ 
  <script>
  // Global variables
  var tabs = new _IG_Tabs(__MODULE_ID__);

  /**
   * Initialize tabs when page loads.
   * Create tab for each userpref only if userpref is not empty.
   */
  function init() {
    var f1 = "http://www.meregames.com/gadgets/dressup/";
    if (f1 != "") {
      tabs.addDynamicTab("Featured", dashboardGenerator(f1));
    }
    var f2 = "http://www.meregames.com/gadgets/action/";
    if (f2 != "") {
      tabs.addDynamicTab("Action", dashboardGenerator(f2));
    }
    var f3 = "http://www.meregames.com/gadgets/adventure/";
    if (f3 != "") {
      tabs.addDynamicTab("Adventure", dashboardGenerator(f3));
    }
    var f4 = "http://www.meregames.com/gadgets/racing/";
    if (f4 != "") {
      tabs.addDynamicTab("Racing", dashboardGenerator(f4));
    }
    var f5 = "http://www.meregames.com/gadgets/sports/";
    if (f5 != "") {
      tabs.addDynamicTab("Sports", dashboardGenerator(f5));
    }
   
 };

  /**
   * Creates a function that calls the tab's callback function
   * and passes along an additional variable from the calling environment.
   */
  function callbackGenerator(feedUrl) {
    return function(tabId) {
      callbackTab(tabId, feedUrl);
    }
  }

  function dashboardGenerator(url)
  {
    return function(tabId) {
      dashboard(tabId, url);
     }
   }
  function dashboard(tabId,url)
  {
        var container = _gel(tabId);
        container.innerHTML = "<iframe src='" + url + "' width='100%' height=435 frameborder=0></iframe>";
  _IG_AdjustIFrameHeight();
  }
    _IG_RegisterOnloadHandler(init);
_IG_Analytics("UA-4517972-1", "/games-gadget");

</script>
  ]]> 
    </Content>
  </Module>





