// 
// This file auto-redirects the populated pages to the versions on the new "www.alternativebreaks2011.org" website.
// 

// Define references to new and old website URLs.
var old_site_root_directory	=	"alternativebreaks.org";
var new_site_root_directory	=	"alternativebreaks2012.org";

// Get name / value of current sub-directory on website.
var current_file_name		=	document.location.href;
current_file_name = current_file_name.replace("http://", "");				// Strip "http://".
current_file_name = current_file_name.replace("www.", "");					// Strip "www.".
current_file_name = current_file_name.replace(old_site_root_directory, "");	// Strip 'old_site_root_directory'.

// Define array of pages to redirect to when loaded.
var redirect_list = new Array(2);

// Populate array of pages to redirect to [current_file_name, new_site_extension]
redirect_list[0]	= ["", ""];
redirect_list[1]	= ["/", "/"];
redirect_list[2]	= ["/About_Break_Away.asp", "/about"];
redirect_list[3]	= ["/leaders.asp", "/contact"];
redirect_list[4]	= ["/Alternative_Breaks.asp", "/movement"];
redirect_list[5]	= ["/8components.asp", "/philosophy/8components"];
redirect_list[6]	= ["/Active_Citizen_Continuum.asp", "/philosophy"];
redirect_list[7]	= ["/slr.asp", "/training/slrs"];
redirect_list[8]	= ["/SiteBank_Catalog_Online.asp", "/resources/sitebank_overview"];
redirect_list[9]	= ["/Manuals.asp", "/resources/manuals"];
redirect_list[10]	= ["/Media_Coverage.asp", "/media"];
redirect_list[11]	= ["/site_development.asp", "/resources/developing_host_sites"];
//redirect_list[12]	= ["", ""];

// Loop through list and check if current page is in list.
for(i=0; i < redirect_list.length; i++) {
	
	// Check if current page should be redirected; Execute redirect;
	if(redirect_list[i][0] == current_file_name)
		location.replace("http://www."+new_site_root_directory+redirect_list[i][1]);
		
}

