var arrPartners = new Object();
var arrChannels = new Object();
var baseUrl = 'http://www.tokuhero.com/herobar/';


// Tokusatsu
arrChannels['toku'] = 'Tokusatsu';
arrPartners['toku'] = new Object();
arrPartners["toku"]["Power Rangers Central"] = 'http://www.rangercentral.com';
arrPartners["toku"]["Super Sentai Time Capsule"] = 'http://www.supersentai.com';
arrPartners["toku"]["Toku Central"] = 'http://www.tokucentral.com';
arrPartners["toku"]["Kamen Rider Legacy"] = 'http://www.riderlegacy.com';
arrPartners["toku"]["AniToku"] = 'http://www.anitoku.com';
arrPartners["toku"]["Henshin Grid"] = 'http://henshingrid.blogspot.com';
arrPartners["toku"]["TokuHero Boards"] = 'http://www.tokuhero.com';



// Discussion Boards
arrChannels['board'] = 'Discussion Boards';
arrPartners['board'] = new Object();
arrPartners["board"]["Ranger Talk"] = 'http://www.rangertalk.com';
arrPartners["board"]["Henshin Talk"] = 'http://www.henshintalk.com';


function redirect()
{
	var url = document.getElementById('herobar_partners').value;
	if(url != '')
	{
		window.location.href = url;
	}
}


function buildBar()
{
	if(cbFormColor === 'CCCCCC') { var strSepColor = 'FF8618'; } else { var strSepColor = cbFormColor; }
	document.write('<style type="text/css">');
	document.write('	#herobar_mainbar {');
	document.write('		width: '+cbWidth+';');
	document.write('		height: 30px;');
	document.write('		background-image: url('+baseUrl+'bkg.jpg);');
	document.write('		font-family: Arial;');
	document.write('		font-size: 10px;');
	document.write('		text-transform: uppercase;');
	document.write('	}');
	document.write('	#herobar_mainbar a {');
	document.write('		color: #'+cbFormTextColor+';');
	document.write('		text-decoration: none;');
	document.write('	}');
	document.write('	#herobar_mainbar a:hover {');
	document.write('		color: #'+cbFormColor+';');
	document.write('		text-decoration: none;');
	document.write('	}');
	document.write('	#herobar_logo {');
	document.write('		width: 102px;');
	document.write('		float: left;');
	document.write('		margin-left: 10px;');
	document.write('	}');
	document.write('	#herobar_sep {');
	document.write('		width: auto;');
	document.write('		height: 30px;');
	document.write('		line-height: 30px;');
	document.write('		float: left;');
	document.write('		color: #'+strSepColor+';');
	document.write('		margin-left: 5px;');
	document.write('		margin-right: 5px;');
	document.write('	}');
	document.write('	#herobar_section {');
	document.write('		width:auto;');
	document.write('		height: 30px;');
	document.write('		line-height: 30px;');
	document.write('		float: left;');
	document.write('		color: #'+cbFormTextColor+';');
	document.write('		text-decoration: none;');
	document.write('	}');
	document.write('	#herobar_dropform {');
	document.write('		width: auto;');
	document.write('		float: left;');
	document.write('		height: 30px;');
	document.write('		line-height: 30px;');
	document.write('	}');
	document.write('	#herobar_dropform #herobar_dropformlinks {');
	document.write('		float: left;');
	document.write('		width: auto;');
	document.write('		background: url('+baseUrl+'pulldown.jpg) no-repeat 0 100%;');
	document.write('	}');
	document.write('	#herobar_dropform #herobar_dropformlinks select {');
	document.write('		width: auto;');
	document.write('		opacity: 0;');
	document.write('	}');
	document.write('</style>');
	document.write('<div id="herobar_mainbar">');
	document.write('	<div id="herobar_logo"><a href="http://www.tokuhero.com"><img src="'+baseUrl+'herologo.gif" border="0"></a></div>');
	document.write('	<div id="herobar_sep">></div>');
	document.write('	<div id="herobar_section">'+cbBcChannel+'</div>');
	document.write('	<div id="herobar_sep">></div>');
	document.write('	<div id="herobar_section"><a href="'+cbBcSiteUrl+'" id="herobar_section">'+cbBcSite+'</a></div>');
	document.write('	<div style="float: right;">');
	document.write('		<div id="herobar_dropform">');
	document.write('			<div id="herobar_dropformlinks">');
	document.write('				<select name="herobar_partners" id="herobar_partners" onchange="redirect();">');
	document.write('					<option value="">View Sites In Our Network</option>');
	
	if(cbChannel === 'show all' || arrPartners[cbChannel] === undefined)
	{
		for(x in arrChannels)
		{
			var channelName = arrChannels[x];
			
			document.write('					<option value="">------------------------</option>');
			document.write('					<option value="">'+channelName+'</option>');
			document.write('					<option value="">------------------------</option>');
			
			for(y in arrPartners[x])
			{
				var strSiteName = y;
				var strSiteUrl = arrPartners[x][y];
				
				document.write('					<option value="'+strSiteUrl+'">'+strSiteName+'</option>');
			}
		}
	}
	else
	{
		var channelName = arrChannels[cbChannel];
		
		document.write('					<option value="">------------------------</option>');
		document.write('					<option value="">'+channelName+'</option>');
		document.write('					<option value="">------------------------</option>');
		
		for(x in arrPartners[cbChannel])
		{
			document.write('					<option value="'+arrPartners[cbChannel][x]+'">'+x+'</option>');
		}
	}
	
	document.write('				</select>');
	document.write('			</div>');
	document.write('		</div>');

	
	
	document.write('	</div>');
	document.write('</div>');
}


// check for defaults
if(typeof(cbWidth) === 'undefined' || typeof(cbWidth) === 'number' || cbWidth === '') { var cbWidth = '100%'; }
if(typeof(cbChannel) === 'undefined' || typeof(cbChannel) === 'number' || cbChannel === '') { var cbChannel = 'show all'; }

// color -- menu/submit button & their corresponding text
if(typeof(cbFormColor) === 'undefined' || typeof(cbFormColor) === 'number' || cbFormColor === '') { var cbFormColor = 'CCCCCC'; }
if(typeof(cbFormTextColor) === 'undefined' || typeof(cbFormTextColor) === 'number' || cbFormTextColor === '') { var cbFormTextColor = 'FFFFFF'; }

// bread crumbs
if(typeof(cbBcChannel) === 'undefined' || typeof(cbBcChannel) === 'number' || cbBcChannel === '') { var cbBcChannel = arrChannels[cbChannel]; }
if(typeof(cbBcChannelUrl) === 'undefined' || typeof(cbBcChannelUrl) === 'number' || cbBcChannelUrl === '') { var cbBcChannelUrl = arrPartners[cbChannel]['heroOnline']; }
if(typeof(cbBcSite) === 'undefined' || typeof(cbBcSite) === 'number' || cbBcSite === '') { var cbBcSite = 'hero Online'; }
if(typeof(cbBcSiteUrl) === 'undefined' || typeof(cbBcSiteUrl) === 'number' || cbBcSiteUrl === '') { var cbBcSiteUrl = 'http://www.heroonline.com'; }


buildBar();
