//Links Page Java Script
//Andrew "DaBooda" Stickney
//Generates links for page, this makes it easier to add more, or delete some, etc...html is too bulky

//Counter for Link Categorys
var catCount = 0;	//Reset it

var catLink = new Array();	//Main category arrays

//catLink[index][0] = title of category
//catLink[index][1] = description of category
//catLink[index][2] = default id, for windows
//catLink[index][3+lindex][0] = link title
//catLink[index][3+lindex][1] = link description
//catLink[index][3+lindex][2] = link url
catLink[catCount] = new Array('Game Directories and Developer Sites', 'These links are to directories of free public domain games created by programmers. These are not language specific but are geared towards just games created by other programmers. Also are links to other fellow programmer sites, be sure to check them out.', 'gamelink',
	new Array('Freebasic Games Directory', 'Site offers all games created by developers of the FreeBasica language. Games are rated, have comments, and are very well organized. This is a must look, for there are some really great 2D games on the site', 'http://www.games.freebasic.net/'),
	new Array('Ragnarok Games', 'A developer site where the whole idea is old school 2d. These guys grew up playing that 8-bit beast of power, aka the dirty grey box. They know it does not take much to make a classic game.', 'http://ragnarokgames.googlepages.com/index.htm'),
	new Array('Lachie Dazdarian: The maker of Stuff','This developer maintains the Freebasic Games directory and has many great titles under his belt, one being Barren, a great point and click adventure game with awesome atmosphere. You should check out this site now and I am not just saying that because he threatened my life with a frozen sausage.','http://lachie.phatcode.net/'),
	new Array('iMakeGames','iMakeGames is a developer site maintained by Vincent DeCampo. He is a great old school programmer with such title remakes as Beserker and Star Castle. If you like old school stand up arcade games, this is the site for you.', 'http://www.imakegames.com/'),
	'null');
catCount++
	
catLink[catCount] = new Array('Developer Links', 'These links are strictly programming related. Most sites contain tutorials, resources, forums and anything that helps make your programming easier.','devLink',
	new Array('FreeBasic Gaming Forum','This site is dedicated to two things: FreeBasic and Game Programming. Very great site with a good community.','http://www.games.freebasic.net/forum/'),
	new Array('FreeBasic','This is your last stop for programming, trus me. They also have a very good forum, one of the best','http://www.freebasic.net/'),
	new Array('GPWiki', 'The Game Programming Wiki, is a great source for developers. It covers all languages, has a great forum, and plenty of tutorials. Join this forum today, trust us.','http://www.gpwiki.org/'),
	'null');	//ends category
catCount++;		//increment Count

catLink[catCount] = new Array('Game Libraries, Wrappers, & Engines', 'These libraries are very useful for game creation in the fact that they remove all that hardware worry and grunt work. This way you can totally concentrate on creating the game.','lib',
	new Array('HGE Game Library','Awesome game library that utilizes 3D Hardware programming for 2D. This is very nice and is the basis of most of our games. It is event driven and more geared towards windows developers, so it might have a learning curve for some. It does have many tutorials and a well documented refernce though.', 'http://hge.relishgames.com'),
	new Array('Allegro Game Library','Perhaps one of the best gaming libraries ever. Strictly for C or FreeBasic users, this will have you programming a game in a matter of hours. Complete with full reference, and many utilities its a must have for developers.','http://www.talula.demon.co.uk/allegro/'),
	new Array('BASS DLL Audio','Want to make a commerercial game, with great audio, well here you go. Its free all the way, and it is very compact. Less than a 100kbs!! I recommend this one for freeware also.','http://www.un4seen.com/'),
	new Array('FMOD Audio Library','This is a really good audio library, if and only if you are making a freeware game. Otherwise, be ready to shell out a whopping 1000$, sheesh. The bonus, it tends to handle some audio formats better than BASS.','http://www.fmod.org/'),
	'null');
catCount++;

catLink[catCount] = new Array('Video Game Console Emulation, Development, and Information','These links are strictly for the old schooler and only pertain to home video game console systems. If you grew up like we did, staying up late hours into the night beating that NES title. These are for you.', 'vdgc',
	new Array('Classic Gaming','The most informative video game console systems information site on the web. You want to know about a certain machine, no matter how obscure, we guarantee it is here.','http://www.classicgaming.com/'),
	new Array('Zophar\'s Domain','If you are into emulation, like we are, this is the site for you. It has information, emulators, and utilities for every machine you can think about, even computer emulation. This site is just packed full and you will spend hours there.','http://www.zophar.net/'),
	new Array('NES DEV','The only true source left for Nintendo HomeBrew Development. This site has many resources into the lost art of nesdev. Nintendo enthusiasts be sure to check this one out.','http://nesdev.parodius.com/'),
	new Array('TONC GBA','The best source for hardcore GBA development. It has a complete overview and tutorial on programming for that beast in C. It will be your last stop for it.','http://user.chem.tue.nl/jakvijn/tonc/'),
	new Array('Dragon Basic','If you wish to make GBA games, but don\'t want to do it in C. This is the solution, its programming for the GBA in native Basic language. Good Stuff.','http://db.zhilaware.starfusion.org/'),
	'null');
catCount++;

function writeLinks()	{	//This function writes all links to the page
	var index=0; var lindex=0;	//counters
	//Loop through categories
	for(index=0; index<catCount; index++) {
		document.write('<hr />');
		//open window, fill in information
		winAdd(1, catLink[index][2], catLink[index][0]);
		document.write('<div class="sub_div">');
		document.write('<div class="sub_p">' + catLink[index][1] + '</div>');
		//document.write('</div>');	//make sure to close divider
		//loop through, open link windows, and write link information, this is huge, but saves tons of room
		lindex=0;	//reset lindex
		while(catLink[index][3+lindex]!='null')	{	//remember 'null' ends link listing
			//first add the divider, and fill it in
			document.write('<div class="sub_divBox">');
			//divider caption and link
			document.write('<a class="sub_caption" href="' + catLink[index][3+lindex][2] + '">' + catLink[index][3+lindex][0] + '</a>');
			//divider description
			document.write('<div class="sub_p">' + catLink[index][3+lindex][1] + '</div>');
			//close divider
			document.write('</div>');
			//increment counter
			lindex++;
		}
		//Write footer
		document.write('</div>');
		document.write('<div class="sub_footer"><a class="to_top" href="#page_top"></a></div>');
		//close main window, and loop
		document.write('</div>');
	}
}