function MM_timelinePlay(tmLnName, myID) { 
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); 
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}
  if (myID == tmLn.ID) { 
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j]; 
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}


function MM_effectAppearFade(targetElement, duration, from, to, toggle)
{
  Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}


function MM_effectShake(targetElement)
{
  Spry.Effect.enforceVisible(Spry.Effect.getElement(targetElement));  
  Spry.Effect.DoShake(targetElement);
}


function MM_effectShakeOminoArancione(targetElement, tempo)
{
  setTimeout("MM_effectShake('" + targetElement + "')", tempo);
}


// Se la funzione getElementsByClassName non è implementata dal browser la creo

function getElementsByClassName(className)
{
    var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
    var allElements = document.getElementsByTagName("*");
    var results = [];

    var element;
    for (var i = 0; (element = allElements[i]) != null; i++)
    {
	var elementClass = element.className;
	if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass)) results.push(element);
    }
    return results;
}


function Get_BrowserWidth()
{
  var FF_ScrollBarWidth = 20;
  
  if (typeof window.innerWidth != 'undefined')
  {
      return window.innerWidth - FF_ScrollBarWidth;
  }
  else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
  {
       return document.documentElement.clientWidth;
  }
  else
  {
       return document.getElementsByTagName('body')[0].clientWidth;
  }
}

function Get_BrowserHeight()
{
  var FF_ScrollBarHeight = 20;

  if (typeof window.innerHeight != 'undefined')
  {
      return window.innerHeight - FF_ScrollBarHeight;
  }
  else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientHeight !=
     'undefined' && document.documentElement.clientHeight != 0)
  {
       return document.documentElement.clientHeight;
  }
  else
  {
       return document.getElementsByTagName('body')[0].clientHeight;
  }
}


function GetScrollY()
{
  if (self.pageYOffset) // all except Explorer
  {
	return self.pageYOffset;
  }
  else if (document.documentElement && document.documentElement.scrollTop)	// Explorer 6 Strict
  {
	return document.documentElement.scrollTop;
  }
  else if (document.body) // all other Explorers
  {
 	return document.body.scrollTop;
  }
  return null;
}

function GetScrollX()
{
  if (self.pageXOffset) // all except Explorer
  {
	return self.pageXOffset;
  }
  else if (document.documentElement && document.documentElement.scrollLeft)	// Explorer 6 Strict
  {
	return document.documentElement.scrollLeft;
  }
  else if (document.body) // all other Explorers
  {
 	return document.body.scrollLeft;
  }
  return null;
}

function GetNumber(testo)
{
  return testo.replace(/\D/g,'');
}


function SEO_ShowText(id)
{
  Spry.Effect.DoFade(id, {duration: 250, from: 0, to: 90, toggle: false, setup: Spry.Effect.setStyleProp(Spry.Effect.getElement(id), 'z-index', 100)});
}


function SEO_HideText(id)
{
  Spry.Effect.DoFade(id, {duration: 250, from: 90, to: 0, toggle: false, finish: Spry.Effect.setStyleProp(Spry.Effect.getElement(id), 'z-index', 0)});	
}

function Get_Event(e)
{
  var targ;
  if (!e) var e = window.event;
  if (e.target) targ = e.target;
  else if (e.srcElement) targ = e.srcElement;
  // defeat Safari bug
  if (targ.nodeType == 3) targ = targ.parentNode;
  
  return targ;
}


function getMouseX(e)
{
  var IE = document.all?true:false;
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX - ScrollX();
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}

  return tempX;
}

function getMouseY(e)
{
  var IE = document.all?true:false;
  if (IE) { // grab the x-y pos.s if browser is IE
    tempY = event.clientY;
  } else {  // grab the x-y pos.s if browser is NS
    tempY = e.pageY - ScrollY();
  }  
  // catch possible negative values in NS4
  if (tempY < 0){tempY = 0}

  return tempY;
}

function MouseControl(e) {
  if( !e ) {
    if( window.event ) {
      //Internet Explorer
      e = window.event;
    } else {
      //total failure, we have no way of referencing the event
      return;
    }
  }
  if( typeof( e.pageX ) == 'number' ) {
    //most browsers
    var xcoord = e.pageX;
    var ycoord = e.pageY;
  } else if( typeof( e.clientX ) == 'number' ) {
    //Internet Explorer and older browsers
    //other browsers provide this, but follow the pageX/Y branch
    var xcoord = e.clientX;
    var ycoord = e.clientY;
    var badOldBrowser = ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) ||
     ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ||
     ( navigator.vendor == 'KDE' );
    if( !badOldBrowser ) {
      if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //IE 4, 5 & 6 (in non-standards compliant mode)
        xcoord += document.body.scrollLeft;
        ycoord += document.body.scrollTop;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE 6 (in standards compliant mode)
        xcoord += document.documentElement.scrollLeft;
        ycoord += document.documentElement.scrollTop;
      }
    }
  } else {
    //total failure, we have no way of obtaining the mouse coordinates
    return;
  }
  
  var element = (typeof event !== 'undefined')? event.srcElement : e.target;
   
  // cancelliamo sempre tutti i div
  // SEO_HideCategoryPreview();
  
  // applichiamo la visualizzazione solo quando l'elmento target del mouse è uno di quelli ke vogliamo
  if (element.id.indexOf('ImgCategoriaContainer') != -1) SEO_MoveCategoryPreview(GetNumber(element.id), xcoord, ycoord);
  if (element.id.indexOf('ID_CategoriaMiddle') != -1) SEO_MoveCategoryPreview(GetNumber(element.id), xcoord, ycoord);
  if (element.id.indexOf('LinkCategoria') != -1) SEO_MoveCategoryPreview(GetNumber(element.id), xcoord, ycoord);
 
  SEO_HideCategoryPreview(element, xcoord, ycoord);
}

var DeltaMouseBottom = 30; // è la distanza che voglio mettere tra la freccia del mouse e il div quando è in basso
var DeltaMouseTop = 10; // è la distanza che voglio mettere tra la freccia del mouse e il div quando è in alto
var DeltaMouseRight = 20; // è la distanza che voglio mettere tra la freccia del mouse e il div quando è a destra
var DeltaMouseLeft = 10; // è la distanza che voglio mettere tra la freccia del mouse e il div quando è a sinistra
var BarreDiScorrimento = 25;  // margine per le barre di scorrimento
var SEO_Div = new Array();

function StartMouseControl()
{
  SEO_Div = getElementsByClassName('CategoriesPreview');
  
  if (window.captureEvents)
  {
      window.captureEvents(Event.MOUSEMOVE);
      window.onmousemove = MouseControl;
  }
  else document.onmousemove = MouseControl;
}

function SEO_MoveCategoryPreview(element_id, x, y)
{
    if (Spry.Effect.getStyleProp(SEO_Div[element_id], 'visibility') != 'visible')
    {
        Spry.Effect.setStyleProp(Spry.Effect.getElement('ImgCategoria' + element_id), 'background-image', 'url(../img_regali_aziendali/preview_hover.png)');
        Spry.Effect.DoFade(SEO_Div[element_id], {duration: 0, from: 0, to: 90, toggle: false});
        Spry.Effect.setStyleProp(SEO_Div[element_id], 'z-index', 100);
        Spry.Effect.setStyleProp(SEO_Div[element_id], 'visibility', 'visible');
    }

    if ((y + SEO_Div[element_id].offsetHeight - GetScrollY() + BarreDiScorrimento) > Get_BrowserHeight())
    {
        y = y - SEO_Div[element_id].offsetHeight - (DeltaMouseBottom + DeltaMouseTop);
    }    
    
    if ((x + SEO_Div[element_id].offsetWidth - GetScrollX() + BarreDiScorrimento) > Get_BrowserWidth())
    {
        x = x - SEO_Div[element_id].offsetWidth - (DeltaMouseRight + DeltaMouseLeft);
    }    
    
    y = y + DeltaMouseBottom;
    x = x + DeltaMouseRight;
    
    Spry.Effect.setStyleProp(SEO_Div[element_id], 'left', x + 'px');
    Spry.Effect.setStyleProp(SEO_Div[element_id], 'top', y + 'px');
}

function SEO_HideCategoryPreview(element, x, y)
{
  if ((element.id.indexOf('ImgCategoriaContainer') == -1) && (element.id.indexOf('ID_CategoriaMiddle') == -1) && (element.id.indexOf('LinkCategoria') == -1))
  {
      for(i=0; i<SEO_Div.length; i++)
      {
          Spry.Effect.setStyleProp(Spry.Effect.getElement('ImgCategoria' + i), 'background-image', 'url(../img_regali_aziendali/preview.png)');
          Spry.Effect.setStyleProp(SEO_Div[i], 'z-index', 0);
          Spry.Effect.setStyleProp(SEO_Div[i], 'visibility', 'hidden');
      }
      return true;
  }
  else
  {
      element_id = GetNumber(element.id);
      for(i=0; i<SEO_Div.length; i++)
      {
          if (element_id != i)
          {
              Spry.Effect.setStyleProp(Spry.Effect.getElement('ImgCategoria' + i), 'background-image', 'url(../img_regali_aziendali/preview.png)');
	      
              Spry.Effect.setStyleProp(SEO_Div[i], 'z-index', 0);
              Spry.Effect.setStyleProp(SEO_Div[i], 'visibility', 'hidden');
          }
      }
  }
}


function ShowDocumentDescription()
{
    element = Spry.Effect.getElement('ID_CategoriesDescription');
    Spry.Effect.setStyleProp(element, 'height', 'auto');
    // element.removeAttribute('overflow');
    Spry.Effect.setStyleProp(element, 'overflow', 'visible');
    FitShadow();
}

function HideDocumentDescription()
{
    element = Spry.Effect.getElement('ID_CategoriesDescription');
    Spry.Effect.setStyleProp(element, 'height', '110px');
    Spry.Effect.setStyleProp(element, 'overflow', 'hidden');
    FitShadow();
}


function LoadPreviewIcon()
{
    for(i=0; i<SEO_Div.length; i++)
    {
	element = Spry.Effect.getElement('ImgCategoriaContainer' + i);
	element.src = element.title;
	element.removeAttribute('title');
    }
}


function findPosX(obj)
{
  var curleft = 0;
  if(obj.offsetParent)
    while(1) 
    {
      curleft += obj.offsetLeft;
      if(!obj.offsetParent) break;
      obj = obj.offsetParent;
    }
    else if(obj.x) curleft += obj.x;
    return curleft;
  }

function findPosY(obj)
{
  var curtop = 0;
  if(obj.offsetParent)
  while(1)
  {
    curtop += obj.offsetTop;
    if(!obj.offsetParent) break;
    obj = obj.offsetParent;
  }
  else if(obj.y) curtop += obj.y;
  return curtop;
}


function HideSEO()
{
    DIV_Seo = Spry.Effect.getElement('ID_SeoLinks');
    Spry.Effect.setStyleProp(DIV_Seo, 'visibility', 'hidden');
}


function FitShadow()
{
  var ID_Content_Bottom_Top = findPosY(Spry.Effect.getElement('ID_Content_Bottom')); 
  Spry.Effect.setStyleProp(Spry.Effect.getElement('ID_Shadow_BottomCorner'), 'top', ID_Content_Bottom_Top + 'px');
  
  var ID_Index_Top = findPosY(Spry.Effect.getElement('ID_Index'));
  Spry.Effect.setStyleProp(Spry.Effect.getElement('ID_Shadow_TopCorner'), 'top', ID_Index_Top + 'px');
  
  var ID_Content_Bottom_Height = parseInt(Spry.Effect.getStyleProp(Spry.Effect.getElement('ID_Content_Bottom'), 'height')) + 1; // aggiungo 1 per via del bordo
  var ID_Shadow_Bottom_Top = ID_Content_Bottom_Top + ID_Content_Bottom_Height;
  Spry.Effect.setStyleProp(Spry.Effect.getElement('ID_Shadow_Bottom'), 'top', ID_Shadow_Bottom_Top + 'px');
  
  var ID_Index_Height = parseInt(Spry.Effect.getStyleProp(Spry.Effect.getElement('ID_Index'), 'height'));
  var ID_Shadow_Middle_Top = ID_Index_Top + ID_Index_Height;
  Spry.Effect.setStyleProp(Spry.Effect.getElement('ID_Shadow_Middle'), 'top', ID_Shadow_Middle_Top + 'px');
  Spry.Effect.setStyleProp(Spry.Effect.getElement('ID_Shadow_Middle'), 'height', (ID_Content_Bottom_Top - ID_Shadow_Middle_Top) + 'px');
  
  Spry.Effect.setStyleProp(Spry.Effect.getElement('ID_Content_Info_PuntoPromotion'), 'top', ID_Shadow_Bottom_Top + 'px');
  var ID_SeoLinks_Top = ID_Shadow_Bottom_Top + parseInt(Spry.Effect.getStyleProp(Spry.Effect.getElement('ID_Content_Info_PuntoPromotion'), 'height'));
  Spry.Effect.setStyleProp(Spry.Effect.getElement('ID_SeoLinks'), 'top', ID_SeoLinks_Top + 'px');
  
  setTimeout("HideSEO()", 1500);
}


function LoadExternalFile(filename, filetype){
 if (filetype=="js"){ //if filename is a external JavaScript file
  var fileref=document.createElement('script')
  fileref.setAttribute("type","text/javascript")
  fileref.setAttribute("src", filename)
 }
 else if (filetype=="css"){ //if filename is an external CSS file
  var fileref=document.createElement("link")
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("href", filename)
 }
 if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref)
}


var FontLarge = true;
function increaseFontSize(id, font_small, font_large) 
{
	var s = Spry.Effect.getElement(id);
	
	if (!FontLarge)
	{
		Spry.Effect.setStyleProp(s, 'fontSize', font_small); 
	}
	else
	{
		Spry.Effect.setStyleProp(s, 'fontSize', font_large); 
	}
	
	FontLarge = !FontLarge;
	
	FitShadow();
}


HTTPRequest = function(){};
with({$: HTTPRequest.prototype}){
	$.isSupported = function(){
		return !!this.getConnection();
	};
	$.events = ["start", "open", "send", "load", "end"];
	$.filter = encodeURIComponent;
	$.getConnection = function(){
		var i, o = [function(){return new ActiveXObject("Msxml2.XMLHTTP");},
		function(){return new ActiveXObject("Microsoft.XMLHTTP");},
		function(){return new XMLHttpRequest;}];
		for(i = o.length; i--;) try{return o[i]();} catch(e){}
		return null;
	};
	$.formatParams = function(params){
		var i, r = [];
		for(i in params) r[r.length] = i + "=" + (this.filter ? this.filter(params[i]) : params[i]);
		return r.join("&");
	};
	$.get = function(url, params, handler, waitResponse){
		return this.request("GET", url + (url.indexOf("?") + 1 ? "&" : "?") + this.formatParams(params), null, handler, null, waitResponse);
	};
	$.post = function(url, params, handler, waitResponse){
		return this.request("POST", url, params = this.formatParams(params), handler, {
			"Connection": "close",
			"Content-Length": params.length,
			"Method": "POST " + url + " HTTP/1.1",
			"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
		}, waitResponse);
	};
	$.request = function(method, url, params, handler, headers, waitResponse){
		var i, o = this.getConnection(), f = handler instanceof Function;
		try{
			o.open(method, url, !waitResponse);
			waitResponse || (o.onreadystatechange = function(){
				var s = $.events[o.readyState];
				f ? handler(o) : s in handler && handler[s](o);
			});
			o.setRequestHeader("HTTP_USER_AGENT", "XMLHttpRequest");
			for(i in headers)
				o.setRequestHeader(i, headers[i]);
			o.send(params);
			waitResponse && (f ? handler(o) : handler["end"] && handler["end"](o));
			return true;
		}
		catch(e){
			return false;
		}
	};
}


function NavigateToPage(page_url)
{
    window.location = page_url;  
}

function SE_NavigateToPageByProductCode()
{
    se = Spry.Effect.getElement('CodiceProdotto');
    
    suggerimenti = se[se.selectedIndex].innerHTML.split(" - ", 2);
    var dati_se = new HTTPRequest;
    dati_se.post('http://www.promotionmania.com/cp/xml/se_search.php', {txt: suggerimenti[0]}, {"end": dati_se.post('http://www.promotionmania.com/cp/xml/se_search.php', {txt: suggerimenti[1]}, {"end": NavigateToPage(se[se.selectedIndex].value)})});
}

function SE_NavigateToPageByChar()
{
    se = Spry.Effect.getElement('OrdineAlfabetico');
    
    suggerimenti = se[se.selectedIndex].innerHTML.split(" - (Codice: ", 2);
    suggerimenti[1] = suggerimenti[1].replace(')', '');
        
    var dati_se = new HTTPRequest;
    dati_se.post('http://www.promotionmania.com/cp/xml/se_search.php', {txt: suggerimenti[0]}, {"end": dati_se.post('http://www.promotionmania.com/cp/xml/se_search.php', {txt: suggerimenti[1]}, {"end": NavigateToPage(se[se.selectedIndex].value)})});
}

function SE_Close()
{
    se_suggestion = Spry.Effect.getElement('ID_SuggestionMotoreDiRicerca');
    se_chiudi = Spry.Effect.getElement('SE_Chiudi');
    Spry.Effect.setStyleProp(se_suggestion, 'visibility', 'hidden');
    Spry.Effect.setStyleProp(se_chiudi, 'visibility', 'hidden');
}

function LoadSE_Suggestion(xml)
{
    var suggestion_div_list = getElementsByClassName('se_listdata');
    var suggestion_list = xml.responseText.split(",", 10);

    for (i=0; i<10; i++)
    {
	if (i<suggestion_list.length) {suggestion_div_list[i].innerHTML = suggestion_list[i];}
	else {suggestion_div_list[i].innerHTML = '';}
    }
}

function CallSE_Suggestion()
{
    testo = Spry.Effect.getElement('Input_MotoreDiRicerca').value;
    
    var dati_se = new HTTPRequest;
    dati_se.post('http://www.promotionmania.com/cp/xml/se_suggestion.php', {text: testo}, {"end": LoadSE_Suggestion});
}


function DoSearch()
{
    alert('qui si dovrebbe chiamare la pagina di ricerca con il contenuto del campo "cerca"');
}

function CallSERP()
{
    SE_Close();
    SE_Input = Spry.Effect.getElement('Input_MotoreDiRicerca').value;
    
    // inserisco i dati su cosa viene cercato nel database    
    var dati_se = new HTTPRequest;
    dati_se.post('http://www.promotionmania.com/cp/xml/se_search.php', {txt: SE_Input}, {"end": DoSearch});
}

function SE_handleKeyUp(oEvent)
{

    var iKeyCode = oEvent.keyCode;
    
    if (iKeyCode == 13)
    {
	CallSERP();
    }

    if (iKeyCode == 7 || iKeyCode == 8)
    {
	CallSE_Suggestion();
    }

    //make sure not to interfere with non-character keys
    if (iKeyCode < 32 || (iKeyCode >= 33 && iKeyCode <= 46) || (iKeyCode >= 112 && iKeyCode <= 123)) {
        //ignore
    } else {
        CallSE_Suggestion();
    }
}


function SetProductsCodeList(xml)
{   
    Spry.Effect.getElement('CodiceProdotto').innerHTML = xml.responseText;
    if(document.all)
    { 
	Spry.Effect.getElement('CodiceProdotto').outerHTML = '<select name="CodiceProdotto" id="CodiceProdotto">' + xml.responseText + '</select>';
    }
}

function SetProductsNameList(xml)
{
    Spry.Effect.getElement('OrdineAlfabetico').innerHTML = xml.responseText;
    if(document.all)
    { 
	Spry.Effect.getElement('OrdineAlfabetico').outerHTML = '<select name="OrdineAlfabetico" id="OrdineAlfabetico">' + xml.responseText + '</select>';
    }
}


function LoadMotoreDiRicerca()
{
    // Carico le liste di prodotti in ordine di codice e alfabetico
    var dati_se = new HTTPRequest;
    dati_se.post('http://www.promotionmania.com/cp/xml/se_load_productcode.php', null, {"end": SetProductsCodeList});
    dati_se.post('http://www.promotionmania.com/cp/xml/se_load_productname.php', null, {"end": SetProductsNameList});

    page_container = Spry.Effect.getElement('ID_Index');
  
    element = Spry.Effect.getElement('ID_MotoreDiRicerca');
    Spry.Effect.setStyleProp(element, 'top', findPosY(page_container) + 291 + 'px');
    Spry.Effect.setStyleProp(element, 'visibility', 'visible');
     
    se_suggestion = Spry.Effect.getElement('ID_SuggestionMotoreDiRicerca');
    Spry.Effect.setStyleProp(se_suggestion, 'top', findPosY(element) + 22 + 'px');
    
    se_chiudi = Spry.Effect.getElement('SE_Chiudi');
    Spry.Effect.setStyleProp(se_chiudi, 'top', findPosY(element) + 28 + 'px');
    
    
    SE_Input = Spry.Effect.getElement('Input_MotoreDiRicerca');
    
    SE_Input.onfocus = function (oEvent)
    {
	SE_Input.select();
	Spry.Effect.setStyleProp(se_suggestion, 'visibility', 'visible');
	Spry.Effect.setStyleProp(se_chiudi, 'visibility', 'visible');	
	CallSE_Suggestion();
    }    
  
    SE_Input.onkeyup = function (oEvent)
    {
        if (!oEvent)
	{
            oEvent = window.event;
        }    
        SE_handleKeyUp(oEvent);
    }
    
    var suggestion_div_list = getElementsByClassName('se_listdata');

    for (i=0; i<10; i++)
    {
	suggestion_div_list[i].onclick = function (e)
	{
	    var targ;
	    if (!e) var e = window.event;
	    if (e.target) targ = e.target;
	    else if (e.srcElement) targ = e.srcElement;
	    if (targ.nodeType == 3) targ = targ.parentNode; // defeat Safari bug 
  
	    SE_Input.value = targ.innerHTML;
	    SE_Close();
	}
    }
}

function StartPage()
{
    StartMouseControl();
    LoadPreviewIcon();
    setTimeout("LoadMotoreDiRicerca()", 1500);
}


function MM_initTimelines() { 
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    var macIE5 = (navigator.platform ? (navigator.platform == "MacPPC") : false) && (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4);
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(30);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 20;



	function GetObjectByID(parent_id, id)
	{
		if (parent_id = "")
		{
    			if (ns4) res = document[id];
    			else if (ns5) res = document.getElementById(id);
    			else res = document.all ? document.all[id] : null;	
		}
		else
		{
    			if (ns4) res = document[parent_id] ? document[parent_id].document[id] : document[id];
    			else 	if (ns5) res = document.getElementById(id);
    				else res = document.all ? document.all[id] : null;
		}

		return res;	
	}


    	S00 = new String("sprite");
    	S00.slot = 1;
	S00.obj = GetObjectByID("", "ID_Index");
    	S00.keyFrames = new Array(1, 10);
    	S00.values = new Array(1);
    	if (ns5 || macIE5) S00.values[0] = new Array("98px", "196px", "294px", "392px", "490px", "589px", "687px", "785px", "883px", "982px");
    	else S00.values[0] = new Array(98,196,294,392,490,589,687,785,883,982);
    	S00.values[0].prop = "width";
    	if (!ns4) S00.values[0].prop2 = "style";
	document.MM_Time[0][0] = S00;



    	S01 = new String("sprite");
    	S01 .slot = 2;
	S01 .obj = GetObjectByID("ID_Index", "ID_Index_Regali_Aziendali"); 
    	S01 .keyFrames = new Array(1, 3);
    	S01 .values = new Array(1);
    	S01 .values[0] = new Array("hidden","visible");
    	S01 .values[0].prop = "visibility";
    	if (!ns4) S01 .values[0].prop2 = "style";
	document.MM_Time[0][1] = S01;



    	S02 = new String("sprite");
    	S02.slot = 3;
    	S02.obj = GetObjectByID("ID_Index", "ID_Index_Gadget_Personalizzati"); 
    	S02.keyFrames = new Array(1, 6);
    	S02.values = new Array(1);
    	S02.values[0] = new Array("hidden","visible");
    	S02.values[0].prop = "visibility";
	if (!ns4) S02.values[0].prop2 = "style";
	document.MM_Time[0][2] = S02;



    	S03 = new String("sprite");
    	S03.slot = 4;
	S03.obj = GetObjectByID("ID_Index", "ID_Index_Articoli_Promozionali"); 
    	S03.keyFrames = new Array(1, 9);
    	S03.values = new Array(1);
    	S03.values[0] = new Array("hidden","visible");
    	S03.values[0].prop = "visibility";
    	if (!ns4) S03.values[0].prop2 = "style";
	document.MM_Time[0][3] = S03;



    	S04 = new String("sprite");
    	S04.slot = 5;
	S04.obj = GetObjectByID("ID_Index", "ID_Index_Gadget_Promozionali"); 
    	S04.keyFrames = new Array(1, 12);
    	S04.values = new Array(1);
    	S04.values[0] = new Array("hidden","visible");
    	S04.values[0].prop = "visibility";
    	if (!ns4) S04.values[0].prop2 = "style";
	document.MM_Time[0][4] = S04;



    	S05 = new String("sprite");
    	S05.slot = 6;
	S05.obj = GetObjectByID("ID_Index", "ID_Index_Gadget_Aziendali"); 
    	S05.keyFrames = new Array(1, 15);
    	S05.values = new Array(1);
    	S05.values[0] = new Array("hidden","visible");
    	S05.values[0].prop = "visibility";
    	if (!ns4) S05.values[0].prop2 = "style";
	document.MM_Time[0][5] = S05;



    	S06 = new String("sprite");
    	S06.slot = 7;
	S06.obj = GetObjectByID("ID_Index", "ID_Index_Abbigliamento_Promozionali"); 
    	S06.keyFrames = new Array(1, 18);
    	S06.values = new Array(1);
    	S06.values[0] = new Array("hidden","visible");
    	S06.values[0].prop = "visibility";
    	if (!ns4) S06.values[0].prop2 = "style";
	document.MM_Time[0][6] = S06;


    	S07 = new String("sprite");
    	S07.slot = 8;
	S07.obj = GetObjectByID("ID_Index", "ID_Index_Gadget_Fiere"); 
    	S07.keyFrames = new Array(1, 21);
    	S07.values = new Array(1);
    	S07.values[0] = new Array("hidden","visible");
    	S07.values[0].prop = "visibility";
    	if (!ns4) S07.values[0].prop2 = "style";
	document.MM_Time[0][7] = S07;


    	S08 = new String("sprite");
    	S08.slot = 9;
	S08.obj = GetObjectByID("ID_Index", "ID_Index_Sfondo"); 
    	S08.keyFrames = new Array(1, 10);
    	S08.values = new Array(1);
    	if (ns5 || macIE5) S08.values[0] = new Array("0px", "196px", "294px", "392px", "490px", "589px", "687px", "785px", "883px", "982px");
    	else S08.values[0] = new Array(0,196,294,392,490,589,687,785,883,982);
    	S08.values[0].prop = "width";
    	if (!ns4) S08.values[0].prop2 = "style";
	document.MM_Time[0][8] = S08;


    	S09 = new String("sprite");
    	S09.slot = 10;
	S09.obj = GetObjectByID("ID_Index", "ID_Content_Riquadro_Sinistro"); 
    	S09.keyFrames = new Array(1, 8);
    	S09.values = new Array(1);
    	S09.values[0] = new Array("hidden","visible");
    	S09.values[0].prop = "visibility";
    	if (!ns4) S09.values[0].prop2 = "style";
	document.MM_Time[0][9] = S09;


    	S010 = new String("sprite");
    	S010.slot = 11;
	S010.obj = GetObjectByID("ID_Index", "ID_Content_Riquadro_Destro"); 
    	S010.keyFrames = new Array(1, 15);
    	S010.values = new Array(1);
    	S010.values[0] = new Array("hidden","visible");
    	S010.values[0].prop = "visibility";
    	if (!ns4) S010.values[0].prop2 = "style";
	document.MM_Time[0][10] = S010;


    	S011 = new String("sprite");
    	S011.slot = 12;
	S011.obj = GetObjectByID("ID_Index", "ID_Content_Omino"); 
    	S011.keyFrames = new Array(1, 13);
    	S011.values = new Array(1);
    	S011.values[0] = new Array("hidden","visible");
    	S011.values[0].prop = "visibility";
    	if (!ns4) S011.values[0].prop2 = "style";
	document.MM_Time[0][11] = S011;


    	S012 = new String("sprite");
    	S012.slot = 13;
	S012.obj = GetObjectByID("ID_Index", "ID_Content_Newsletter"); 
    	S012.keyFrames = new Array(1, 11);
    	S012.values = new Array(1);
    	S012.values[0] = new Array("hidden","visible");
    	S012.values[0].prop = "visibility";
    	if (!ns4) S012.values[0].prop2 = "style";
	document.MM_Time[0][12] = S012;


    	S013 = new String("sprite");
    	S013.slot = 14;
	S013.obj = GetObjectByID("ID_Index", "ID_Content_Gadget"); 
    	S013.keyFrames = new Array(1, 15);
    	S013.values = new Array(1);
    	if (ns5 || macIE5) S013.values[0] = new Array("-750px", "-524px", "-483px", "-441px", "-399px", "-357px", "-315px", "-273px", "-231px", "-190px", "-148px", "-106px", "-64px", "0px", "64px");
    	else S013.values[0] = new Array(-750,-524,-483,-441,-399,-357,-315,-273,-231,-190,-148,-106,-64, 0 , 64);
    	S013.values[0].prop = "top";
    	if (!ns4) S013.values[0].prop2 = "style";
	document.MM_Time[0][13] = S013;


    	S014 = new String("sprite");
    	S014.slot = 15;
	S014.obj = GetObjectByID("ID_Index", "ID_Content_Nuvoletta"); 
    	S014.keyFrames = new Array(1, 6);
    	S014.values = new Array(1);
    	S014.values[0] = new Array("hidden","visible");
    	S014.values[0].prop = "visibility";
    	if (!ns4) S014.values[0].prop2 = "style";
	document.MM_Time[0][14] = S014; 


    	S015 = new String("sprite");
    	S015.slot = 16;
	S015.obj = GetObjectByID("ID_Index", "ID_Content_Logo");
    	S015.keyFrames = new Array(1, 15);
    	S015.values = new Array(1);
    	if (ns5 || macIE5) S015.values[0] = new Array("-2000px", "-1000px", "-500px", "-250px", "-100px", "-39px", "-14px", "10px", "34px", "59px", "83px", "107px", "131px", "156px", "180px");
    	else S015.values[0] = new Array(-2000,-1000,-500,-250,-100,-39,-14,10,34,59,83,107,131,156,180);
    	S015.values[0].prop = "left";
    	if (!ns4) S015.values[0].prop2 = "style";
	document.MM_Time[0][15] = S015;


    	S016 = new String("sprite");
    	S016.slot = 17;
	S016.obj = GetObjectByID("ID_Index", "ID_Menu_Chi_Siamo");
    	S016.keyFrames = new Array(1, 11);
    	S016.values = new Array(1);
    	S016.values[0] = new Array("hidden","visible");
    	S016.values[0].prop = "visibility";
    	if (!ns4) S016.values[0].prop2 = "style";
	document.MM_Time[0][16] = S016;


    	S017 = new String("sprite");
    	S017.slot = 18;
	S017.obj = GetObjectByID("ID_Index", "ID_Menu_Servizi");
    	S017.keyFrames = new Array(1, 13);
    	S017.values = new Array(1);
    	S017.values[0] = new Array("hidden","visible");
    	S017.values[0].prop = "visibility";
    	if (!ns4) S017.values[0].prop2 = "style";
	document.MM_Time[0][17] = S017;


    	S018 = new String("sprite");
    	S018.slot = 19;
	S018.obj = GetObjectByID("ID_Index", "ID_Menu_Galleria_Prodotti"); 
    	S018.keyFrames = new Array(1, 15);
    	S018.values = new Array(1);
    	S018.values[0] = new Array("hidden","visible");
    	S018.values[0].prop = "visibility";
    	if (!ns4) S018.values[0].prop2 = "style";
	document.MM_Time[0][18] = S018;


    	S019 = new String("sprite");
    	S019.slot = 20;
	S019.obj = GetObjectByID("ID_Index", "ID_Menu_Contatti"); 
    	S019.keyFrames = new Array(1, 17);
    	S019.values = new Array(1);
    	S019.values[0] = new Array("hidden","visible");
    	S019.values[0].prop = "visibility";
    	if (!ns4) S019.values[0].prop2 = "style";
	document.MM_Time[0][19] = S019;


    	S020 = new String("sprite");
    	S020.slot = 21;
	S020.obj = GetObjectByID("ID_Index", "ID_Content_Info_Ordini"); 
    	S020.keyFrames = new Array(1, 14);
    	S020.values = new Array(1);
    	S020.values[0] = new Array("hidden","visible");
    	S020.values[0].prop = "visibility";
    	if (!ns4) S020.values[0].prop2 = "style";
	document.MM_Time[0][20] = S020;


    	S021 = new String("sprite");
    	S021.slot = 22;
	S021.obj = GetObjectByID("", "ID_Shadow_TopCorner"); 
    	S021.keyFrames = new Array(1, 15);
    	S021.values = new Array(1);
    	S021.values[0] = new Array("hidden","visible");
    	S021.values[0].prop = "visibility";
    	if (!ns4) S021.values[0].prop2 = "style";
	document.MM_Time[0][21] = S021;


    	S022 = new String("sprite");
    	S022.slot = 23;
	S022.obj = GetObjectByID("ID_Index", "ID_Shadow_Middle"); 
    	S022.keyFrames = new Array(1, 20);
    	S022.values = new Array(1);
    	S022.values[0] = new Array("hidden","visible");
    	S022.values[0].prop = "visibility";
    	if (!ns4) S022.values[0].prop2 = "style";
	document.MM_Time[0][22] = S022;


    	S023 = new String("sprite");
    	S023.slot = 24;
	S023.obj = GetObjectByID("ID_Index", "ID_Shadow_BottomCorner"); 
    	S023.keyFrames = new Array(1, 20);
    	S023.values = new Array(1);
    	S023.values[0] = new Array("hidden","visible");
    	S023.values[0].prop = "visibility";
    	if (!ns4) S023.values[0].prop2 = "style";
	document.MM_Time[0][23] = S023;


    	S024 = new String("sprite");
    	S024.slot = 25;
	S024.obj = GetObjectByID("ID_Index", "ID_Shadow_Bottom"); 
    	S024.keyFrames = new Array(1, 20);
    	S024.values = new Array(1);
    	S024.values[0] = new Array("hidden","visible");
    	S024.values[0].prop = "visibility";
    	if (!ns4) S024.values[0].prop2 = "style";
	document.MM_Time[0][24] = S024;


    	S025 = new String("sprite");
    	S025.slot = 26;
	S025.obj = GetObjectByID("ID_Index", "ID_Content_Bottom"); 
    	S025.keyFrames = new Array(1, 20);
    	S025.values = new Array(1);
    	S025.values[0] = new Array("hidden","visible");
    	S025.values[0].prop = "visibility";
    	if (!ns4) S025.values[0].prop2 = "style";
	document.MM_Time[0][25] = S025 ;


    	S026 = new String("sprite");
    	S026.slot = 27;
	S026.obj = GetObjectByID("ID_Index", "ID_Content_Info_PuntoPromotion"); 
    	S026.keyFrames = new Array(1, 20);
    	S026.values = new Array(1);
    	S026.values[0] = new Array("hidden","visible");
    	S026.values[0].prop = "visibility";
    	if (!ns4) S026.values[0].prop2 = "style";
	document.MM_Time[0][26] = S026;


    	S027 = new String("sprite");
    	S027.slot = 28;
	S027.obj = GetObjectByID("ID_Index", "ID_SeoLinks"); 
    	S027.keyFrames = new Array(1, 20);
    	S027.values = new Array(1);
    	S027.values[0] = new Array("hidden","visible");
    	S027.values[0].prop = "visibility";
    	if (!ns4) S027.values[0].prop2 = "style";
	document.MM_Time[0][27] = S027;


    	S028 = new String("sprite");
    	S028.slot = 29;
	S028.obj = GetObjectByID("", "ID_PageContent");
    	S028.keyFrames = new Array(1, 15);
    	S028.values = new Array(1);
    	S028.values[0] = new Array("hidden","visible");
    	S028.values[0].prop = "visibility";
    	if (!ns4) S028.values[0].prop2 = "style";
	document.MM_Time[0][28] = S028;

    	S029 = new String("sprite");
    	S029.slot = 30;
	S029.obj = GetObjectByID("", "ID_Index_Link");
    	S029.keyFrames = new Array(1, 10);
    	S029.values = new Array(1);
    	S029.values[0] = new Array("hidden","visible");
    	S029.values[0].prop = "visibility";
    	if (!ns4) S029.values[0].prop2 = "style";
	document.MM_Time[0][29] = S029;



    document.MM_Time[0].lastFrame = 21;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}