<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Paranormal Quote" description="Paranormal Quote" height="180" width="250" thumbnail="http://hosting.gmodules.com/ig/gadgets/file/108897725285684518933/gbanner.png" screenshot="http://hosting.gmodules.com/ig/gadgets/file/108897725285684518933/screen.png" author_email="ghostwriter@spectralreview.com" title_url="http://www.spectralreview.com" author="Doug Barnum" author_location="Johnstown, NY" category="lifestyle" category2="communication" scrolling="true">
    <Require feature="analytics"/>
</ModulePrefs>

<UserPref name="bgcolor" display_name="Background Color" default_value="White" datatype="enum" >

    <EnumValue value="Aqua" />
    <EnumValue value="Black" />
    <EnumValue value="Blue" />
    <EnumValue value="Fuchsia" />
    <EnumValue value="Gray" />
    <EnumValue value="Green" />
    <EnumValue value="Lime" />
    <EnumValue value="Maroon" />
    <EnumValue value="Navy" />
    <EnumValue value="Olive" />
    <EnumValue value="Orange" />
    <EnumValue value="Pink" />
    <EnumValue value="Purple" />
    <EnumValue value="Red" />
    <EnumValue value="Yellow" />
    <EnumValue value="White" />

</UserPref>

<UserPref name="textcolor" display_name="Quote Text Color" default_value="Black" datatype="enum" >

    <EnumValue value="Aqua" />
    <EnumValue value="Black" />
    <EnumValue value="Blue" />
    <EnumValue value="Fuchsia" />
    <EnumValue value="Gray" />
    <EnumValue value="Green" />
    <EnumValue value="Lime" />
    <EnumValue value="Maroon" />
    <EnumValue value="Navy" />
    <EnumValue value="Olive" />
    <EnumValue value="Orange" />
    <EnumValue value="Pink" />
    <EnumValue value="Purple" />
    <EnumValue value="Red" />
    <EnumValue value="Yellow" />
    <EnumValue value="White" />

</UserPref>

<UserPref name="namecolor" display_name="Author Text Color" default_value="Black" datatype="enum" >

    <EnumValue value="Aqua" />
    <EnumValue value="Black" />
    <EnumValue value="Blue" />
    <EnumValue value="Fuchsia" />
    <EnumValue value="Gray" />
    <EnumValue value="Green" />
    <EnumValue value="Lime" />
    <EnumValue value="Maroon" />
    <EnumValue value="Navy" />
    <EnumValue value="Olive" />
    <EnumValue value="Orange" />
    <EnumValue value="Pink" />
    <EnumValue value="Purple" />
    <EnumValue value="Red" />
    <EnumValue value="Yellow" />
    <EnumValue value="White" />

</UserPref>

<UserPref name="fontweight" display_name="Font Weight" default_value="normal" datatype="enum" >

    <EnumValue value="normal" />
    <EnumValue value="bold" />
    <EnumValue value="bolder" />
    <EnumValue value="lighter" />
    <EnumValue value="100" />
    <EnumValue value="200" />
    <EnumValue value="300" />
    <EnumValue value="400" />
    <EnumValue value="500" />
    <EnumValue value="600" />
    <EnumValue value="700" />
    <EnumValue value="800" />
    <EnumValue value="900" />

</UserPref>

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

<script>
  _IG_Analytics("UA-2778514-1", "/quote");
</script>

<div id="content_div" style="height:100%">

<table>
    <tr>
        <td id="thumb"><img src="http://hosting.gmodules.com/ig/gadgets/file/108897725285684518933/thumb.png" width="65" height="70"></td>
        <td id="quote">
            <table>
                <tr>
                    <td id="text" style="font-size:11pt; font-style: italic; padding:5px;"></td>
                </tr>
                <tr>
                    <td id="name" style="font-size:11pt; padding:5px;"></td>
                </tr>
            </table>
        </td>
    </tr>
</table>

</div>


<script type="text/javascript">

var prefs = new _IG_Prefs();

function displayQuote() {

    // Setup all user preferences.
    var element = document.getElementById("content_div");
    element.style.backgroundColor = prefs.getString("bgcolor");
    element = document.getElementById("text");
    element.style.color = prefs.getString("textcolor");
    element.style.fontWeight = prefs.getString("fontweight");
    element = document.getElementById("name");
    element.style.color = prefs.getString("namecolor");
    element.style.fontWeight = prefs.getString("fontweight");

    var url = "http://www.spectralreview.com/random-paranormal-quote";

    _IG_FetchXmlContent(url, function (response) {

        if ((response == null) || (typeof(response) != "object")
            || (response.firstChild == null)) {

            _gel("content_div").innerHTML = "<i>Invalid data.</i>";
            return;
        }

        var text = "";
        var name = "";
        var quote = response.getElementsByTagName("Quote");
        if (quote.length == 1) {

            var texts = quote[0].getElementsByTagName("Text");
            if (texts.length == 1) {

                text = texts[0].firstChild.nodeValue;
                var names = quote[0].getElementsByTagName("Name");
                if (names.length == 1) {
                    name = names[0].firstChild.nodeValue;
                }
            }
        }
        _gel("text").innerHTML = text;
        _gel("name").innerHTML = "-- " + name;
    }, {refreshInterval: (60 * 10)});
}

_IG_RegisterOnloadHandler(displayQuote);
</script>

]]>
</Content>
</Module>

