<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="The Simpsons Quotes"
title_url="http://www.livegoog.com"
directory_title="The Simpsons Quotes and Images For The Day"
description="A huge collection of funny quotes and images from 'The Simpsons' cartoon TV show. Read your favorite quotes from Homer, Marge, Bart, Lisa and others. You can also view a larger image of the displayed thumbnails. Note - you can change the delay and display order using 'Edit Settings'."
render_inline="optional"
author="LiveGoog"
author_affiliation="www.livegoog.com"
author_email="livegoog@gmail.com"
author_link="http://www.livegoog.com"
author_quote="LiveGoog - Free, fun Google utilities !"
screenshot="http://upload.wikimedia.org/wikipedia/en/a/a0/C-SimpFamily.png"
thumbnail="http://livegoog.googlepages.com/simpsons_title.jpg"
category="funandgames" category2="lifestyle"
height="410"
width="300"
>
<Require feature="analytics" />
</ModulePrefs>

<UserPref name="Delay" display_name="Enter Delay (in seconds)" default_value="90"/>
<UserPref name="Order" display_name="Display Order" datatype="enum" default_value="s">
<EnumValue value="s" display_value="Sequential" />
<EnumValue value="r" display_value="Random" />
</UserPref>
<Content type="html">
<![CDATA[
<script>
// Track this gadget using Google Analytics.
_IG_Analytics("UA-2979131-1", "/Simpsons_Quote");
</script>

<!-- check for active mirror -->
<script>
var mirrorList = ["http://livegoog.com/Gadgets","http://kkjkkj.hostingtribe.com/Gadgets","http://livegoog.x10hosting.com/Gadgets"];
var lastActiveMirror="";
var activeMirror="";
var pingWait = 1000;
var retryDelay = 1000;
var monitorDelay = (__UP_Delay__-1) * 1000; // monitoring
if(monitorDelay < 2000)
monitorDelay = 2000; // upper limit
var ImgArr = new Array(mirrorList.length);
initMirrorCheck();
//setTimeout(initMirrorCheck,1);
function initMirrorCheck()
{
// reset
activeMirror="";
for(var i=0;i<mirrorList.length;i++)
{
ImgArr[i] = new Image();
// requests within 5 seconds will be cached, others will not be (used for slower connections)
ImgArr[i].src= mirrorList[i] + "/Ping/pingcheck.bmp?nocache=" + parseInt((new Date).getTime()/5000);
}
setTimeout(verifyMirror,pingWait);
}

function verifyMirror()
{
for(var i=0;i<mirrorList.length;i++)
{
// check whether last active mirror is active -> then do nothing
if(ImgArr[i].height>0 && mirrorList[i]== lastActiveMirror)
{
// schedule next monitor check
setTimeout(initMirrorCheck,monitorDelay);
return;
}

// choose the first active mirror
if(activeMirror == "" && ImgArr[i].height > 0)
{
activeMirror = mirrorList[i];
}
}

// determine next mirror check
if(activeMirror == "")
{
// no disp code here
nodisp();
lastActiveMirror = "";
setTimeout(initMirrorCheck,retryDelay);
}
else
{
// call the function which does the work (iframe display)
disp();
lastActiveMirror = activeMirror;
// monitoring disabled
//setTimeout(initMirrorCheck,monitorDelay-pingWait);
}
}

function disp()
{
var prefs = new _IG_Prefs();
var addr = activeMirror + '/Simpsons/The_Simpsons_Quote_Gadget.php?delay=';
addr += __UP_Delay__;

// mode
if(prefs.getString("Order")=="r")
{
addr += '&random=true';
}

document.getElementById("contframe").src = addr;
// adjust iframe width to 32% of screen width
//document.getElementById("contframe").style.width = parseInt(screen.width*32/100) - 35;
}

function nodisp()
{
document.getElementById("contframe").src = "http://livegoog.googlepages.com/error.html?imglink=250px-C-SimpFamily.png";
}
</script>
<iframe id="contframe" frameborder="0" scrolling="no" height="410" width="100%">
]]></Content>
</Module>
