var isExplorer = navigator.appName == "Microsoft Internet Explorer" && navigator.userAgent.indexOf("Opera") < 0;

function LinkOut( )
{
  this.childNodes[0].style.display = "none";
  this.childNodes[1].style.display = "inline";
  return true;
}

function LinkOver( )
{
  this.childNodes[1].style.display = "none";
  this.childNodes[0].style.display = "inline";
  return true;
}

function BodyLoad( )
{
  var TopLinks = document.getElementById("top").getElementsByTagName("A");
  var ContentLinks = document.getElementById("content").getElementsByTagName("A");
  var LeftBox = document.getElementById("leftbox").getElementsByTagName("A");
  for(var i=0; i<TopLinks.length; i++) if(TopLinks[i].firstChild.tagName.toLowerCase( ) == "img")
  {
    var ClonedImg = TopLinks[i].firstChild.cloneNode(true);
    TopLinks[i].onmouseover = LinkOver;
    TopLinks[i].onmouseout = LinkOut;
    TopLinks[i].onfocus = LinkOver;
    TopLinks[i].onblur = LinkOut;
    ClonedImg.src = ClonedImg.src.replace(/\.0\./, ".1.");
    ClonedImg.style.display = "none";
    TopLinks[i].insertBefore(ClonedImg, TopLinks[i].firstChild);
  }
  for(var i=0; i<ContentLinks.length; i++) if(ContentLinks[i].hasChildNodes)
  {
    if(ContentLinks[i].className == "zoom" && ContentLinks[i].firstChild.nodeType == 1 && ContentLinks[i].firstChild.tagName.toLowerCase( ) == "img")
    {
      ContentLinks[i].onclick = DisplayZoom;
    }
    else if(ContentLinks[i].className == "cart")
    {
      ContentLinks[i].onclick = CartPopup;
    }
    else if(ContentLinks[i].className == "cartfast")
    {
      ContentLinks[i].onclick = CartFastPopup;
    }
    else if(ContentLinks[i].className == "cartmdf")
    {
      ContentLinks[i].onclick = CartMdfPopup;
    }
    else if(ContentLinks[i].className == "changemail")
    {
      ContentLinks[i].onclick = ChangeMailPopup;
    }
    else if(ContentLinks[i].className.search(/(^|\s)confirm(\s|$)/i) >= 0)
    {
      ContentLinks[i].onclick = PopupConfirm;
    }
    if(ContentLinks[i].hasChildNodes())
    {
      if(ContentLinks[i].firstChild.nodeType == 1 && ContentLinks[i].firstChild.tagName.toLowerCase( ) == "img" && ContentLinks[i].firstChild.src.search(/\.0\./) > 0)
      {
        var ClonedImg = ContentLinks[i].firstChild.cloneNode(true);
        ContentLinks[i].onmouseover = LinkOver;
        ContentLinks[i].onmouseout = LinkOut;
        ContentLinks[i].onfocus = LinkOver;
        ContentLinks[i].onblur = LinkOut;
        ClonedImg.src = ClonedImg.src.replace(/\.0\./, ".1.");
        ClonedImg.style.display = "none";
        ContentLinks[i].insertBefore(ClonedImg, ContentLinks[i].firstChild);
      }
    }
  }
  for(var i=0; i<LeftBox.length; i++) 
  {
    if(LeftBox[i].className.search(/(^|\s)confirm(\s|$)/i) >= 0)
    {
      LeftBox[i].onclick = PopupConfirm;
    }
    if(LeftBox[i].hasChildNodes && LeftBox[i].firstChild.nodeType == 1 && LeftBox[i].firstChild.tagName.toLowerCase( ) == "img" && LeftBox[i].firstChild.src.search(/\.0\./) > 0)
    {
      var ClonedImg = LeftBox[i].firstChild.cloneNode(true);
      LeftBox[i].onmouseover = LinkOver;
      LeftBox[i].onmouseout = LinkOut;
      LeftBox[i].onfocus = LinkOver;
      LeftBox[i].onblur = LinkOut;
      ClonedImg.src = ClonedImg.src.replace(/\.0\./, ".1.");
      ClonedImg.style.display = "none";
      LeftBox[i].insertBefore(ClonedImg, LeftBox[i].firstChild);
    }
    if(LeftBox[i].hasChildNodes && LeftBox[i].firstChild.nodeType == 1 && LeftBox[i].firstChild.tagName.toLowerCase( ) == "img" && LeftBox[i].firstChild.src.search(/\.[xy]\./) > 0)
    {
			var ClonedImg = LeftBox[i].firstChild.cloneNode(true);
      LeftBox[i].onclick = BoxClick;
			if(LeftBox[i].firstChild.src.search(/\.x\./) > -1)
				ClonedImg.src = ClonedImg.src.replace(/\.x\./, ".y.");
			else ClonedImg.src = ClonedImg.src.replace(/\.y\./, ".x.");
			ClonedImg.style.display = "none";
			LeftBox[i].insertBefore(ClonedImg, LeftBox[i].firstChild);
    }
  }
	if(GetCookie("notify"))
		PopupNotify( );
}

function CartPopup( )
{
  var Fields = new Array( );
  Fields.push(new Array("qta", "Inserisci la quantità che desideri aggiungere al tuo carrello"));
  DisplayPopup(this, Fields);
  return false;
}

function CartFastPopup( )
{
  var Fields = new Array( );
  Fields.push(new Array("qta", "Inserisci la quantità che desideri acquistare"));
  DisplayPopup(this, Fields);
  return false;
}

function ChangeMailPopup( )
{
  var Fields = new Array( );
  Fields.push(new Array("changemail", "Inserisci il nuovo indirizzo e-mail"));
  DisplayPopup(this, Fields);
  return false;
}

function CartMdfPopup( )
{
  var Fields = new Array( );
  Fields.push(new Array("qta", "Inserisci la nuova quantità di questo prodotto"));
  DisplayPopup(this, Fields);
  return false;
}

function DisplayZoom( )
{
  var BgLayer = document.getElementById("bgopaque");
  var ZoomLayer = document.getElementById("zoom");
  var ImgWidthRx = new RegExp("width[\\:\\=\\x20](\\d+)", "i");
  ImgWidthRx.exec(this.firstChild.alt);
  var ImgWidth = parseInt(RegExp.$1, 10) || 0;
  var ImgHeightRx = new RegExp("height:(\\d+)", "i");
  ImgHeightRx.exec(this.firstChild.alt);
  var ImgHeight = parseInt(RegExp.$1, 10) || 0;
  var ZoomFactor = 1;

  if(!BgLayer)
  {
    BgLayer = document.createElement("DIV");
    BgLayer.id = "bgopaque";
    if(isExplorer)
      BgLayer.style.height = document.documentElement.scrollHeight;
    else BgLayer.style.position = "fixed";
    document.body.appendChild(BgLayer);
  }
  if(!ZoomLayer)
  {
    ZoomLayer = document.createElement("DIV");
    ZoomLayer.id = "zoom";
    if(!isExplorer)
      ZoomLayer.style.position = "fixed";
    var FormZoom = document.createElement("FORM");
    FormZoom.appendChild(document.createElement("IMG"));
    FormZoom.appendChild(document.createElement("BR"));
    var CloseZoom = document.createElement("INPUT");
    CloseZoom.className = "button";
    CloseZoom.type = "button";
    CloseZoom.value = "Chiudi";
    CloseZoom.onclick = HideZoom;
    FormZoom.appendChild(CloseZoom);
    ZoomLayer.appendChild(FormZoom);
    document.body.appendChild(ZoomLayer);
  }
  var ImgZoom = ZoomLayer.getElementsByTagName("IMG")[0];
  if(isExplorer)
  {
    if(document.documentElement.offsetWidth * 0.7 < ImgWidth)
      ZoomFactor = document.documentElement.offsetWidth * 0.7 / ImgWidth;
    if(document.documentElement.offsetHeight * 0.7 < ImgHeight && ZoomFactor > document.documentElement.offsetHeight * 0.7 / ImgHeight)
      ZoomFactor = document.documentElement.offsetHeight * 0.7 / ImgHeight;
  }
  else
  {
    if(window.innerWidth * 0.8 < ImgWidth)
      ZoomFactor = window.innerWidth * 0.8 / ImgWidth;
    if(window.innerHeight * 0.8 < ImgHeight && ZoomFactor > window.innerHeight * 0.8 / ImgHeight)
      ZoomFactor = window.innerHeight * 0.8 / ImgHeight;
  }
  ImgWidth = Math.floor(ImgWidth * ZoomFactor);
  ImgHeight = Math.floor(ImgHeight * ZoomFactor);
  if(this.pathname.charAt(0) == "/")
    ImgZoom.src = "/include/thumbnail.asp?nomefile=" + this.pathname + "&w=" + ImgWidth;
  else ImgZoom.src = "/include/thumbnail.asp?nomefile=" + "/" + this.pathname + "&w=" + ImgWidth;
  ImgZoom.height = ImgHeight;
  ImgZoom.width = ImgWidth;
  if(isExplorer)
    document.documentElement.style.overflow = "hidden";
  BgLayer.style.display = "block";
  ZoomLayer.style.display = "block";
  ZoomLayer.style.left = Math.max(Math.floor((document.documentElement.offsetWidth - ZoomLayer.offsetWidth) / 2), 0) + "px";
  if(isExplorer)
    ZoomLayer.style.top = Math.max(Math.floor(document.documentElement.scrollTop + (document.documentElement.offsetHeight - ZoomLayer.offsetHeight) / 2), 0) + "px";
  else ZoomLayer.style.top = Math.max(Math.floor((window.innerHeight - ZoomLayer.offsetHeight) / 2), 0) + "px";
  BgLayer.style.visibility = "visible";
  ZoomLayer.style.visibility = "visible";
  return false;
}

function HideZoom( )
{
  var BgLayer = document.getElementById("bgopaque");
  var ZoomLayer = document.getElementById("zoom");
  if(isExplorer)
    document.documentElement.style.overflow = "auto";
  ZoomLayer.style.display = "none";
  BgLayer.style.display = "none";
  ZoomLayer.style.visibility = "hidden";
  BgLayer.style.visibility = "hidden";
}

function DisplayPopup(_Link, _Fields)
{
  var BgLayer = document.getElementById("bgopaque");
  var PopupLayer = document.getElementById("popup");
  var FormPopup = null;
  var FormFields = _Link.search.substring(1).split("&");

  if(!BgLayer)
  {
    BgLayer = document.createElement("DIV");
    BgLayer.id = "bgopaque";
    if(isExplorer)
      BgLayer.style.height = document.documentElement.scrollHeight;
    else BgLayer.style.position = "fixed";
    document.body.appendChild(BgLayer);
  }
  if(!PopupLayer)
  {
    PopupLayer = document.createElement("DIV");
    PopupLayer.id = "popup";
    if(!isExplorer)
      PopupLayer.style.position = "fixed";
    FormPopup = document.createElement("FORM");
    var ConfirmPopup = document.createElement("INPUT");
    ConfirmPopup.className = "button";
    ConfirmPopup.type = "submit";
    ConfirmPopup.value = "OK";
    var ClosePopup = document.createElement("INPUT");
    ClosePopup.className = "button";
    ClosePopup.type = "button";
    ClosePopup.value = "Annulla";
    ClosePopup.onclick = HidePopup;
    FormPopup.method = "get";
    FormPopup.enctype = "application/x-www-form-urlencoded";
    FormPopup.appendChild(document.createElement("FIELDSET"));
    FormPopup.appendChild(ConfirmPopup);
    FormPopup.appendChild(ClosePopup);
    PopupLayer.appendChild(FormPopup);
    document.body.appendChild(PopupLayer);
  }

  FormPopup = PopupLayer.firstChild;
  var FieldsetPopup = document.createElement("FIELDSET");
  if(_Link.pathname.charAt(0) == "/")
    FormPopup.action = _Link.pathname;
  else FormPopup.action = "/" + _Link.pathname;

  for(var i=0; i<FormFields.length; i++)
  {
    FormFields[i] = FormFields[i].split("=");
    for(var j=0; j<_Fields.length; j++)
    {
      var HiddenField = true;
      if(_Fields[j][0].toLowerCase( ) == FormFields[i][0].toLowerCase( ))
      {
        var LabelPopup = document.createElement("LABEL");
        LabelPopup.id = "labelpopup";
        LabelPopup.htmlFor = "textpopup";
        LabelPopup.appendChild(document.createTextNode(_Fields[j][1] + ":"))
        var TextPopup = document.createElement("INPUT");
        TextPopup.className = "text";
        TextPopup.name = FormFields[i][0];
        TextPopup.value = unescape(FormFields[i][1].replace(/\+/g, "%20"));
        TextPopup.type = "text";
        FieldsetPopup.appendChild(LabelPopup);
        FieldsetPopup.appendChild(document.createElement("BR"));
        FieldsetPopup.appendChild(TextPopup);
        FieldsetPopup.appendChild(document.createElement("BR"));
        j = _Fields[j].length;
        HiddenField = false;
      }
      if(HiddenField)
      {
        var TextPopup = document.createElement("INPUT");
        TextPopup.name = FormFields[i][0];
				if(FormFields[i][1])
	        TextPopup.value = unescape(FormFields[i][1].replace(/\+/g, "%20"));
        TextPopup.type = "hidden";
        FieldsetPopup.appendChild(TextPopup);
      }
    }
  }
  FormPopup.replaceChild(FieldsetPopup, FormPopup.firstChild);

  if(isExplorer)
    document.documentElement.style.overflow = "hidden";
  BgLayer.style.display = "block";
  PopupLayer.style.display = "block";
  PopupLayer.style.left = Math.max(Math.floor((document.documentElement.offsetWidth - PopupLayer.offsetWidth) / 2), 0) + "px";
  if(isExplorer)
    PopupLayer.style.top = Math.max(Math.floor(document.documentElement.scrollTop + (document.documentElement.offsetHeight - PopupLayer.offsetHeight) / 2), 0) + "px";
  else PopupLayer.style.top = Math.max(Math.floor((window.innerHeight - PopupLayer.offsetHeight) / 2), 0) + "px";
  BgLayer.style.visibility = "visible";
  PopupLayer.style.visibility = "visible";
  var PopupInputs = PopupLayer.getElementsByTagName("INPUT");
  for(var i=0; i<PopupInputs.length; i++) if(PopupInputs[i].type == "text")
  {
    PopupInputs[i].focus( );
    PopupInputs[i].select( );
    i = PopupInputs.length;
  }
  return false;
}

function HidePopup( )
{
  var BgLayer = document.getElementById("bgopaque");
  var PopupLayer = document.getElementById("popup");
  if(isExplorer)
    document.documentElement.style.overflow = "auto";
  PopupLayer.style.display = "none";
  BgLayer.style.display = "none";
  PopupLayer.style.visibility = "hidden";
  BgLayer.style.visibility = "hidden";
}

function PopupConfirm( )
{
  var _Link = this;
  var BgLayer = document.getElementById("bgopaque");
  var PopupLayer = document.getElementById("popupconfirm");
  var FormPopup = null;
  var FormFields = _Link.search.substring(1).split("&");

  if(!BgLayer)
  {
    BgLayer = document.createElement("DIV");
    BgLayer.id = "bgopaque";
    if(isExplorer)
      BgLayer.style.height = document.documentElement.scrollHeight;
    else BgLayer.style.position = "fixed";
    document.body.appendChild(BgLayer);
  }
  if(!PopupLayer)
  {
    PopupLayer = document.createElement("DIV");
    PopupLayer.id = "popupconfirm";
    if(!isExplorer)
      PopupLayer.style.position = "fixed";
    FormPopup = document.createElement("FORM");
    var ConfirmPopup = document.createElement("INPUT");
    ConfirmPopup.className = "button";
    ConfirmPopup.type = "submit";
    ConfirmPopup.value = "Ś";
    var ClosePopup = document.createElement("INPUT");
    ClosePopup.className = "button";
    ClosePopup.type = "button";
    ClosePopup.value = "No";
    ClosePopup.onclick = HidePopupConfirm;
    FormPopup.method = "get";
    FormPopup.enctype = "application/x-www-form-urlencoded";
    FormPopup.appendChild(document.createElement("FIELDSET"));
    FormPopup.appendChild(ConfirmPopup);
    FormPopup.appendChild(ClosePopup);
    PopupLayer.appendChild(FormPopup);
    document.body.appendChild(PopupLayer);
  }

  FormPopup = PopupLayer.firstChild;
  var FieldsetPopup = document.createElement("FIELDSET");
  if(_Link.pathname.charAt(0) == "/")
    FormPopup.action = _Link.pathname;
  else FormPopup.action = "/" + _Link.pathname;

  for(var i=0; i<FormFields.length; i++)
  {
    FormFields[i] = FormFields[i].split("=");
    var TextPopup = document.createElement("INPUT");
    TextPopup.name = FormFields[i][0];
    TextPopup.value = FormFields[i][1];
    TextPopup.type = "hidden";
    FieldsetPopup.appendChild(TextPopup);
  }
  FieldsetPopup.appendChild(document.createTextNode(_Link.title || "Confermi l'operazione?"));
  FormPopup.replaceChild(FieldsetPopup, FormPopup.firstChild);

  if(isExplorer)
    document.documentElement.style.overflow = "hidden";
  BgLayer.style.display = "block";
  PopupLayer.style.display = "block";
  PopupLayer.style.left = Math.max(Math.floor((document.documentElement.offsetWidth - PopupLayer.offsetWidth) / 2), 0) + "px";
  if(isExplorer)
    PopupLayer.style.top = Math.max(Math.floor(document.documentElement.scrollTop + (document.documentElement.offsetHeight - PopupLayer.offsetHeight) / 2), 0) + "px";
  else PopupLayer.style.top = Math.max(Math.floor((window.innerHeight - PopupLayer.offsetHeight) / 2), 0) + "px";
  BgLayer.style.visibility = "visible";
  PopupLayer.style.visibility = "visible";
  var PopupInputs = PopupLayer.getElementsByTagName("INPUT");
  for(var i=0; i<PopupInputs.length; i++) if(PopupInputs[i].type == "submit")
  {
    PopupInputs[i].focus( );
    i = PopupInputs.length;
  }
  return false;
}

function HidePopupConfirm( )
{
  var BgLayer = document.getElementById("bgopaque");
  var PopupLayer = document.getElementById("popupconfirm");
  if(isExplorer)
    document.documentElement.style.overflow = "auto";
  PopupLayer.style.display = "none";
  BgLayer.style.display = "none";
  PopupLayer.style.visibility = "hidden";
  BgLayer.style.visibility = "hidden";
}

function PopupNotify( )
{
  var BgLayer = document.getElementById("bgopaque");
  var NotifyLayer = document.getElementById("popupconfirm");
  var FormPopup = null;

  if(!BgLayer)
  {
    BgLayer = document.createElement("DIV");
    BgLayer.id = "bgopaque";
    if(isExplorer)
      BgLayer.style.height = document.documentElement.scrollHeight;
    else BgLayer.style.position = "fixed";
    document.body.appendChild(BgLayer);
  }
  if(!NotifyLayer)
  {
    NotifyLayer = document.createElement("DIV");
    NotifyLayer.id = "popupnotify";
    if(!isExplorer)
      NotifyLayer.style.position = "fixed";
    FormPopup = document.createElement("FORM");
    var ConfirmPopup = document.createElement("INPUT");
    ConfirmPopup.className = "button";
    ConfirmPopup.type = "button";
    ConfirmPopup.value = "OK";
    ConfirmPopup.onclick = PopupNotifyClose;
    FormPopup.method = "get";
    FormPopup.enctype = "application/x-www-form-urlencoded";
    FormPopup.appendChild(document.createElement("FIELDSET"));
    FormPopup.appendChild(ConfirmPopup);
    NotifyLayer.appendChild(FormPopup);
    document.body.appendChild(NotifyLayer);
  }

  FormPopup = NotifyLayer.firstChild;
  var FieldsetPopup = document.createElement("FIELDSET");

  FieldsetPopup.innerHTML = GetCookie("notify");
  FormPopup.replaceChild(FieldsetPopup, FormPopup.firstChild);

  if(isExplorer)
    document.documentElement.style.overflow = "hidden";
  BgLayer.style.display = "block";
  NotifyLayer.style.display = "block";
  NotifyLayer.style.left = Math.max(Math.floor((document.documentElement.offsetWidth - NotifyLayer.offsetWidth) / 2), 0) + "px";
  if(isExplorer)
    NotifyLayer.style.top = Math.max(Math.floor(document.documentElement.scrollTop + (document.documentElement.offsetHeight - NotifyLayer.offsetHeight) / 2), 0) + "px";
  else NotifyLayer.style.top = Math.max(Math.floor((window.innerHeight - NotifyLayer.offsetHeight) / 2), 0) + "px";
  BgLayer.style.visibility = "visible";
  NotifyLayer.style.visibility = "visible";
  var PopupInputs = NotifyLayer.getElementsByTagName("INPUT");
  for(var i=0; i<PopupInputs.length; i++) if(PopupInputs[i].type == "submit")
  {
    PopupInputs[i].focus( );
    i = PopupInputs.length;
  }
  return false;
}

function PopupNotifyClose( )
{
	SetCookie("notify", "");
  var BgLayer = document.getElementById("bgopaque");
  var NotifyLayer = document.getElementById("popupnotify");
  if(isExplorer)
    document.documentElement.style.overflow = "auto";
  NotifyLayer.style.display = "none";
  BgLayer.style.display = "none";
  NotifyLayer.style.visibility = "hidden";
  BgLayer.style.visibility = "hidden";
}

function ShowHideGhost(Id, Show)
{
  var ContentDiv = document.getElementById("content");
	var ReturnValue = true;
	if(ContentDiv)
	{
  	var SubCats = ContentDiv.getElementsByTagName("DIV");
		for(var i=0; i<SubCats.length; i++)
  	{
  	  if(SubCats[i].className == "subcat")
  		{
  			if(SubCats[i].id == "cat_" + Id)
				{
					SubCats[i].style.display = "block";
					ReturnValue = false;
				}
				else SubCats[i].style.display = "none";
  		}
  	}
	}
	if(ReturnValue)
	  location.href = "/prodotti.asp?categoria=" + Id;
	return ReturnValue;
}

function DisplayCat(_this)
{
	var IdCategoria = _this.options[_this.selectedIndex].value;
	if(IdCategoria.indexOf(".") > -1)
	{
		IdSottoCategoria = IdCategoria.substring(IdCategoria.indexOf(".") + 1, IdCategoria.length).toUpperCase( );
		IdCategoria = IdCategoria.substring(0, IdCategoria.indexOf(".")).toUpperCase( );
		location.href = "/items.asp?categoria=" + IdCategoria + "&sottocategoria=" + IdSottoCategoria;
	}
	else ShowHideGhost(IdCategoria);
	return false;
}

function DisplayFset(IdFset)
{
	if(document.getElementById(IdFset))
	{
		document.getElementById("prevendita").style.display = IdFset == "prevendita" ? "block" : "none";
		document.getElementById("postvendita").style.display = IdFset == "postvendita" ? "block" : "none";
		document.getElementById("contatto").style.display = "block";
		document.getElementById("sendh").style.display = "inline";
    document.getElementById("formassistenza").action = "?" + location.search.match(/art=\d*/) + "&displayfset=" + IdFset;
  }
	return false;
}

function BoxClick( )
{
	var oBox = null, rOK = true;
	if(this)
	{
	  rOK = false;
		if(this.childNodes[1].style.display == "none")
		{
			this.childNodes[0].style.display = "none";
  		this.childNodes[1].style.display = "inline";
		}
		else
		{
			this.childNodes[1].style.display = "none";
  		this.childNodes[0].style.display = "inline";
		}
		if(this.nextSibling.nodeType == 1 && (this.nextSibling.tagName.toUpperCase( ) == "DL" || this.nextSibling.tagName.toUpperCase( ) == "FORM"))
		{
			if(this.nextSibling.style.display == "none")
			{
				this.nextSibling.style.display = "block";
				SetCookie(this.id, "1");
			}
			else
			{
				this.nextSibling.style.display = "none";
 				SetCookie(this.id, "0");
			}
		}
	}
	return rOK;
}

function HideBox(_Boxname)
{
	var oBox = null, rOK = true;
	if(document.getElementById(_Boxname))
		oBox = document.getElementById(_Boxname);
	else if(isExplorer && document.all(_Boxname))
		oBox = document.all(_Boxname);
	if(oBox)
	{
		rOK = false;
		if(oBox.childNodes[1].style.display == "none")
		{
			oBox.childNodes[0].style.display = "none";
  		oBox.childNodes[1].style.display = "inline";
		}
		else
		{
			oBox.childNodes[1].style.display = "none";
  		oBox.childNodes[0].style.display = "inline";
		}
		if(oBox.nextSibling.nodeType == 1 && (oBox.nextSibling.tagName.toUpperCase( ) == "DL" || oBox.nextSibling.tagName.toUpperCase( ) == "FORM"))
			oBox.nextSibling.style.display = "none";
	}
	SetCookie(_Boxname, "0");
	return rOK;
}

function SetCookie(sName, sValue)
{
  CookieExpire = new Date( );
	CookieExpire.setFullYear(CookieExpire.getFullYear( ) + 100);
	document.cookie = sName + "=" + escape(sValue) + "; expires=" + CookieExpire.toGMTString();
}

function GetCookie(sName)
{
	var aCookie = document.cookie.split("; ");
	for(var i=0; i < aCookie.length; i++)
	{
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0]) 
			return unescape(aCrumb[1].replace(/\+/g, "%20"));
	}
	return null;
}

function ChangeInfoAggiuntive(Value)
{
  document.getElementById('hidinfoaggiuntive').innerHTML=Value;
  document.getElementById('hidinfoaggiuntive').style.display=Value? 'inline' : 'none';
}

var MouseX = 0;
var MouseY = 0;
function MouseXY(e)
{
  if(!e) e=window.event;
  if(isExplorer)
  {
    MouseX=event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
    MouseY=event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
  }
  else
  {
    MouseX=e.pageX;
    MouseY=e.pageY;
  }
  document.getElementById('hidinfoaggiuntive').style.top=(MouseY-5)+'px';
  document.getElementById('hidinfoaggiuntive').style.left=(MouseX+40)+'px';
}

window.onload = BodyLoad;

