/* 
Copyright 2002 maxfava.com
*/

var stato = true
var i_str=0;
var i = -10;
var reset_t_intro_exit = 160;
var t_step=80;
var t_intro_exit= reset_t_intro_exit;
var step_intro_exit=500;

document.imgmenu.style.filter="alpha(opacity='"+i+"')";
effetto_txt();

function effetto_txt(){
var oggetto = Math.round(Math.random()*imageurl.length)
totale_links = document.links.length

document.links[oggetto].style.backgroundColor = "#FFFFFF"
var time = Math.round(Math.random()*300)
var timer = setTimeout("resetta_txt("+oggetto+")",time)
//alert (document.links[0].style.fontSize)
}

function resetta_txt(oggetto){
document.links[oggetto].style.backgroundColor = client_colore_sfondo
var time = Math.round(Math.random()*1000)
var timer = setTimeout("effetto_txt()",time)
}


function mostra(index){
document.imgmenu.src=imageurl[index];
nascondi_statusbar();
stato = true
light(index);
scorri_txt(index);
}

function light(index){
if (i<=110&&stato){
	i=i+10;

	document.imgmenu.style.filter="alpha(opacity='"+i+"')";
	var timermostra = setTimeout("light("+index+")",100);
	}
}

function nascondi(index){
nascondi_statusbar();
stato = false
i=-10
if(document.msgf.msg.value==msgpopup[index]||stato==false) document.msgf.msg.value = ""

document.imgmenu.style.filter="alpha(opacity='"+i+"')";
}

function scorri_txt(index){
nascondi_statusbar();
if (i_str==0||stato==false) document.msgf.msg.value="";
var timetxt;
clearTimeout(timetxt);
if (i_str<=msgpopup[index].length&&stato) {
	document.msgf.msg.value = document.msgf.msg.value+msgpopup[index].substring(i_str,i_str+1);
	i_str=i_str+1;
	var timetxt=setTimeout("scorri_txt("+index+")",50)
	}
else i_str=0;
}

function nascondi_statusbar(){
window.status= "www.maxfava.com"
}

function setup_exit(id_pagina){
if (suppo_lay()){
	document.all.sfondo_menu.style.width=screen.width+"px";
	document.all.sfondo_menu.style.height=screen.height+"px";
	document.all.sfondo_menu.style.posLeft=screen.width;
	document.all.sfondo_menu.style.posTop=0;
	document.all.sfondo_menu.style.visibility = "visible";
	}
	else
	{
	document.getElementById("sfondo_menu").style.width=screen.width+"px";
	document.getElementById("sfondo_menu").style.height=screen.height+"px";
	document.getElementById("sfondo_menu").style.left=screen.width;
	document.getElementById("sfondo_menu").style.top=0;
	document.getElementById("sfondo_menu").style.visibility = "visible";
	}
start_exit(screen.width,id_pagina);
}

function start_exit(x,id_pagina){
if (x>=0) 
	{
	t_intro_exit=t_intro_exit-t_step;
	if (suppo_lay()){
		document.all.sfondo_menu.style.posLeft=x;
		x=x-step_intro_exit;
		var timer = setTimeout("start_exit("+x+","+id_pagina+")",t_intro_exit);
		}
	else
		{
		window.parent.location.href=collega[id_pagina];
		document.getElementById("sfondo_menu").style.left=x;
		x=x-step_intro_exit;
		var timer = setTimeout("start_exit("+x+","+id_pagina+")",t_intro_exit);
		}
	}
	else
	{
	if (suppo_lay()){
		document.all.sfondo_menu.style.posLeft=0;
		document.all.sfondo_menu.style.posTop=0;
		}
	else
		{
		document.getElementById("sfondo_menu").style.left=0;
		document.getElementById("sfondo_menu").style.top=0;
		}
	window.parent.location.href=collega[id_pagina];
	t_intro_exit= reset_t_intro_exit;
	}

return false;
}

function setup_intro(){
if (suppo_lay()){
	document.all.sfondo_menu.style.width=screen.width+"px";
	document.all.sfondo_menu.style.height=screen.height+"px";
	document.all.sfondo_menu.style.posLeft=0;
	document.all.sfondo_menu.style.posTop=0;
	document.all.sfondo_menu.style.visibility = "visible";
	}
	else
	{
	document.getElementById("sfondo_menu").style.width=screen.width+"px";
	document.getElementById("sfondo_menu").style.height=screen.height+"px";
	document.getElementById("sfondo_menu").style.left=0;
	document.getElementById("sfondo_menu").style.top=0;
	document.getElementById("sfondo_menu").style.visibility = "visible";
	}

var effetto = Math.round(Math.random()*3)
start_intro(0,effetto);
}

function start_intro(x,effetto){
if (effetto==0){
if (x<=screen.height) 
	{
	t_intro_exit=t_intro_exit-t_step;
	if (suppo_lay()) 
		document.all.sfondo_menu.style.posTop=x;
	else
		document.getElementById("sfondo_menu").style.top=x;
		
	x=x+step_intro_exit;
	var timer = setTimeout("start_intro("+x+","+effetto+")",t_intro_exit);
	}
	else
	{
		if (suppo_lay()){
			document.all.sfondo_menu.style.width="1px";
			document.all.sfondo_menu.style.height="1px";
			document.all.sfondo_menu.style.posLeft=0;
			document.all.sfondo_menu.style.posTop=0;
			document.all.sfondo_menu.style.visibility = "hidden";
		}
		else
		{
			document.getElementById("sfondo_menu").style.width="1px";
			document.getElementById("sfondo_menu").style.height="1px";
			document.getElementById("sfondo_menu").style.left=0;
			document.getElementById("sfondo_menu").style.top=0;
			document.getElementById("sfondo_menu").style.visibility = "hidden";
		}
	t_intro_exit= reset_t_intro_exit;
	}
	}
if (effetto==1){
if (x<screen.width) {
	t_intro_exit=t_intro_exit-t_step;
		if (suppo_lay()) 
		document.all.sfondo_menu.style.posLeft=x;
	else
		document.getElementById("sfondo_menu").style.left=x;
	
	x=x+step_intro_exit;
	var timer = setTimeout("start_intro("+x+","+effetto+")",t_intro_exit);
	}
	else
	{
		if (suppo_lay()){
			document.all.sfondo_menu.style.width="1px";
			document.all.sfondo_menu.style.height="1px";
			document.all.sfondo_menu.style.posLeft=0;
			document.all.sfondo_menu.style.posTop=0;
			document.all.sfondo_menu.style.visibility = "hidden";
		}
		else
		{
			document.getElementById("sfondo_menu").style.width="1px";
			document.getElementById("sfondo_menu").style.height="1px";
			document.getElementById("sfondo_menu").style.left=0;
			document.getElementById("sfondo_menu").style.top=0;
			document.getElementById("sfondo_menu").style.visibility = "hidden";
		}
	t_intro_exit= reset_t_intro_exit;
	}
	}
if (effetto==2){
if (x<screen.height) {
	t_intro_exit=t_intro_exit-t_step;
	if (suppo_lay()){
			document.all.sfondo_menu.style.posLeft=x;
			document.all.sfondo_menu.style.posTop=x;
	}
	else
	{
		document.getElementById("sfondo_menu").style.left=x;
		document.getElementById("sfondo_menu").style.top=x;
	}
	x=x+step_intro_exit;
	var timer = setTimeout("start_intro("+x+","+effetto+")",t_intro_exit);
	}
	else
	{
		if (suppo_lay()){
			document.all.sfondo_menu.style.width="1px";
			document.all.sfondo_menu.style.height="1px";
			document.all.sfondo_menu.style.posLeft=0;
			document.all.sfondo_menu.style.posTop=0;
			document.all.sfondo_menu.style.visibility = "hidden";
		}
		else
		{
			document.getElementById("sfondo_menu").style.width="1px";
			document.getElementById("sfondo_menu").style.height="1px";
			document.getElementById("sfondo_menu").style.left=0;
			document.getElementById("sfondo_menu").style.top=0;
			document.getElementById("sfondo_menu").style.visibility = "hidden";
		}
	t_intro_exit= reset_t_intro_exit;
	}
	}
if (effetto==3){
if (x>screen.width-2048) {
	t_intro_exit=t_intro_exit-t_step;
	if (suppo_lay()){
			document.all.sfondo_menu.style.posLeft=x;
			document.all.sfondo_menu.style.posTop=x;
	}
	else
	{
		document.getElementById("sfondo_menu").style.left=x;
		document.getElementById("sfondo_menu").style.top=x;
	}

	x=x-step_intro_exit;
	var timer = setTimeout("start_intro("+x+","+effetto+")",t_intro_exit);
	}
	else
	{
	t_intro_exit= reset_t_intro_exit;
		if (suppo_lay()){
			document.all.sfondo_menu.style.width="1px";
			document.all.sfondo_menu.style.height="1px";
			document.all.sfondo_menu.style.posLeft=0;
			document.all.sfondo_menu.style.posTop=0;
			document.all.sfondo_menu.style.visibility = "hidden";
		}
		else
		{
			document.getElementById("sfondo_menu").style.width="1px";
			document.getElementById("sfondo_menu").style.height="1px";
			document.getElementById("sfondo_menu").style.left=0;
			document.getElementById("sfondo_menu").style.top=0;
			document.getElementById("sfondo_menu").style.visibility = "hidden";
		}
	}
	}
}

function suppo_lay(){
if (document.all!=undefined)
	return true;
else
	return false;
}