
function Is()
{
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ie   = (agent.indexOf("msie") != -1);
	this.ie4  = (this.ie && (this.major >= 4));
	this.win   = (agent.indexOf("win")!=-1);
	this.mac   = (agent.indexOf("mac")!=-1);
}

var is = new Is();

currentBody = null;
timeOn = null;

if(is.ns4)
{
	origWidth = innerWidth;
	origHeight = innerHeight;
	
	doc = "document";
	sty = "";
}

if(is.ie4)
{
	doc = "document.all";
	sty = ".style";
}

if(document.images)
{

	var about1		= new Image();
	about1.src		= "botton1.gif";
	var about2		= new Image();
	about2.src		= "botton1_off.gif";

	var inter1	= new Image();
	inter1.src	= "botton2.gif";
	var inter2	= new Image();
	inter2.src	= "botton2_off.gif";
	
	var incampo1	= new Image();
	incampo1.src	= "botton3.gif";
	var incampo2	= new Image();
	incampo2.src	= "botton3_off.gif";
	
	var rubriche1	= new Image();
	rubriche1.src	= "botton4.gif";
	var rubriche2	= new Image();
	rubriche2.src	= "botton4_off.gif";
	
	var shop1	= new Image();
	shop1.src	= "botton5.gif";
	var shop2	= new Image();
	shop2.src	= "botton5_off.gif";	

	var speciale1	= new Image();
	speciale1.src	= "botton6.gif";
	var speciale2	= new Image();
	speciale2.src	= "botton6_off.gif";		
	
	var gioca1	= new Image();
	gioca1.src	= "botton7.gif";
	var gioca2	= new Image();
	gioca2.src	= "botton7_off.gif";		
}


function highlight(img)
{
	document[img].src = eval(img + "2.src");
	showBody(img);
}

function unhighlight(img, imgNo)
{
	document[img].src = eval(img + "1.src");
}

function highlightClassics(img)
{
	document[img].src = eval(img + "2.src");
}

function unhighlightClassics(img)
{
	document[img].src = eval(img + "1.src");
}

function showBody(nav)
{
	if(currentBody != null)
	{
		myTemp = eval(doc + '["' + currentBody + '"]' + sty);
		myTemp.visibility = "hidden";
	}
	
	currentBody = nav + "Nav";
	myTemp = eval(doc + '["' + currentBody + '"]' + sty);
	myTemp.visibility = "visible";
}

function hideBody(nav)
{
	if(currentBody != null)
	{
		myTemp2 = eval(doc + '["' + currentBody + '"]' + sty);
		myTemp2.visibility = "hidden";
	}
}

function startTimer()
{
	timeOn = setTimeout("hideBody()",293);
}

function stopTimer()
{
	clearTimeout(timeOn);
}



function handleResize()
{
	if(is.ns4)
	{
		if (innerWidth != origWidth || innerHeight != origHeight)
	 	{
	 		origWidth = innerWidth;
	 		origHeight = innerHeight;
	 		location.reload();
	 	}
	}
	
	if(is.ie4)
		setMenus();
}


function setMenus()
{

	if(is.ie4)
		bodyCenter	= (document.body.clientWidth /2);
	
	if(is.ns4)
		bodyCenter	= (window.innerWidth/2);
	
		aboutPos	= bodyCenter - 305;
		interPos	= bodyCenter - 226;
		incampoPos	= bodyCenter - 130;
		rubrichePos	= bodyCenter - 50;
		shopPos = bodyCenter - (-33);
		specialePos = bodyCenter - (-119);		
		giocaPos = bodyCenter - (-216);		
		
						
	if(is.ie4)
	{
		if(aboutPos < 40)
			aboutPos = 39;
			
		if(interPos < 40)
			interPos = 39;
			
		if(incampoPos < 40)
			incampoPos = 39;
			
		if(rubrichePos < 40)
			rubrichePos = 39;			
			
		if(shopPos < 40)
			shopPos = 39;
			
		if(specialePos < 40)
			specialePos = 39;								

	
		if(giocaPos < 40)
			giocaPos = 39;						
			
		document.all.aboutNav.style.left = aboutPos;
        document.all.interNav.style.left = interPos;
		 document.all.incampoNav.style.left = incampoPos;
		 document.all.rubricheNav.style.left = rubrichePos;
		document.all.shopNav.style.left = shopPos;
		 document.all.specialeNav.style.left = specialePos;				
		document.all.giocaNav.style.left = giocaPos;						
	}
	
	if(is.ns4)
	{
		TOP	= 293;
		
		if(aboutPos < 50)
			aboutPos = 49;
			
		if(interPos < 50)
			interPos = 49;
			
		if(incampoPos < 50)
			incampoPos = 49;
			
		if(rubrichePos < 50)
			rubrichePos = 49;			

		if(shopPos < 50)
			shopPos = 49;
			
		if(specialePos < 50)
			specialePos = 49;											
			
		if(giocaPos < 50)
			giocaPos = 49;													
		
		document.aboutNav.moveTo(aboutPos-10,TOP);
        document.interNav.moveTo(interPos-10,TOP);
		document.incampoNav.moveTo(incampoPos-10,TOP);
		document.rubricheNav.moveTo(rubrichePos-10,TOP);
		document.shopNav.moveTo(shopPos-10,TOP);
		document.specialeNav.moveTo(specialePos-10,TOP);				
		document.giocaNav.moveTo(giocaPos-10,TOP);				
	
	}
}



