// drowtales website sections dropdown box with ariel sprite
// written by mladyjade (mladyjade@yahoo.com) for Kern of http://www.drowtales.com
// do not reuse without permission

// happy 21st birthday Kern!

/********************************************************************************************/
// field 0 - URL for the link
// field 1 - title of the link
// field 2 - URL to the image for the link, if it exists.

var websecLinkList = [
   ["","Drowtales Sections"],
   ["http://www.drowtales.com/fantasyexchange/"        ,"Fantasy Banner Exchange"],
   ["http://www.drowtales.com/kaki/"                   ,"Oekaki Board"],
   ["http://www.drowtales.com/ua/"                     ,"Underground Arts"],
   ["http://www.drowtales.com/drowforums/"             ,"Forums"],
   ["http://www.drowtales.com/~momc"                   ,"MOMC Art Contest"],
   ["http://www.drowtales.com/toplists/"               ,"Webcomic Topsites"],
   ["http://www.drowtales.com/index.php?section=media" ,"Media (mp3,video,etc...)"],
   ["http://www.drowtales.com/~world"                  ,"World Settings"],
   ["http://www.drowtales.com/index.php?section=about" ,"About"],
   ["http://www.drowrpg.com"                           ,"Videogames"]
];

var ari_sprite_txt = "onmouseover=\"return drowtales_sections();\" onmouseout=\"return ari_mouseout();\"";

/********************************************************************************************/

var OP = (navigator.userAgent.indexOf('Opera')>-1);
var NS = (document.getElementById&&!document.all);
var IE = (document.all);

function getWebSecItems() {
   var itxt = "<option selected value =''>" + websecLinkList[0][1] + "</option>\n";
   for ( i = 1 ; i < websecLinkList.length ; i++ ) {
      if ( websecLinkList[i][0] ) {
         itxt += "<option value = '" + websecLinkList[i][0] + "'>";
      } else {
         itxt += "<option value=''>";
      }
      itxt += websecLinkList[i][1] + "</option>\n";
   }
   return itxt;
}

function getWebSecDoChange() {
   var cdctxt;
   if (NS) {
	   cdctxt = "if (document.getElementById('websecdropdown').selectedIndex != 0) document.location = document.getElementById('websecdropdown').options[document.getElementById('websecdropdown').selectedIndex].value; else alert('Select a manga!');";
   } else { 
	   cdctxt = "if (document.all('websecdropdown').selectedIndex != 0) document.location = document.all('websecdropdown').options[document.all('websecdropdown').selectedIndex].value; else alert('Select a manga!');";
   }
   return cdctxt;
}

function writeWebSecBox() {
   var doChange = getWebSecDoChange();
   var wstxt;
   
   wstxt  = "<SELECT width=175 class='drowdropdown' NAME='websecdropdown'";
   wstxt += "ID='websecdropdown' SIZE=1 LANGUAGE=javascript ";
   wstxt += ari_sprite_txt;
   wstxt += "onchange=\"" + doChange + "\">";
   
   wstxt += getWebSecItems();
   
   // end box
   wstxt += "</select>\n";
   
   document.write(wstxt);
}

/********************************************************************************************/

writeWebSecBox();