<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs
height="550"
width="300"
title="Facebook"
directory_title="Facebook"
description="Facebook Gadget for iGoogle: Your essential miniaturized Facebook connection. View your news feed, make comments, post status updates and stay connected to all your facebook friends directly from your iGoogle page. Using Facebook's newest API, this gadget provides secure, convenient access to your account. Use the quick link bars above and below this gadget to quickly open the most popular websites. Links include Amazon, Ebay, Twitter, Yahoo and much more. Tags: google, time, weather, date, day, daily, calendar, beautiful, widget, gadget, igadgets, youtube, webcam, webcams, feed, feeds, calculator, quote, quotes, picture, pic, pics, photo, photos, tip, tips, search, list, free, music, gmail, joke, jokes, game, games, online, recipes, dictionary, bookmark, bookmarks, map, maps, sport, sports, horoscope, horoscopes, search, "
title_url="http://www.edwardjamesltd.co.uk/redirect.html"
screenshot="http://hosting.gmodules.com/ig/gadgets/file/100080069921643878012/screenshot_facebook.jpg"
thumbnail="http://hosting.gmodules.com/ig/gadgets/file/100080069921643878012/thumbnail_facebook.png"
singleton="false" author="supergadgets"
author_email="supergadgets111@googlemail.com" author_location="UK"
author_affiliation="none" category="funandgames" category2="lifestyle">
<Require feature="minimessage"/>
<Require feature="analytics" /> 
<Require feature="dynamic-height"/> 
<Require feature="views"/> 
<!-- SJP MOD START -->
<Require feature="setprefs"/>
<!-- SJP MOD END -->

</ModulePrefs>

<!-- SJP MOD START -->
<UserPref name="useNewFB_p" display_name="Use new version" datatype="bool" default_value="true" />
<UserPref name="showPopUp2_p" datatype="hidden" default_value="true" />
  

<Content type="html" view="home">
<![CDATA[

<iframe src="http://www.just-piano-stools.co.uk/links/links.html" height="40" width="300" frameborder="0" border="0" cellpadding="0" cellspacing="0" scrolling="no" ></iframe>

<script type="text/javascript">
function goToView(dest) {
 var supported_views = gadgets.views.getSupportedViews();
 gadgets.views.requestNavigateTo(supported_views[dest]);
};
</script>

<!-- Anchor everything -->


<!-- <div style="float:right"> -->
<script type="text/javascript">
var syndication = gadgets.util.getUrlParameters()["synd"];
if (typeof syndication != "undefined") {
 if(syndication == "ig") {
 // iGoogle homepage
 // Removing this to see if it has an effect
 // document.write('<a href="javascript:goToView(\'canvas\')">Maximize View</a>');
 }
 else if(syndication == "open") {
 // gadget in a webpage
 document.write('<span style="font-size:9px"><a target="_blank" href="http://www.google.com/ig/adde?moduleurl=hosting.gmodules.com/ig/gadgets/file/100080069921643878012/facebook.xml" >Add to iGoogle</a></span>');
 }
} 
</script>

<div id="content_div" align="center"></div>


<!-- Dynamic content -->

<script type="text/javascript">





// Run onload
gadgets.util.registerOnLoadHandler(init);




// Called on startup !
function init() {
 display();
}




   function resize() {
   gadgets.window.adjustHeight();
   }


// <!-- SJP MOD START -->
function processPopUp(whichCase) {
  var prefs = new gadgets.Prefs();

  switch(whichCase) {
  case 3:
   prefs.set('showPopUp2_p', 'false');
   display(false);
   break;
  case 2:
   display(false); 
   break;
  case 1:
  default:
    prefs.set('useNewFB_p', 'true');
   display();
  break;
  }
 }
function display(popup_p) {
  var prefs = new gadgets.Prefs(), destination_url;


  if (prefs.getBool('useNewFB_p') == true) {
    destination_url = 'http://ampatico.com/Facebook/iGoogle/6fromSVN/index';
  } else {

    // POTENTIALLY SHOW POP-UP
    if (prefs.getBool('showPopUp2_p') == true && popup_p != false) {
      // Show the pop-up
      
      var html = '<h3>Updated Facebook Gadget!</h3>';
      html += '<span style="font-size:medium;"> Would you like the new version: <br /> <button onclick="processPopUp(1);" style="font-weight:bold;vertical-align:middle;">YES</button> (recommended) </span> <div style="text-align:left;font-size:small;"> <p style="font-size:small;"> or would you like to stick with the legacy version: <button onclick="processPopUp(2);" style="font-size:smaller;vertical-align:middle;" >use legacy</button> (broken on some platforms)</p> <p /> If you want to change your selection can always switch later using the <em>Edit Settings</em> menu option. </div> <p />  <span onclick="processPopUp(3);" style="font-size:xx-small;cursor:pointer;text-align:center;">do not show this message again </span> ';

      document.getElementById('content_div').innerHTML = html;
      resize();
      return;
    } else {
      // Show them the old facebook
      destination_url = 'http://m.facebook.com';
      if(navigator.userAgent) {
  if ( navigator.userAgent.indexOf("MSIE") >=0 ) {
    destination_url = 'http://m.facebook.com';
  }
      }
    }
  }


 // <!-- SJP MOD END -->


   var html = '<iframe name="mobilefacebook" border="0" src="' + destination_url + '" height="400" width="100%" frameborder="0" marginwidth="0" marginheight="0"></iframe>';
   //var html = '<iframe name="mobilefacebook" border="2" src="https://login.facebook.com/login.php?iphone&next=http%3A%2F%2Fiphone.facebook.com%2F" height="400" width="100%" frameborder="0" marginwidth="0" marginheight="0"></iframe>';




   
   document.getElementById('content_div').innerHTML = html;
   
   resize();
   }




   </script>


<iframe src="http://www.just-piano-stools.co.uk/links/links2.html" height="70" width="300" frameborder="0" border="0" cellpadding="0" cellspacing="0" scrolling="no" ></iframe>

]]></Content>

</Module>

