function getCookie(name)
{
        name += "=";
        var cookies = document.cookie.split(";");
        for(var i=0; i<cookies.length; i++)
        {
                var start = (cookies[i].charAt(0) == " ")? 1:0;
                var c = cookies[i].substr(start);

                if(!c.indexOf(name))
                {
                        return unescape(c.substr(name.length));
                        break;
                }
        }
        return null;
}

function setCookie(name, value, days)
{
        if(!days) days = 365;
        var oToday = new Date();
        oToday.setTime(oToday.getTime() + (days * 24 * 60 * 60 * 1000));
        document.cookie = name + "=" + escape(value) + "; expires=" + oToday.toGMTString() + "; path=/";
}

function switchdiv()
{
	imp=getCookie('gti_geco_multip');

	if (imp=='multi1')
	{
		imp='multi2';
	}
	else
	{
		imp='multi1';
	}

	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		Suf=document.getElementById("browser").value;
		document.getElementById("multi1").className='pannelloinfo_hide'+Suf;
		document.getElementById("multi2").className='pannelloinfo_hide'+Suf;
		document.getElementById(imp).className='pannelloinfo_show'+Suf;
	}
	else
	{
		if (document.layers)
		{ // Netscape 4
			Suf=document.multi1.value='browser';
			document.multi1.className='pannelloinfo_hide'+Suf;
			document.multi2.className='pannelloinfo_hide'+Suf;
			document.imp.className='pannelloinfo_show'+Suf;
		}
		else
		{ // IE 4
			Suf=document.all.browser.value;
			document.all.multi1.className='pannelloinfo_hide'+Suf;
			document.all.multi2.className='pannelloinfo_hide'+Suf;
			document.all.imp.className='pannelloinfo_show'+Suf;
		}
	}

	setCookie('gti_geco_multip', imp);
}


function HideShowObject(Valore, Oggetto)
{
	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		if (Valore!="")
		{
			document.getElementById(Oggetto).style.visibility = 'visible';
		}
		else
		{
			document.getElementById(Oggetto).style.visibility = 'hidden';			
		}
	}
	else
	{
		if (document.layers)
		{ // Netscape 4
			if (Valore!="")
			{
				document.hideShow.visibility = 'visible';
			}
			else
			{
				document.hideShow.visibility = 'hidden';			
			}
		}
		else
		{ // IE 4
			if (Valore!="")
			{
				document.all.hideShow.style.visibility = 'visible';			
			}
			else
			{
				document.all.hideShow.style.visibility = 'hidden';			
			}
		}
	}
}

function switch_img(Oggetto, Img1, Img2)
{
	// switch tra 2 immagini
	if ((Img1.indexOf(Oggetto.src.substring(Oggetto.src.lastIndexOf('/')+1)))!=-1)
	{
		Oggetto.src=Img2;
	}
	else
	{
 		Oggetto.src=Img1;
	}
}

function hide_text(Oggetto, Text)
{
	// mostra-nasconde un testo
	if (prendiElementoDaId(Oggetto).innerHTML!=Text)
	{
		prendiElementoDaId(Oggetto).innerHTML=Text;
	}
	else
	{
		prendiElementoDaId(Oggetto).innerHTML='&nbsp;';
	}
}



function switchfotovideo()
{
	if (document.getElementById)
	{ // DOM3 = IE5, NS6
		classefoto=document.getElementById("showroomfoto").className;
		classevideo=document.getElementById("showroomvideo").className;
		document.getElementById("showroomfoto").className=classevideo;
		document.getElementById("showroomvideo").className=classefoto;
	}
	else
	{
		if (document.layers)
		{ // Netscape 4
			classefoto=document.showroomfoto.className;
			classevideo=document.showroomvideo.className;
			document.showroomfoto.className=classevideo;
			document.showroomvideo.className=classefoto;
		}
		else
		{ // IE 4
			classefoto=document.all.showroomfoto.className;
			classevideo=document.all.showroomvideo.className;			
			document.all.showroomfoto.className=classevideo;
			document.all.showroomvideo.className=classefoto;
		}
	}
}