var arrPartners = new Object();
var arrChannels = new Object();

// Film & TV
arrChannels['filmtv'] = 'Film & TV';
arrPartners['filmtv'] = new Object();
arrPartners["filmtv"]["ComingSoon.net"] = 'http://www.comingsoon.net';
arrPartners["filmtv"]["SuperHeroHype.com"] = 'http://www.superherohype.com';
arrPartners["filmtv"]["ShockTillYouDrop.com"] = 'http://www.shocktillyoudrop.com';
arrPartners["filmtv"]["CraveOnline"] = 'http://www.craveonline.com/filmtv/';
arrPartners["filmtv"]["DVD File"] = 'http://www.dvdfile.com';
arrPartners["filmtv"]["DreadCentral"] = 'http://www.dreadcentral.com';
arrPartners["filmtv"]["FilmSchoolRejects"] = 'http://www.filmschoolrejects.com';
arrPartners["filmtv"]["Movietimes"] = 'http://www.movietimes.com';
arrPartners["filmtv"]["The Cinema Source"] = 'http://www.thecinemasource.com';
arrPartners["filmtv"]["TheMovieInsider"] = 'http://www.themovieinsider.com';
arrPartners["filmtv"]["Wild About Movies"] = 'http://www.wildaboutmovies.com';

// Music
arrChannels['music'] = 'Music';
arrPartners['music'] = new Object();
arrPartners["music"]["24HourHipHop"] = 'http://www.24hourhiphop.com';
arrPartners["music"]["Better Propaganda"] = 'http://www.betterpropaganda.com';
arrPartners["music"]["CraveOnline"] = 'http://www.craveonline.com/music/';
arrPartners["music"]["HipHopGalaxy"] = 'http://www.hiphopgalaxy.com';
arrPartners["music"]["HipHopGame"] = 'http://www.hiphopgame.com';
arrPartners["music"]["Seek Lyrics"] = 'http://www.seeklyrics.com';
arrPartners["music"]["Soundtrack.Net"] = 'http://www.soundtrack.net';

// Gaming
arrChannels['gaming'] = 'Gaming';
arrPartners['gaming'] = new Object();
arrPartners["gaming"]["ActionTrip"] = 'http://www.actiontrip.com';
arrPartners["gaming"]["CheatHappens"] = 'http://www.cheathappens.com';
arrPartners["gaming"]["CraveOnline"] = 'http://www.craveonline.com/gaming/';
arrPartners["gaming"]["GameRevolution"] = 'http://www.gamerevolution.com';
arrPartners["gaming"]["GamerNode"] = 'http://www.gamernode.com';
arrPartners["gaming"]["PS3Scene"] = 'http://www.ps3scene.com';
arrPartners["gaming"]["PSP 3D"] = 'http://psp3d.com';
arrPartners["gaming"]["RPGamer"] = 'http://www.rpgamer.com';
arrPartners["gaming"]["Siliconera"] = 'http://www.siliconera.com';
arrPartners["gaming"]["ThemePS3"] = 'http://www.themeps3.com';
arrPartners["gaming"]["ThemePSP"] = 'http://www.themepsp.com';
arrPartners["gaming"]["ThemeWii"] = 'http://www.themewii.com';
arrPartners["gaming"]["ThemeXBOX360"] = 'http://www.themexbox360.com';
arrPartners["gaming"]["XBox360 Achievements"] = 'http://www.xbox360achievements.org';
arrPartners["gaming"]["Xbox-Scene"] = 'http://www.xbox-scene.com';

// Comics
arrChannels['comics'] = 'Comics';
arrPartners['comics'] = new Object();
arrPartners["comics"]["ComingSoon.net"] = 'http://www.comingsoon.net';
arrPartners["comics"]["SuperHeroHype"] = 'http://www.superherohype.com';
arrPartners["comics"]["ShockTillYouDrop.com"] = 'http://www.shocktillyoudrop.com';
arrPartners["comics"]["CraveOnline"] = 'http://www.craveonline.com/comics/';
arrPartners["comics"]["OneManga"] = 'http://www.onemanga.com';
arrPartners["comics"]["SaiyanIsland"] = 'http://www.saiyanisland.com';
arrPartners["comics"]["WhiteNinjaComics"] = 'http://www.whiteninjacomics.com';

// Sports
arrChannels['sports'] = 'Sports';
arrPartners['sports'] = new Object();
arrPartners["sports"]["CraveOnline"] = 'http://www.craveonline.com/sports/';
arrPartners["sports"]["HFBoards"] = 'http://www.hfboards.com';
arrPartners["sports"]["Hockey's Future"] = 'http://www.hockeysfuture.com';
arrPartners["sports"]["HoopsVibe"] = 'http://www.hoopsvibe.com';
arrPartners["sports"]["Impact Wrestling"] = 'http://www.impactwrestling.com';
arrPartners["sports"]["JudoForums"] = 'http://www.judoforum.com';
arrPartners["sports"]["JudoInfo"] = 'http://www.judoinfo.com';
arrPartners["sports"]["MaxBoxing"] = 'http://www.maxboxing.com';
arrPartners["sports"]["SherDog"] = 'http://www.sherdog.com';
arrPartners["sports"]["StreetballTalk"] = 'http://www.streetballtalk.com';
arrPartners["sports"]["VitalMX"] = 'http://www.vitalmx.com';
arrPartners["sports"]["Wrestlezone"] = 'http://www.wrestlezone.com';

// Garage
arrChannels['garage'] = 'Garage';
arrPartners['garage'] = new Object();
arrPartners["garage"]["Car and Model"] = 'http://www.carandmodel.com';
arrPartners["garage"]["CraveOnline"] = 'http://www.craveonline.com/garage/';
arrPartners["garage"]["FastFever"] = 'http://www.fastfever.com';
arrPartners["garage"]["GTChannel"] = 'http://www.gtchannel.com';
arrPartners["garage"]["HINCity"] = 'http://www.hincity.com';
arrPartners["garage"]["Hot Import Nights"] = 'http://www.HotImportNights.com';
arrPartners["garage"]["Night Shift Events"] = 'http://www.nightshiftevents.com';
arrPartners["garage"]["Tunerzine"] = 'http://www.tunerzine.com';

// Lifestyle
arrChannels['lifestyle'] = 'Lifestyle';
arrPartners['lifestyle'] = new Object();
arrPartners["lifestyle"]["Celebrity Crunch"] = 'http://www.celebritycrunch.com';
arrPartners["lifestyle"]["CraveOnline"] = 'http://www.craveonline.com/lifestyle/';
arrPartners["lifestyle"]["DrinksMixer"] = 'http://www.drinksmixer.com';
arrPartners["lifestyle"]["EnergyFiend"] = 'http://www.energyfiend.com';
arrPartners["lifestyle"]["Kicksaholic"] = 'http://www.kicksaholic.com';
arrPartners["lifestyle"]["NikeSkateBoarding"] = 'http://www.nikeskateboarding.org';
arrPartners["lifestyle"]["SneakerFiles"] = 'http://www.sneakerfiles.com';
arrPartners["lifestyle"]["Tattoo Now"] = 'http://www.tattoonow.com';
arrPartners["lifestyle"]["TechFresh"] = 'http://www.techfresh.net';

// Humor
arrChannels['humor'] = 'Humor';
arrPartners['humor'] = new Object();
arrPartners["humor"]["CraveOnline"] = 'http://www.craveonline.com/humor/';
arrPartners["humor"]["The Phat Phree"] = 'http://www.thephatphree.com';

// Videos
arrChannels['videos'] = 'Videos';
arrPartners['videos'] = new Object();
arrPartners["videos"]["CraveOnline"] = 'http://www.craveonline.com/videos/';
arrPartners["videos"]["Redbalcony"] = 'http://www.redbalcony.com';
arrPartners["videos"]["Spiked Humor"] = 'http://www.spikedhumor.com';
arrPartners["videos"]["WonderHowTo"] = 'http://www.wonderhowto.com';


function redirect()
{
	var url = document.getElementById('cravebar_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('	#cravebar_mainbar {');
	document.write('		width: '+cbWidth+';');
	document.write('		height: 30px;');
	document.write('		background-image: url(/images/cravebar/bkg.jpg);');
	document.write('		font-family: Arial;');
	document.write('		font-size: 10px;');
	document.write('		text-transform: uppercase;');
	document.write('	}');
	document.write('	#cravebar_mainbar a {');
	document.write('		color: #'+cbFormTextColor+';');
	document.write('		text-decoration: none;');
	document.write('	}');
	document.write('	#cravebar_mainbar a:hover {');
	document.write('		color: #'+cbFormColor+';');
	document.write('		text-decoration: none;');
	document.write('	}');
	document.write('	#cravebar_logo {');
	document.write('		width: 84px;');
	document.write('		float: left;');
	document.write('		margin-left: 10px;');
	document.write('	}');
	document.write('	#cravebar_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('	#cravebar_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('	#cravebar_dropform {');
	document.write('		width: auto;');
	document.write('		float: left;');
	document.write('		height: 30px;');
	document.write('		line-height: 30px;');
	document.write('	}');
	document.write('	#cravebar_dropform #cravebar_dropformlinks {');
	document.write('		float: left;');
	document.write('		width: auto;');
	document.write('		background: url(/images/cravebar/pulldown.jpg) no-repeat 0 100%;');
	document.write('	}');
	document.write('	#cravebar_dropform #cravebar_dropformlinks select {');
	document.write('		width: auto;');
	document.write('		opacity: 0;');
	document.write('	}');
	document.write('	#cravebar_search {');
	document.write('		height: 30px;');
	document.write('		float: left;');
	document.write('		margin-right: 10px;');
	document.write('	}');
	document.write('</style>');
	document.write('<div id="cravebar_mainbar">');
	document.write('	<div id="cravebar_logo"><a href="http://www.craveonline.com"><img src="/images/cravebar/cravelogo.gif" border="0"></a></div>');
	document.write('	<div id="cravebar_sep">></div>');
	document.write('	<div id="cravebar_section"><a href="'+cbBcChannelUrl+'" id="cravebar_section">'+cbBcChannel+'</a></div>');
	document.write('	<div id="cravebar_sep">></div>');
	document.write('	<div id="cravebar_section"><a href="'+cbBcSiteUrl+'" id="cravebar_section">'+cbBcSite+'</a></div>');
	document.write('	<div style="float: right;">');
	document.write('		<div id="cravebar_dropform">');
	document.write('			<div id="cravebar_dropformlinks">');
	document.write('				<select name="cravebar_partners" id="cravebar_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>');
	
	if(cbSearch === 'on')
	{
		document.write('		<div style="float: left;">');
		document.write('			<form name="cravebar_search" action="'+cbSearchAction+'" method="'+cbSearchMethod+'">');
		document.write('				<div style="width: auto; float: left; margin: 3px 10px 0 0;">');
		document.write('					<input type="text" name="'+cbSearchInputName+'" value="">');
		document.write('					<input type="hidden" name="'+cbSearchButtonName+'" value="'+cbSearchButtonValue+'">');
		document.write('				</div>');
		document.write('				<div style="float: left;"><input type="image" src="/images/cravebar/button.jpg" onclick="document.cravebar_search.submit();"></div>');
		document.write('			</form>');
		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]['CraveOnline']; }
if(typeof(cbBcSite) === 'undefined' || typeof(cbBcSite) === 'number' || cbBcSite === '') { var cbBcSite = 'Crave Online'; }
if(typeof(cbBcSiteUrl) === 'undefined' || typeof(cbBcSiteUrl) === 'number' || cbBcSiteUrl === '') { var cbBcSiteUrl = 'http://www.craveonline.com'; }

// search functionality
if(typeof(cbSearch) === 'undefined' || typeof(cbSearch) === 'number' || (cbSearch != 'on' && cbSearch != 'off')) { var cbSearch = 'off'; }
if(typeof(cbSearchAction) === 'undefined' || typeof(cbSearchAction) === 'number' || cbSearchAction === '') { var cbSearchAction = 'http://www.craveonline.com/search.php'; }
if(typeof(cbSearchMethod) === 'undefined' || typeof(cbSearchMethod) === 'number' || (cbSearchMethod != 'get' && cbSearchMethod != 'post')) { var cbSearchMethod = 'get'; }
if(typeof(cbSearchInputName) === 'undefined' || typeof(cbSearchInputName) === 'number' || cbSearchInputName === '') { var cbSearchInputName = 'keywds'; }
if(typeof(cbSearchButtonName) === 'undefined' || typeof(cbSearchButtonName) === 'number' || cbSearchButtonName === '') { var cbSearchButtonName = 'search_submit'; }
if(typeof(cbSearchButtonValue) === 'undefined' || typeof(cbSearchButtonValue) === 'number' || cbSearchButtonValue === '') { var cbSearchButtonValue = 'search'; }


buildBar();