var timerID = null;

function set_parameters(par1, par2, par3) // vs: Jacopo
{
	var stringaParametri = "'"+par1 + "','" + par2 + "','" + par3 + "'";

	if (typeof i == 'undefined') i=0;
	if (typeof top.down !='undefined')
	{
		var i=0;

		if (typeof top.down.document.nomefilmato !='object')
		{
			if (timerID != null){
				clearInterval(timerID);
				timerID = null;
			}

			timerID = setInterval("set_parameters(" + stringaParametri + ")",250);
			return;

		}
		else {
			if (top.down.document.nomefilmato.PercentLoaded() < 100)
			{
				if (timerID != null){
					clearInterval(timerID);
					timerID = null;
				}

				timerID = setInterval("set_parameters(" + stringaParametri + ")",250);
				return;
			}
			else{
				clearInterval(timerID);
				timerID = null;
	
				top.down.document.nomefilmato.SetVariable('pos',par1);
				top.down.document.nomefilmato.SetVariable('pos_s',par2);
			}
		}

		
		if (par3 != '')
		{
			if (typeof top.center !='undefined')
			{
				if (typeof top.center.frames[0] !='undefined')
				{
					if (top.center.frames[0].name !='mainframe') alert("nominare il frame mainframe invece che "+top.center.frames[0].name+"!!..");
					else 
					{
						if (typeof top.center.mainframe.document.nomefilmato !='object')
						{
							if (timerID != null){
								clearInterval(timerID);
								timerID = null;
							}

							timerID = setInterval("set_parameters(" + stringaParametri + ")",250);
							return;
						}
						else{


							if (top.center.mainframe.document.nomefilmato.PercentLoaded() < 100)
							{
								if (timerID != null){
									clearInterval(timerID);
									timerID = null;
								}

								timerID = setInterval("set_parameters(" + stringaParametri + ")",250);
								return;
							}
							else{
								clearInterval(timerID);
								timerID = null;
								if (par3 == '0')
								{
									top.center.mainframe.document.nomefilmato.GotoFrame(1);
								}
								else{
									top.center.mainframe.document.nomefilmato.TGotoLabel("/", "_"+par3);
								}
							}
						}
					}
				}
                	}
		}
	}
}




function go(new_url_top2, new_url_side, new_url_frame)
{
	// prima prendo il percorso assoluto del sito per Netscape
	// mi baso su una pagina che esiste sempre e di cui conosco il nome
	// ------------->> menu_up.html
	
	var indirizzo = ((top.up.location.toString()).split("menu_up.html"))[0];
	var indirizzo = indirizzo.slice(0, -1);


	// compongo l'estensione
	
	if (new_url_top2 != "")
	{
		top.center.location.href = indirizzo+new_url_top2; //+estensione;
	}
	else
	{
		if (new_url_side != "") top.center.mainframe.location.href = indirizzo+new_url_side; // + estensione;
		if (new_url_frame != "") top.center.rightframe.location.href = indirizzo+new_url_frame;//+estensione;	
	}
}



function new_top(new_url_top)
{
	// prima prendo il percorso assoluto del sito per Netscape
		
	var prova = ((this.location.toString()).split("/"));
	var indirizzo = ((this.location.toString()).split(prova[prova.length-1]))[0];

	if (new_url_top != "")
	{
		top.location.href = indirizzo+new_url_top;
	}	
}