<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs
title="Amazon Search for iGoogle"
scrolling="true"
height="122"
width="280"
screenshot="http://hosting.gmodules.com/ig/gadgets/file/105645083724165793766/searchamazonscrenshot.PNG"
thumbnail="http://hosting.gmodules.com/ig/gadgets/file/105645083724165793766/searchamazonthumbnail.PNG"
description="Search products on Amazon.com. What is different from other search tools? First, it has better usability. A new tab or window will be opened to display the search results on Amazon.com. Your iGoogle page is not overriden. Secondly, it supports mutilple locales: amazon.com, amazon.jp, amazon.co.uk, amazon.de, amazon.fr, and amazon.ca."

author="Obama Wood"
author_email="wendy4wood@gmail.com"
author_affiliation="igotilike.com"
author_location="Portland, OR, USA"

title_url="http://www.amazon.com/?tag=igil-search-20"
>
  <Require feature="settitle"/>
  <Require feature="setprefs"/>
</ModulePrefs>

<UserPref name="localePref" display_name="Locale" default_value="amazon.com"/>

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

<form name="form" id="amzn-search-form" target="_blank" 
  action="http://www.amazon.com/s?tag=igil-search-20">
<input type="hidden" value="igil-search-20" name="tag">
<table> 
<tr><td>
<div id="searchDiv">Search</div> 
</td>
<td>
<select name="localeSelect" id="localeSelect" title="Search in" style="width: 100%;" onChange="changeLocale();">
<option value="amazon.com" selected="selected">amazon.com</option>
<option value="amazon.jp" selected="selected">amazon.jp</option>
<option value="amazon.co.uk" selected="selected">amazon.co.uk</option>
<option value="amazon.de" selected="selected">amazon.de</option>
<option value="amazon.fr" selected="selected">amazon.fr</option>
<option value="amazon.ca" selected="selected">amazon.ca</option>
</select>
</td>
<td>
  <a id="amazonLink" href="http://www.amazon.com/?tag=igil-search-20"
target="_blank" >
<IMG id="amazonLogo" alt="Amazon Logo" align="center" border="0" padding="1"
src="http://hosting.gmodules.com/ig/gadgets/file/105645083724165793766/amazon-logo.png"
/>
</a>
  </td>
</tr>
  </table> 
  
<table> 
<tr><td>
<div id="deptDiv">Department</div> 
</td>
<td>
<select name="search-alias" id="search-alias" title="Categories" style="width: 98%;">
</select>

  </td>
</tr>
</table>
  
<table style="width: 100%;"> 
      <tr><td>
<input name="keywords" value="" title="Search for"  style="width: 100%;" type="text">
</td>
<td >
<INPUT TYPE="image"  
    SRC="http://hosting.gmodules.com/ig/gadgets/file/105645083724165793766/GO.png" 
    height="25" width="25" vertical-align="middle">
</td>

</tr>
</table>
</form> 
   <script type="text/javascript">
     var searchStr=[];
     searchStr['amazon.com'] = "Search";
     searchStr['amazon.ca'] = "Search";
     searchStr['amazon.co.uk'] = "Search";        
     searchStr['amazon.jp'] = "檢索";
     searchStr['amazon.fr'] = "Recherche";
     searchStr['amazon.de'] = "Suche";
 
     var deptStr=[];
     deptStr['amazon.com'] = "Department";
     deptStr['amazon.ca'] = "Department";
     deptStr['amazon.co.uk'] = "Department";        
     deptStr['amazon.jp'] = "部門";
     deptStr['amazon.fr'] = "Catégorie";
     deptStr['amazon.de'] = "Kategorien";
     
     var logoFileName=[];
     logoFileName['amazon.com'] = "uslogo.gif";
     logoFileName['amazon.ca'] = "calogo.gif";
     logoFileName['amazon.co.uk'] = "uklogo.gif";        
     logoFileName['amazon.jp'] = "jplogo.gif";
     logoFileName['amazon.fr'] = "frlogo.gif";
     logoFileName['amazon.de'] = "delogo.gif";
     
     var all_config=[];
     all_config['amazon.com']=[];
	all_config['amazon.com']['aps'] = "All Departments";
	all_config['amazon.com']['apparel'] = "Apparel &amp; Accessories";
	all_config['amazon.com']['automotive'] = "Automotive";
	all_config['amazon.com']['baby-products'] = "Baby";
	all_config['amazon.com']['beauty'] = "Beauty";
	all_config['amazon.com']['stripbooks'] = "Books";
	all_config['amazon.com']['wireless-aps'] = "Cell Phones &amp; Service";
	all_config['amazon.com']['electronics'] = "Electronics";
	all_config['amazon.com']['misc'] = "Everything Else";
	all_config['amazon.com']['gourmet'] = "Gourmet Food";
	all_config['amazon.com']['grocery'] = "Grocery";
	all_config['amazon.com']['hpc'] = "Health &amp; Personal Care";
	all_config['amazon.com']['garden'] = "Home &amp; Garden";
	all_config['amazon.com']['industrial'] = "Industrial &amp; Scientific";
	all_config['amazon.com']['jewelry'] = "Jewelry";
	all_config['amazon.com']['digital-text'] = "Kindle Store";
	all_config['amazon.com']['magazines'] = "Magazines";
	all_config['amazon.com']['dvd'] = "Movies &amp; TV";
	all_config['amazon.com']['digital-music'] = "MP3 Downloads";
	all_config['amazon.com']['popular'] = "Music";
	all_config['amazon.com']['mi'] = "Musical Instruments";
	all_config['amazon.com']['office-products'] = "Office Products &amp; Supplies";
	all_config['amazon.com']['shoes'] = "Shoes";
	all_config['amazon.com']['software'] = "Software";
	all_config['amazon.com']['sporting'] = "Sports &amp; Outdoors";
	all_config['amazon.com']['tools'] = "Tools &amp; Home Improvement";
	all_config['amazon.com']['toys-and-games'] = "Toys &amp; Games";
	all_config['amazon.com']['vhs'] = "VHS";
	all_config['amazon.com']['videogames'] = "Video Games";
	all_config['amazon.com']['amazontv'] = "Video On Demand";
	all_config['amazon.com']['watches'] = "Watches";
	
	all_config['amazon.ca']=[];	
	all_config['amazon.ca']['aps']="All Departments";
	all_config['amazon.ca']['stripbooks']="Books";
	all_config['amazon.ca']['popular']="Music";
	all_config['amazon.ca']['classical']="Classical Music";
	all_config['amazon.ca']['dvd']="DVD";
	all_config['amazon.ca']['vhs']="VHS";
	all_config['amazon.ca']['electronics']="Electronics";
	all_config['amazon.ca']['software']="Software";
	all_config['amazon.ca']['videogames']="Video Games";

     	all_config['amazon.co.uk']=[];	
	all_config['amazon.co.uk']['aps']="All Departments";
	all_config['amazon.co.uk']['stripbooks']="Books";
	all_config['amazon.co.uk']['electronics']="Electronics";
	all_config['amazon.co.uk']['popular']="Music";
	all_config['amazon.co.uk']['classical']="Classical Music";
	all_config['amazon.co.uk']['music-used']="Used Music";
	all_config['amazon.co.uk']['digital-music']="MP3 Downloads";
	all_config['amazon.co.uk']['dvd']="DVD";
	all_config['amazon.co.uk']['vhs']="VHS";
	all_config['amazon.co.uk']['software']="Software";
	all_config['amazon.co.uk']['videogames']="Video Games";
	all_config['amazon.co.uk']['diy']="DIY &amp; Tools";
	all_config['amazon.co.uk']['outdoor']="Garden &amp; Outdoors";
	all_config['amazon.co.uk']['kitchen']="Kitchen &amp; Home";
	all_config['amazon.co.uk']['drugstore']="Health &amp; Beauty";
	all_config['amazon.co.uk']['beauty']="Beauty";
	all_config['amazon.co.uk']['toys']="Toys &amp; Games";
	all_config['amazon.co.uk']['sports']="Sports &amp; Leisure";
	all_config['amazon.co.uk']['jewelry']="Jewellery";
	all_config['amazon.co.uk']['watches']="Watches";
	all_config['amazon.co.uk']['clothing']="Clothing";
	all_config['amazon.co.uk']['shoes']="Shoes &amp; Accessories";
	all_config['amazon.co.uk']['baby']="Baby";
	all_config['amazon.co.uk']['office-products']="Office Products";

	all_config['amazon.de'] = [];	
	all_config['amazon.de']['aps']="Alle Kategorien";
	all_config['amazon.de']['stripbooks']="Bücher";
	all_config['amazon.de']['english-books']="Englische Bücher";
	all_config['amazon.de']['magazines']="Zeitschriften";
	all_config['amazon.de']['popular']="Musik";
	all_config['amazon.de']['classical']="Klassische Musik";
	all_config['amazon.de']['mp3-downloads']="MP3-Downloads";
	all_config['amazon.de']['dvd']="DVD";
	all_config['amazon.de']['blu-ray']="Blu-ray";
	all_config['amazon.de']['electronics']="Elektronik &amp; Foto";
	all_config['amazon.de']['computer']="Computer";
	all_config['amazon.de']['photo']="Kamera &amp; Foto";
	all_config['amazon.de']['kitchen']="Küche &amp; Haushalt";
	all_config['amazon.de']['diy']="Baumarkt";
	all_config['amazon.de']['automotive']="Auto &amp; Motorrad";
	all_config['amazon.de']['outdoor']="Garten &amp; Freizeit";
	all_config['amazon.de']['drugstore']="Drogerie &amp; Bad";
	all_config['amazon.de']['beauty']="Parfümerie &amp; Kosmetik";
	all_config['amazon.de']['software']="Software";
	all_config['amazon.de']['videogames']="Games";
	all_config['amazon.de']['toys']="Spielzeug";
	all_config['amazon.de']['sports']="Sport &amp; Freizeit";
	all_config['amazon.de']['watches']="Uhren";
	all_config['amazon.de']['jewelry']="Schmuck";
	all_config['amazon.de']['baby']="Babyausstattung";
	all_config['amazon.de']['clothing']="Bekleidung";
	all_config['amazon.de']['shoes']="Schuhe &amp; Handtaschen";
	all_config['amazon.de']['office-products']="Bürobedarf &amp; Schreibwaren";
	all_config['amazon.fr'] = [];	
	all_config['amazon.fr']['aps']="Toutes nos boutiques";
	all_config['amazon.fr']['stripbooks']="Livres en français";
	all_config['amazon.fr']['english-books']="Livres en anglais";
	all_config['amazon.fr']['electronics']="High-tech";
	all_config['amazon.fr']['popular']="Musique";
	all_config['amazon.fr']['classical']="Musique classique";
	all_config['amazon.fr']['mp3-downloads']="Téléchargements MP3";
	all_config['amazon.fr']['dvd']="DVD &amp; Vidéo";
	all_config['amazon.fr']['blu-ray']="Blu-ray";
	all_config['amazon.fr']['software']="Logiciels";
	all_config['amazon.fr']['videogames']="Jeux vidéo";
	all_config['amazon.fr']['toys']="Jeux et Jouets";
	all_config['amazon.fr']['kitchen']="Cuisine &amp; Maison";
	all_config['amazon.fr']['hpc']="Santé et Soins du corps";
	all_config['amazon.fr']['beauty']="Parfum et Beauté";
	all_config['amazon.fr']['watches']="Montres";
	all_config['amazon.fr']['jewelry']="Bijoux";
	all_config['amazon.fr']['office-products']="Fournitures de bureau";
	all_config['amazon.jp'] = [];	
	all_config['amazon.jp']['aps']="Amazon.co.jp";
	all_config['amazon.jp']['stripbooks']="和書";
	all_config['amazon.jp']['english-books']="洋書";
	all_config['amazon.jp']['electronics']="家電&カメラ";
	all_config['amazon.jp']['office-products']="文房具・オフィス用品";
	all_config['amazon.jp']['kitchen']="ホーム&キッチン";
	all_config['amazon.jp']['popular']="ミュージック";
	all_config['amazon.jp']['classical']="クラシック音楽";
	all_config['amazon.jp']['dvd']="DVD";
	all_config['amazon.jp']['software']="PCソフト";
	all_config['amazon.jp']['videogames']="TVゲーム";
	all_config['amazon.jp']['toys']="おもちゃ";
	all_config['amazon.jp']['sporting']="スポーツ&アウトドア";
	all_config['amazon.jp']['hpc']="ヘルス&ビューティー";
	all_config['amazon.jp']['beauty']="コスメ";
	all_config['amazon.jp']['food-beverage']="食品&飲料";
	all_config['amazon.jp']['watch']="時計";
	all_config['amazon.jp']['jewelry']="ジュエリー";
	all_config['amazon.jp']['baby']="ベビー&マタニティ";
	all_config['amazon.jp']['apparel']="アパレル&ファッション雑貨";


     var prefs = new _IG_Prefs();

     function changeLocale() {
       var locales = _gel("localeSelect");
       var locale = locales.options[locales.selectedIndex].value;
       prefs.set("localePref", locale);
       _gel("amzn-search-form").action = "http://www."+locale + "/s?tag=igil-search-20";
       var categories = _gel("search-alias");        
       var childCnt = categories.childNodes.length;
       for(var i=0; i<childCnt; i++ ) {
          categories.removeChild(categories.childNodes[childCnt-1-i]);
       };
       for(var alias in all_config[locale]) {
         var option = document.createElement("option");
         option.value=alias;
         var txt = all_config[locale][alias].replace(/&amp;/g,"&");
         option.text=txt;
         categories.appendChild(option);
       }
       categories.selectedIndex=0;
     
       _gel("amazonLink").href = "http://www."+locale + "/?tag=igil-search-20";
       _gel("amazonLogo").src = "http://hosting.gmodules.com/ig/gadgets/file/105645083724165793766/" 
          + logoFileName[locale];     
       _gel("searchDiv").innerHTML = searchStr[locale];
       _gel("deptDiv").innerHTML = deptStr[locale];
     
     }
     
     function init() {
       var locale = prefs.getString("localePref");
       if(!locale) {
         locale = "amazon.com";
       }
       var locales = _gel("localeSelect");
     for(var i=0; i<locales.options.length; i++) {
       if(locales.options[i].value == locale)  {
         locales.options[i].selected = true; 
         break;
       }
     }
       changeLocale();
     }
  
    _IG_RegisterOnloadHandler(init());
</script>

]]>
</Content> 
</Module> 
