// Kickass Webcomics Exchange - javascript
// by Akira Hasegawa
//
// This script randomly picks one site and display its banner and link whenever page is loaded.

// open to selected URL
function goto_URL( object ) { open(object.options[object.selectedIndex].value) };

// website object
function website( image, address, title, description ) {
	this.image = image; // image of banner
	this.address = address; // homepage address
	this.title = title; // title of homepage
	this.description = description; // description of homepage
	websites[ websites.length ] = this; // adds to a website list
}

// kickass webcomics data
var websites = new Array();
new website( "images/kwe/kwasif.gif", "http://www.asifcomic.com", "As If!", "" );
new website( "images/kwe/kwcascadia.gif", "http://cascadia.verunne.net/", "Cascadia", "" );
new website( "images/kwe/kwceph.gif", "http://www.roadhunter.com/~ceph/", "Ceph", "Project Squidship" );
new website( "images/kwe/kwdedos.gif", "http://chriton.org/dedos", "Dedos", "An Elfin Tale" );
new website( "images/kwe/kwd101.gif", "http://faith.rydia.net", "Demonology 101", "" );
new website( "images/kwe/kweattheroses.gif", "http://www.eattheroses.com", "Eat the Roses", "" );
new website( "images/kwe/kwelflife.gif", "http://www.elflife.com", "Elf Life", "" );
new website( "images/kwe/kweversummereve.gif", "http://www.eversummereve.com", "Eversummer Eve", "" );
new website( "images/kwe/kwfmsapheire.gif", "http://fatemartyrsapheire.keenspace.com", "Fate Martyr Sapheire", "" );
new website( "images/kwe/kwflipside.gif", "http://www.flipsidecomics.com/home.html", "Flip Side", "" );
new website( "images/kwe/kweunice.gif", "http://www.xepher.net/~ghosthunters", "Ghost Hunters", "by Eunice Phan" );
new website( "images/kwe/kwlanglang.gif", "http://langlang.keenspace.com", "Lang Lang", "Where the East Meets the West!" );
new website( "images/kwe/kwlovaria.gif", "http://www.lovaria.com", "Lovarian Adventures", "A Tale of High Fantasy" );
new website( "images/kwe/kwngti.gif", "http://kiwi.keenspace.com", "Not Gonna Take It", "" );
new website( "images/kwe/kwponju.gif", "http://www.ponju.com", "pOnju", "Webcomics: PiggyHunter!, Chiga and Kaput" );
new website( "images/kwe/kwshadowfall.gif", "http://www.kyokipress.com/shadowfall", "ShadowFall", "Sci-fi espionage and adventure" );
new website( "images/kwe/kwsof.gif", "http://zodiac.mine.nu", "Strings of Fate", "Urban fairy tale" );
new website( "images/kwe/kwstubble.gif", "http://www.stubblecomics.com", "Stubble", "" );
new website( "images/kwe/kwelves.gif", "http://www.elfcomic.com", "There Be Elves", "" );
new website( "images/kwe/kwtsunami.gif", "http://tsunamichan.keenspace.com", "Tsunami Channel", "" );
new website( "images/kwe/kwwish3.gif", "http://www.wish3.net/main.html", "Wish3", "" );
var site = websites[ Math.floor( websites.length * Math.random() ) ];

// write documents
document.writeln( '<TABLE WIDTH=200 BGCOLOR="#666699" CLASS="nospace"><FORM><TR>');
document.writeln( '<TD colspan=2><A HREF="' + site.address + '"><IMG SRC="' + site.image+ '" ALT="' + site.address + '" WIDTH=200 HEIGHT=40 BORDER=0 onMouseover="window.status=\'' + site.title + " : " + site.description + '\'; return true;" onMouseOut="status=\'\';return true"></A><\/TD>');
document.writeln('<\/TR><TR><TD align="left"><SELECT NAME="selectName" onChange="goto_URL( this.form.selectName )">');
document.writeln('<OPTION VALUE="http://www.pOnju.com/kwexchange.php">--Kickass-Webcomics--<\/OPTION>');
for( var i = 0; i < websites.length; i++ ) {
	document.writeln('<OPTION VALUE="' + websites[ i ].address+ '">' + websites[ i ].title + '<\/OPTION>');
}
document.writeln('<\/SELECT><\/TD>');
document.writeln('<TD align="left"><A HREF="http://www.pOnju.com/kwexchange.php"><IMG SRC="images/kwe/pbeicon.gif" BORDER=0 ALT="Kickass Webcomics Exchange"><\/A><\/TD>');
document.writeln('<\/TR><\/FORM><\/TABLE>');
