<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="__MSG_title__"
             render_inline="required"
             screenshot="/ig/modules/googlelogo.png"
             thumbnail="/ig/modules/googlelogo-thm.png"
             category="tools" category2="funandgames"
             author="Adam S."
             author_email="adam.feedback+googlelogo@gmail.com"
             author_affiliation="Google Inc."
             author_location="Santa Cruz, CA"
             description="__MSG_description__">
  <Locale messages="googlelogo_content/en_ALL.xml"/>
  <Locale lang="ar" messages="googlelogo_content/ar_ALL.xml" language_direction="rtl"/>
  <Locale lang="bg" messages="googlelogo_content/bg_ALL.xml"/>
  <Locale lang="ca" messages="googlelogo_content/ca_ALL.xml"/>
  <Locale lang="cs" messages="googlelogo_content/cs_ALL.xml"/>
  <Locale lang="de" messages="googlelogo_content/de_ALL.xml"/>
  <Locale lang="el" messages="googlelogo_content/el_ALL.xml"/>
  <Locale lang="en" messages="googlelogo_content/en_ALL.xml"/>
  <Locale lang="es" messages="googlelogo_content/es_ALL.xml"/>
  <Locale lang="et" messages="googlelogo_content/et_ALL.xml"/>
  <Locale lang="fr" messages="googlelogo_content/fr_ALL.xml"/>
  <Locale lang="fil" messages="googlelogo_content/tl_ALL.xml"/>
  <Locale lang="hi" messages="googlelogo_content/hi_ALL.xml"/>
  <Locale lang="hr" messages="googlelogo_content/hr_ALL.xml"/>
  <Locale lang="hu" messages="googlelogo_content/hu_ALL.xml"/>
  <Locale lang="hy" messages="googlelogo_content/hy_ALL.xml"/>
  <Locale lang="id" messages="googlelogo_content/id_ALL.xml"/>
  <Locale lang="is" messages="googlelogo_content/is_ALL.xml"/>
  <Locale lang="it" messages="googlelogo_content/it_ALL.xml"/>
  <Locale lang="ja" messages="googlelogo_content/ja_ALL.xml"/>
  <Locale lang="ko" messages="googlelogo_content/ko_ALL.xml"/>
  <Locale lang="lt" messages="googlelogo_content/lt_ALL.xml"/>
  <Locale lang="lv" messages="googlelogo_content/lv_ALL.xml"/>
  <Locale lang="ms" messages="googlelogo_content/ms_ALL.xml"/>
  <Locale lang="nl" messages="googlelogo_content/nl_ALL.xml"/>
  <Locale lang="pl" messages="googlelogo_content/pl_ALL.xml"/>
  <Locale lang="pt-br" messages="googlelogo_content/pt-br_ALL.xml"/>
  <Locale lang="pt-pt" messages="googlelogo_content/pt-pt_ALL.xml"/>
  <Locale lang="ro" messages="googlelogo_content/ro_ALL.xml"/>
  <Locale lang="ru" messages="googlelogo_content/ru_ALL.xml"/>
  <Locale lang="sk" messages="googlelogo_content/sk_ALL.xml"/>
  <Locale lang="sl" messages="googlelogo_content/sl_ALL.xml"/>
  <Locale lang="sr" messages="googlelogo_content/sr_ALL.xml"/>
  <Locale lang="th" messages="googlelogo_content/th_ALL.xml"/>
  <Locale lang="tl" messages="googlelogo_content/tl_ALL.xml"/>
  <Locale lang="tr" messages="googlelogo_content/tr_ALL.xml"/>
  <Locale lang="uk" messages="googlelogo_content/uk_ALL.xml"/>
  <Locale lang="vi" messages="googlelogo_content/vi_ALL.xml"/>
  <Locale lang="zh-cn" messages="googlelogo_content/zh-cn_ALL.xml"/>
  <Locale lang="zh-tw" messages="googlelogo_content/zh-tw_ALL.xml"/>
</ModulePrefs>
<UserPref name="logo" display_name="__MSG_logo__" datatype="enum" default_value="http://www.google.com/images/logo_sm.gif">
  <EnumValue value="0" display_value="__MSG_plain__" />
  <EnumValue value="1" display_value="__MSG_random__" />
  <EnumValue value="2" display_value="__MSG_google_bday__" />
  <EnumValue value="3" display_value="__MSG_anzac__" />
  <EnumValue value="4" display_value="__MSG_bastille__" />
  <EnumValue value="6" display_value="__MSG_childrens_04__" />
  <EnumValue value="7" display_value="__MSG_earth_03__" />
  <EnumValue value="8" display_value="__MSG_earth_04__" />
  <EnumValue value="9" display_value="__MSG_euro__" />
  <EnumValue value="10" display_value="__MSG_fathers__" />
  <EnumValue value="11" display_value="__MSG_fi_se__" />
  <EnumValue value="12" display_value="__MSG_halloween__" />
  <EnumValue value="13" display_value="__MSG_hitchcock__" />
  <EnumValue value="14" display_value="__MSG_joyce__" />
  <EnumValue value="15" display_value="__MSG_fractals__" />
  <EnumValue value="16" display_value="__MSG_us_independence__" />
  <EnumValue value="17" display_value="__MSG_korea__" />
  <EnumValue value="18" display_value="__MSG_leap_year__" />
  <EnumValue value="19" display_value="__MSG_lunar_new_years__" />
  <EnumValue value="20" display_value="__MSG_mars__" />
  <EnumValue value="23" display_value="__MSG_mothers__" />
  <EnumValue value="24" display_value="__MSG_new_years__" />
  <EnumValue value="25" display_value="__MSG_persian_new_years__" />
  <EnumValue value="26" display_value="__MSG_poppies__" />
  <EnumValue value="27" display_value="__MSG_ray_charles__" />
  <EnumValue value="28" display_value="__MSG_st_david__" />
  <EnumValue value="29" display_value="__MSG_st_george__" />
  <EnumValue value="30" display_value="__MSG_s_oly_open__" />
  <EnumValue value="31" display_value="__MSG_s_oly_close__" />
  <EnumValue value="36" display_value="__MSG_s_oly_soccer__" />
  <EnumValue value="37" display_value="__MSG_s_oly_swim__" />
  <EnumValue value="40" display_value="__MSG_s_oly_tae_kwon_do__" />
  <EnumValue value="43" display_value="__MSG_s_oly_weight_lift__" />
  <EnumValue value="44" display_value="__MSG_switzerland__" />
  <EnumValue value="46" display_value="__MSG_valentines__" />
  <EnumValue value="47" display_value="__MSG_venus__" />
  <EnumValue value="48" display_value="__MSG_vote__" />
  <EnumValue value="49" display_value="__MSG_winter_03__" />
  <EnumValue value="50" display_value="__MSG_winter_04__" />
  <EnumValue value="51" display_value="__MSG_xprize__" />
  <EnumValue value="52" display_value="__MSG_braille__" />
  <EnumValue value="53" display_value="__MSG_mozart__" />
  <EnumValue value="54" display_value="__MSG_persian_new_year_new__" />
  <EnumValue value="55" display_value="__MSG_google_beta_1999__" />

</UserPref>
<UserPref name="delay" display_name="__MSG_delay__" default_value="10"/>
<UserPref name="newdoodles" display_name="__MSG_new_doodles__" datatype="bool" default_value="true"/>
<Content type="html"><![CDATA[
<script language="JavaScript">
  var doodleTimerID__MODULE_ID__ = 0;
  var doodles__MODULE_ID__ = [
    "plain",
    "random",
    "6th_birthday.gif",
    "anzac_day_04.gif",
    "bastilleday04.gif",
    "childrens_day03.gif",   // retired
    "childrens_day04.gif",
    "earthday03.gif",
    "earthday04.gif",
    "euro2004gr.gif",
    "fathersday04.gif",
    "fi_se_labour.gif",
    "halloween04.gif",
    "hitchcock.gif",
    "james_joyce.gif",
    "julia.gif",
    "july4th04.gif",
    "korea03.gif",
    "leapyear.gif",
    "lunarnewyear04.gif",
    "mars_rover.gif",
    "melbourne_cup.gif",  // retired
    "mothers_day03.gif",  // retired
    "mothers_day04.gif",
    "newyear04.gif",
    "persian_newyear.gif",
    "poppy03.gif",
    "ray.gif",
    "st_david.gif",
    "stgeorge04.gif",
    "summer2004_opening.gif",
    "summer2004_closing.gif",
    "summer2004_archery.gif",  // retired
    "summer2004_fencing.gif",  // retired
    "summer2004_gymnastics.gif",  // retired
    "summer2004_hurdles.gif",  // retired
    "summer2004_soccer.gif",
    "summer2004_swimming.gif",
    "summer2004_synchro_swim.gif",  // retired
    "summer2004_table.gif",  // retired
    "summer2004_taekwondo.gif",
    "summer2004_tennis.gif",  // retired
    "summer2004_volleyball.gif",  // retired
    "summer2004_weightlifting.gif",
    "swiss.gif",
    "thanksgiving04.gif",  // retired
    "valentines04.gif",
    "venus.gif",
    "vote2004.gif",
    "winter_holiday_03_1.gif",
    "winter_holiday_04_1.gif",
    "xprize.gif",
    "braille_res.gif",
    "mozart_res.gif",
    "persian_newyear06res.gif",
    "googlebeta.gif",
  ];

  function setDoodle__MODULE_ID__(img) {
    var logo = _gel('regular_logo');
    if (logo == null) { return; }   // some other gadget removed the logo
    logo.style.background = "url('/ig/googlelogo_content/logos/" + img + "') left top no-repeat";
  }

  function randomDoodle__MODULE_ID__() {
    // first two entries are special
    var n = Math.round(Math.random()*(doodles__MODULE_ID__.length-2));
    setDoodle__MODULE_ID__(doodles__MODULE_ID__[n+2]);
  }

  function destroyDoodle__MODULE_ID__() {
     if(doodleTimerID__MODULE_ID__) {
        clearInterval(doodleTimerID__MODULE_ID__);
        doodleTimerID__MODULE_ID__  = 0;
     }
  }

  function is_skinned__MODULE_ID__() { return _gel('ext_css').href != null; }
  function has_newdoodle__MODULE_ID__() { return _gel('regular_logo') == null; }

  function runDoodle__MODULE_ID__() {
    var prefs = new _IG_Prefs(__MODULE_ID__);
    if (prefs.getBool("newdoodles") && has_newdoodle__MODULE_ID__()) {
       // show the new doodle instead of the user-selected one
       return;
    }

    var src = doodles__MODULE_ID__[prefs.getInt("logo")];
    if (src == "plain") {
      return;
    } else if  (src == "random") {
      randomDoodle__MODULE_ID__();
      doodleTimerID__MODULE_ID__ = setInterval("randomDoodle__MODULE_ID__()", prefs.getInt("delay") * 1000);
      window.onunload = "destroyDoodle__MODULE_ID__()";
    } else {
      setDoodle__MODULE_ID__(src);
    }
  }

  _IG_RegisterOnloadHandler(runDoodle__MODULE_ID__);
</script>
]]></Content>
</Module>
