if (window.navigator.userAgent.indexOf ("MSIE") > 0) ie4=true;
else ie4=false;
var pr=0;

Coor = new Array;
Coor["it"] = new Array;
Coor["en"] = new Array;
Coor["ru"] = new Array;
for (i=1; i<=5; i++)
{
	Coor["it"][i] = new Array;
	Coor["en"][i] = new Array;
	Coor["ru"][i] = new Array;
}

Coor["ru"][1]["x"]=Coor["en"][1]["x"]=Coor["it"][1]["x"]="300"; // Imperia
Coor["ru"][1]["y"]=Coor["en"][1]["y"]=Coor["it"][1]["y"]="400";
Coor["ru"][1]["PaddingTop"]=Coor["en"][1]["PaddingTop"]=Coor["it"][1]["PaddingTop"]="9px";
Coor["it"][1]["text"]="Porto turistico";
Coor["en"][1]["text"]="Tourist seaport";
Coor["ru"][1]["text"]="Туристический порт";
Coor["ru"][2]["x"]=Coor["en"][2]["x"]=Coor["it"][2]["x"]="400"; // Gorizia
Coor["ru"][2]["y"]=Coor["en"][2]["y"]=Coor["it"][2]["y"]="220";
Coor["ru"][2]["PaddingTop"]=Coor["en"][2]["PaddingTop"]=Coor["it"][2]["PaddingTop"]="9px";
Coor["it"][2]["text"]="Filiale Gorizia";
Coor["en"][2]["text"]="Gorizia branch";
Coor["ru"][2]["text"]="Филиал в Гориции";
Coor["ru"][3]["x"]=Coor["en"][3]["x"]=Coor["it"][3]["x"]="410"; // Trieste
Coor["ru"][3]["y"]=Coor["en"][3]["y"]=Coor["it"][3]["y"]="365";
Coor["ru"][3]["PaddingTop"]=Coor["en"][3]["PaddingTop"]=Coor["it"][3]["PaddingTop"]="9px";
Coor["it"][3]["text"]="Autoporto di Fernetti";
Coor["en"][3]["text"]="Fernetti  terminal";
Coor["ru"][3]["text"]="Автопорт Фернетти";
Coor["ru"][4]["x"]=Coor["en"][4]["x"]=Coor["it"][4]["x"]="560"; // Moscow
Coor["ru"][4]["y"]=Coor["en"][4]["y"]=Coor["it"][4]["y"]="120";
Coor["ru"][4]["PaddingTop"]=Coor["en"][4]["PaddingTop"]=Coor["it"][4]["PaddingTop"]="9px";
Coor["it"][4]["text"]="Moscow";
Coor["en"][4]["text"]="Moscow";
Coor["ru"][4]["text"]="Москва";
Coor["ru"][5]["x"]=Coor["en"][5]["x"]=Coor["it"][5]["x"]="300"; // Milano
Coor["ru"][5]["y"]=Coor["en"][5]["y"]=Coor["it"][5]["y"]="240";
Coor["ru"][5]["PaddingTop"]=Coor["en"][5]["PaddingTop"]=Coor["it"][5]["PaddingTop"]="2px";
Coor["it"][5]["text"]="Milano. Sede legale e amministrativa";
Coor["en"][5]["text"]="Milan. Registered office";
Coor["ru"][5]["text"]="Милан. Юридический адрес";

function Window(id, lang)
{
	if (lang=="it") url="/filiali.html#f"+id;
	else url="/"+lang+"/filiali.html#f"+id;
	Hidden("ph1", "inline");
	document.getElementById("ph1").innerHTML='<div id="ph"></div><div id="ph_txt"></div>';
	document.getElementById("ph").innerHTML='<a href="'+url+'"><img src="/img/ru/city'+id+'.jpg"/></a>';
	document.getElementById("ph1").style.marginLeft=Coor[lang][id]["x"]+"px";
	document.getElementById("ph1").style.marginTop=Coor[lang][id]["y"]+"px";
	document.getElementById("ph_txt").style.paddingTop=Coor[lang][id]["PaddingTop"];
	document.getElementById("ph_txt").innerHTML='<a href="'+url+'">'+Coor[lang][id]["text"]+'</a>';
}

function Show(mode)
{
	if (mode==1) clearTimeout(pr);
	if (mode==2) pr=setTimeout("OUT()", 300);
}

function OUT()
{
	Hidden("ph1", "none");
}

function Hidden(id, style)
{
	if (document.getElementById(id))
	{
		if (style == "table-row")
		{
				if (ie4) document.getElementById(id).style.display="inline";
				else document.getElementById(id).style.display=style;
		}
		else
		document.getElementById(id).style.display=style;
	}
}

Messages = new Array;
Messages["it"] = new Array;
Messages["en"] = new Array;
Messages["ru"] = new Array;

Messages["it"]["name"]="Nome";
Messages["it"]["address"]="Azienda";
Messages["it"]["phone"]="Numero di telefono";
Messages["it"]["fax"]="Fax";
Messages["it"]["email"]="E-mail";
Messages["it"]["message"]="Testo";

Messages["en"]["name"]="Enter name";
Messages["en"]["address"]="Enter address";
Messages["en"]["phone"]="Enter phone";
Messages["en"]["fax"]="Enter fax";
Messages["en"]["email"]="Enter E-mail";
Messages["en"]["message"]="Enter message";

Messages["ru"]["name"]="Введите имя";
Messages["ru"]["address"]="Введите адрес";
Messages["ru"]["phone"]="Введите номер телефона";
Messages["ru"]["fax"]="Введите факс";
Messages["ru"]["email"]="Введите E-mail";
Messages["ru"]["message"]="Введите сообщение";

function Send(lang)
{
	if (document.getElementById("name"))
	{
		if (document.getElementById("name").value=="")
		{
			alert(Messages[lang]["name"]);
			return;
		}
	}
	if (document.getElementById("address"))
	{
		if (document.getElementById("address").value=="")
		{
			alert(Messages[lang]["address"]);
			return;
		}
	}
	if (document.getElementById("phone"))
	{
		if (document.getElementById("phone").value=="")
		{
			alert(Messages[lang]["phone"]);
			return;
		}
	}
	if (document.getElementById("email"))
	{
		if (document.getElementById("email").value=="")
		{
			alert(Messages[lang]["email"]);
			return;
		}
	}
	if (document.getElementById("message"))
	{
		if (document.getElementById("message").value=="")
		{
			alert(Messages[lang]["message"]);
			return;
		}
	}
	document.Form.submit();
}
