// SL: OCT 17, 2006
//404 redirects to accomodate legacy URL structures. This is a temporary solution to allow search engine references to be updated 
// while still allowing users to locate the new URL.

function checkForRedirect(siteURL) {
	// Look for specic domains passed in from the 404 page. If they exist we run custom redirects. Otherwise we show the default 404 message.
	// START KONAMI  redirects
	if(siteURL == "www.konami.com")
	{
		// to add in custom code for the Search notice
		searchCode = "<table border=0 cellpadding=4 width=500 align=center><tr><td valign=top><img src=http://pics1.truition.com/ctlimg/konami/logo.gif  border=0 /></td><td align=left><br><br><H1>We are currently redirecting you,<br>please wait...</H1>If you are not redirected, please<br><img src=http://pics1.truition.com/ctlimg/largeLinkArrow.gif  align=absmiddle border=0 /><b><a href='/'>Go to the www.konami.com home page.</a></b></td></tr></table>";
document.getElementById('SearchNotice').innerHTML = "";
		document.getElementById('SearchNotice').innerHTML = searchCode;
		// Series of 1 to 1 redirects. If the address bar contains X url redirect to Y url
		if (document.location.href == "http://www.konami.com/gs/boards.php" || document.location.href == "http://www.konami.com/gs/boards.php" ){
			 document.location.href = "http://konami-data.com/forum";
		}
		else if (document.location.href == "http://www.konami.com/main/cgi-bin/ultimatebb.cgi" || document.location.href == "http://www.konami.com/main/cgi-bin/ultimatebb.cgi" ){
			 document.location.href = "http://www.konami-data.com/cgi-bin/forum/ultimatebb.cgi";
		}	
		else if (document.location.href.indexOf("konami.com/mo") != "-1" && document.location.href.indexOf(".php") != "-1" ){
			 document.location.href = "http://www.konamimobile.com";
		}	
		else if (document.location.href == "http://www.konami.com/mo" || document.location.href == "http://www.konami.com/mo/" ){
			 document.location.href = "http://www.konamimobile.com";
		}			
		else if (document.location.href == "http://www.konami.com/mo/asset" || document.location.href == "http://www.konami.com/mo/asset/" ){
			 document.location.href = "http://www.konami-data.com/mo/asset";
		}	
		else if (document.location.href == "http://www.konami.com/mo/fd" || document.location.href == "http://www.konami.com/mo/fd/" ){
			 document.location.href = "http://www.konami-data.com/mo/fd";
		}	
		else if (document.location.href == "http://www.konami.com/th" || document.location.href == "http://www.konami.com/th/" ){
			 document.location.href = "http://www.konami.com/edealinv/servlet/ExecMacro?nurl=control/ToyAndHobby.vm&ctl_nbr=3810";
		}	
		else if (document.location.href == "http://www.konami.com/am" || document.location.href == "http://www.konami.com/am/" ){
			 document.location.href = "http://www.konami.com/edealinv/servlet/ExecMacro?nurl=control/Arcade.vm&ctl_nbr=3810";
		}	
		else if (document.location.href == "http://www.konami.com/gs/channel" || document.location.href == "http://www.konami.com/gs/channel/" ){
			 document.location.href = "http://www.konami-data.com/channel";
		}	
		else if (document.location.href == "http://www.konami.com/ddr"){
			 document.location.href = "http://www.ddronlinecommunity.com";
		}
		else if (document.location.href == "http://www.konami.com/mgocommunity"){
			 document.location.href = "http://mgo2web.konami.com/us/community/";
		}	
		else if (document.location.href == "http://www.konami.com/ddrbk" || document.location.href == "http://www.konami.com/ddrbk/" ){
			 document.location.href = "http://www.konami-data.com/ddrbk";
		}			
		else if (document.location.href == "http://www.konami.com/gs/officialsites" || document.location.href == "http://www.konami.com/gs/officialsites/" ){
			 document.location.href = "http://www.konami-data.com/officialsites/";
		}	
		else if (document.location.href == "http://www.konami.com/gs/registration" || document.location.href == "http://www.konami.com/gs/registration/" ){
			 document.location.href = "http://www.konami-data.com/registration";
		}	
		else if (document.location.href == "http://www.konami.com/gs/wenation" || document.location.href == "http://www.konami.com/gs/wenation/" ){
			 document.location.href = "http://www.konami-data.com/wenation";
		}	
		else if (document.location.href.indexOf("konami.com/gs") != "-1" && document.location.href.indexOf(".php") != "-1" ){
			 document.location.href = "http://www.konami.com";
		}			
		else if (document.location.href == "http://www.konami.com/gs" || document.location.href == "http://www.konami.com/gs/" ){
			 document.location.href = "http://www.konami.com";
		}			
		else if (document.location.href == "http://www.konami.com/gm" || document.location.href == "http://www.konami.com/gm/" ){
			 document.location.href = "http://www.gm.konami.com";
		}	
		else if (document.location.href == "http://www.konami.com/gs/pr" || document.location.href == "http://www.konami.com/gs/pr/" ){
			 document.location.href = "http://www.konami.com/edealinv/servlet/ExecMacro?nurl=control/Downloads.vm&ctl_nbr=3810";
		}	
		else if (document.location.href == "http://www.konami.com/silenthill" || document.location.href == "http://www.konami.com/silenthill/" ){
			 document.location.href = "http://online.konamimobile.com/KDEOnline/SilentHill_Widget/index.html";
		}
		else if (document.location.href == "http://www.konami.com/libs" || document.location.href == "http://www.konami.com/libs/"){
			 document.location.href = "http://www.konami-data.com/lostinblue/";
		}
		else if (document.location.href == "http://www.konami.com/kraie2" || document.location.href == "http://www.konami.com/kraie2/"){
			 document.location.href = "http://www.ddronlinecommunity.com/";
		}
		else if (document.location.href == "http://www.konami.com/pes" || document.location.href == "http://www.konami.com/pes/"){
			 document.location.href = "http://www.pesunites.com/";
		}
		else if (document.location.href == "http://www.konami.com/pes09" || document.location.href == "http://www.konami.com/pes09/"){
			 document.location.href = "http://www.konami-data.com/pes09/";
		}
		else if (document.location.href == "http://www.konami.com/luigis" || document.location.href == "http://www.konami.com/luigis/" ){
			 document.location.href = "http://www.konami-data.com/luigis";
		}		
		else if (document.location.href == "http://www.konami.com/proevolutionsoccer" || document.location.href == "http://www.konami.com/pes2008"){
			document.location.href = "http://www.konami-data.com/pes2008/";			
		}
		/*else if (document.location.href == "http://www.konami.com/metalgearsolid" || document.location.href == "http://www.konami.com/mgs"){
			document.location.href = "http://www.konami.jp/kojima_pro";			
		}*/
		else if (document.location.href == "http://www.konami.com/castlevania" || document.location.href == "http://www.konami.com/castlevania/"){
			document.location.href = "http://www.konami-data.com/castlevania/";			
		}
		else if (document.location.href == "http://www.konami.com/yugioh" || document.location.href == "http://www.konami.com/ygo"){
			document.location.href = "http://www.konami-data.com/yugioh/";			
		}
		else if (document.location.href == "http://www.konami.com/deathjr"){
			document.location.href = "http://www.deathjr.com";			
		}
		else if (document.location.href == "http://www.konami.com/mgs4" || document.location.href == "http://www.konami.com/mgs4/"){
			document.location.href = "http://www.konami.jp/mgs4/us/";			
		}
		else if (document.location.href == "http://www.konami.com/mgo"){
			document.location.href = "http://www.konami.jp/mgo/us/index.php";			
		}
		else if (document.location.href == "http://www.konami.com/hellboy"){
			document.location.href = "http://www.konami-data.com/hellboy/";			
		}
		else if (document.location.href == "http://www.konami.com/dewysadventure"){
			document.location.href = "http://www.konami-data.com/officialsites/dewysadv/";			
		}
		else if (document.location.href == "http://www.konami.com/rockrevolution" || document.location.href == "http://www.konami.com/rockrevolution/") {
			document.location.href = "http://www.konami-data.com/rockrevolution";			
		}
		else if (document.location.href == "http://www.konami.com/e3" || document.location.href == "http://www.konami.com/e32008"){
			document.location.href = "http://www.konami-data.com/e3/2008/index.html";			
		}
		else if (document.location.href == "http://www.konami.com/bluedragonrpcg/" || document.location.href == "http://www.konami.com/bluedragonrpcg") {
			document.location.href = "http://www.konami-data.com/bluedragonrpcg/";			
		}
		else if (document.location.href == "http://www.konami.com/elebits"){
			document.location.href = "http://www.konami-data.com/officialsites/elebits/";			
		}
		// this is a catch all for Official Sites URL's. Since the URL structure is almost the same we just cut off the Official Site the user is looking for
		// from the URL and add it to the end of our new URL.				
		else if (document.location.href.indexOf("/officialsites/") != "-1" ){
			var requestedURL = document.location.href;
			var siteFolder = document.location.href.indexOf("/officialsites/")
			var officialSiteFolder = requestedURL.substring(siteFolder)
			 document.location.href = "http://konami-data.com" + officialSiteFolder;
		}	
		// Almost all other URL's will contains ".php" so we will see if that is part of the URL and if it is we redirect to the home page
		else if (document.location.href.indexOf(".php") != "-1" ){
			document.location.href = "http://www.konami.com";
		}																									
		else
		{
			// to add in custom code for the 404 notice
			//fourofourCode = "<b>Thank you for visiting Konami! Sorry but we could not locate your page</b>"
			//document.getElementById('404Notice').innerHTML = fourofourCode;
			
			// By default the search message div is visible. If none of the URL's apply we switch the visibility to show the 404 message.
			// You can customize the code by using the innerHTML code above
			document.getElementById('404Notice').className = 'show'; document.getElementById('SearchNotice').className = 'hide';
		}
		
	}
	// END KONAMI  redirects
		
	// START GEARDIRECT redirects
	else if(siteURL == "www.geardirect.com")
	{
		if (document.location.href.indexOf("/TheNorthFace") != "-1" || document.location.href.indexOf("/thenorthface") != "-1"){
			 document.location.href = "http://www.geardirect.com/geardirect/ctl3981/a0id2392/a0valThe%20North%20Face/the_north_face";
		}	
		// Almost every URL contains ".cfm" so we will see if that is part of the URL and if it is we redirect to the home page
		else if (document.location.href.indexOf(".cfm") != "-1" ){
			document.location.href = "http://www.geardirect.com";
		}																						
		else
		{
			// to add in custom code for the 404 notice
			//fourofourCode = "<b>Thank you for visiting Konami! Sorry but we could not locate your page</b>"
			//document.getElementById('404Notice').innerHTML = fourofourCode;
			
			// By default the search message div is visible. If none of the URL's apply we switch the visibility to show the 404 message.
			// You can customize the code by using the innerHTML code above
			document.getElementById('404Notice').className = 'show'; document.getElementById('SearchNotice').className = 'hide';
		}
	}
	// END GEARDIRECT redirects		
	else if(siteURL == "konamicards.stores.truition.com")
	{
		if (document.location.href == "http://konamicards.stores.truition.com/cardorderstest/" || document.location.href == "http://konamicards.stores.truition.com/cardorderstest"){
			document.location.href = "http://konamitest.stores.truition.com";			
		}	
		else if (document.location.href == "http://konamicards.stores.truition.com/tournamenttest/" || document.location.href == "http://konamitest.stores.truition.com/tournamenttest"){
			document.location.href = "http://konamitest.stores.truition.com";			
		}	
	}
	
	// START COLORADO SNOWBOARDS redirects
	else if(siteURL == "www.coloradosnowboards.com")
	{	
		// Almost every URL contains ".cfm" so we will see if that is part of the URL and if it is we redirect to the home page
		if (document.location.href.indexOf(".cfm") != "-1" ){
			document.location.href = "http://www.coloradosnowboards.com";
		}																						
		else
		{
			// to add in custom code for the 404 notice
			//fourofourCode = "<b>Thank you for visiting Konami! Sorry but we could not locate your page</b>"
			//document.getElementById('404Notice').innerHTML = fourofourCode;
			
			// By default the search message div is visible. If none of the URL's apply we switch the visibility to show the 404 message.
			// You can customize the code by using the innerHTML code above
			document.getElementById('404Notice').className = 'show'; document.getElementById('SearchNotice').className = 'hide';
		}
	}
	// END COLORADO SNOWBOARDS redirects
	
	// START GOLFBARGAINS redirects
	else if(siteURL == "www.golfbargains.com")
	{	
		// Almost every URL contains ".cfm" so we will see if that is part of the URL and if it is we redirect to the home page
		if (document.location.href.indexOf(".cfm") != "-1" ){
			document.location.href = "http://www.golfbargains.com";
		}																						
		else
		{
			// to add in custom code for the 404 notice
			//fourofourCode = "<b>Thank you for visiting Konami! Sorry but we could not locate your page</b>"
			//document.getElementById('404Notice').innerHTML = fourofourCode;
			
			// By default the search message div is visible. If none of the URL's apply we switch the visibility to show the 404 message.
			// You can customize the code by using the innerHTML code above
			document.getElementById('404Notice').className = 'show'; document.getElementById('SearchNotice').className = 'hide';
		}
	// END GOLFBARGAINS redirects
		
	}	
	
	// START OUTDOOR GEAR redirects
	else if(siteURL == "www.outdoorgear.co.uk")
	{	
		// Client request that we direct all 404 traffic to the home page
		document.location.href = "http://www.outdoorgear.co.uk";
	// END OUTDOOR GEAR  redirects
		
	}		

	// START Philips-DE-Public redirects
	else if(siteURL == "www.shop.philips.de")
	{	
		// Client request that we direct all 404 traffic to a certain error page
		document.location.href = "http://www.shop.philips.de/edealinv/servlet/ExecMacro?ctl_nbr=3601&nurl=control/404.vm";
	// END Philips-DE-Public redirects
	}
	
	// START Philips-UK-Public redirects
	else if(siteURL == "www.shop.philips.co.uk") 
	{	
		// Client request that we direct all 404 traffic to a certain error page
		document.location.href = "http://www.shop.philips.co.uk/edealinv/servlet/ExecMacro?ctl_nbr=3590&nurl=control/404.vm";
	// END Philips-DE-Public redirects
		
	}
	
	// START Philips-NL-Public redirects
	else if(siteURL == "www.shop.philips.nl")
	{	
		// Client request that we direct all 404 traffic to a certain error page
		document.location.href = "http://www.shop.philips.nl/edealinv/servlet/ExecMacro?ctl_nbr=3073&nurl=control/404.vm";
	// END Philips-DE-Public redirects
		
	}

	else
	{
		// By default the search message div is visible. If none of the URL's apply we switch the visibility to show the 404 message.
		// You can customize the code by using the innerHTML code above	
		document.getElementById('404Notice').className = 'show'; document.getElementById('SearchNotice').className = 'hide';
	}	
	
}

