function redirect()
{
	var host = location.host;
	var dir = "";
	if (host.indexOf("gmcard") != -1)
		dir = "card";
	else if (host.indexOf("gmextendedfamily") != -1)
		dir = "efc";
	else if (host.indexOf("gmflexcard") != -1)
		dir = "flex";
	else if (host.indexOf("gmbusinesscard") != -1)
		dir = "businesscard";

	var url = location.protocol + "//" + host + location.pathname + dir + "/index.html";
	location.replace(url);
}


function redirectFileName(fileName)
{
	var host = location.host;
	var dir = "";
	if (host.indexOf("gmcard") != -1)
		dir = "card";
	else if (host.indexOf("gmextendedfamily") != -1)
		dir = "efc";
	else if (host.indexOf("gmflexcard") != -1)
		dir = "flex";
	else if (host.indexOf("gmbusinesscard") != -1)
		dir = "businesscard";
	
	var pathName = location.pathname +"";
	pathName = pathName.replace(fileName+"","");
	var url = location.protocol + "//" + host + pathName + dir + "/"+fileName;
	location.replace(url);
}