// JavaScript Document
function toEng()
{
	//alert('toEng');
	curUrl = "" + self.location;
	curUrlPrefix = curUrl.substring(0, 10);
	curUrlPrefix = curUrlPrefix.toUpperCase();
	
	if (curUrlPrefix == "HTTP://WWW")
	{
		//alert('Complete form');
		self.location = "http://eng" + curUrl.substring(10, curUrl.length);
	}
	else
	{
		curUrlPrefix = curUrl.substring(0, 16);
		curUrlPrefix = curUrlPrefix.toUpperCase();
		
		if (curUrlPrefix == "HTTP://NEOLOGICA")
		{
			//alert('Short form');
			self.location = "http://eng.neologica" + curUrl.substring(16, curUrl.length);
		}
		else
		{
			//alert('Unknown form -> redirecting to the Home Page...');
			self.location = "http://eng.neologica.it";
		}
	}
}

function toIta()
{
	//alert('toIta');
	curUrl = "" + self.location;
	curUrlPrefix = curUrl.substring(0, 10);
	curUrlPrefix = curUrlPrefix.toUpperCase();
	
	if (curUrlPrefix == "HTTP://ENG")
	{
		//alert('Complete form');
		self.location = "http://www" + curUrl.substring(10, curUrl.length);
	}
	else
	{
		//alert('Unknown form -> redirecting to the Home Page...');
		self.location = "http://www.neologica.it";
	}
}

function normalizeEngUrl()
{
	//alert('Normalizing URL (eng)...');
	
	curUrl = "" + self.location;
	curUrlPrefix = curUrl.substring(0, 27);
	curUrlPrefix = curUrlPrefix.toUpperCase();
	
	if (curUrlPrefix == "HTTP://WWW.NEOLOGICA.IT/ENG")
	{
		//alert('1...');
		self.location = "http://eng.neologica.it" + curUrl.substring(27, curUrl.length);
	}
	else
	{
		curUrlPrefix = curUrl.substring(0, 23);
		curUrlPrefix = curUrlPrefix.toUpperCase();
		if (curUrlPrefix == "HTTP://NEOLOGICA.IT/ENG")
		{
			//alert('2...');
			self.location = "http://eng.neologica.it" + curUrl.substring(23, curUrl.length);
		}
	}
	
	return true;
}