window.addEvent('domready', function(){
    // slideshow
    var dataSlide_Header = {
	      '1.jpg': { caption: '' },
	      '2.jpg': { caption: '' } ,
	      '3.jpg': { caption: '' } ,
	      '4.jpg': { caption: '' } ,
	      '5.jpg': { caption: '' } ,
	      '6.jpg': { caption: '' } ,
	      '7.jpg': { caption: '' } ,
	      '8.jpg': { caption: '' } ,
	      '9.jpg': { caption: '' }
	  };
	  var Slide_Header = new Slideshow.KenBurns('slideshow_Header', dataSlide_Header, { captions: false, controller: false, hu: 'images/slideshow_Header/', duration: 5000, delay:5000, width: 944, height: 350 });

    // squeezebox
    SqueezeBox.assign($$('a[rel=boxed]'));
    SqueezeBox.assign($$('a[rel=squeezeboxed]'), {
    		handler:'iframe',
        size:{x:800,y:540}
    });
    $$("#contenuto img").addEvent('mouseover', function(){
        this.setStyle("cursor","pointer");
    });
    $$("#contenuto img").addEvent('click', function(){
        SqueezeBox.fromElement(this.src, {handler: 'image'});
    });
    
    // DatePicker
    var DatePickerClassName = ".demo_jqui";
    new DatePicker(DatePickerClassName, { pickerClass: 'datepicker_jqui', positionOffset: { x: 0, y: 5 } });
    
    // contorno bianco sul titolo
    if ($('H2contorno')) {
      var H2text = $('H2contorno').innerHTML;
      var contornoA = new Element('h2', {'class': 'contornoA',html: H2text});
      var contornoB = new Element('h2', {'class': 'contornoB',html: H2text});
      var contornoC = new Element('h2', {'class': 'contornoC',html: H2text});
      var contornoD = new Element('h2', {'class': 'contornoD',html: H2text});
      contornoA.inject($('H2contorno'), 'after');
      contornoB.inject($('H2contorno'), 'after');
      contornoC.inject($('H2contorno'), 'after');
      contornoD.inject($('H2contorno'), 'after');
    }

    // logo qualità
    var logoQualita = $('logo_qualita');
    if (logoQualita) {
      logoQualita.setAttribute("style","background:url(images/logo_qualita.png);width:100px;height:103px;position:absolute;top:-55px;left:520px;z-index:10;cursor:move;");
      var logoQ_effect = new Fx.Morph(logoQualita, {duration: 1000, 'transition': Fx.Transitions.Elastic.easeOut});
      logoQualita.makeDraggable({
  			onComplete: function(){
  				logoQ_effect.start({'top':-55,'left':520});
  			}
  		});
		}

    // marchio GS
    var marchiogs = $('marchiogs');
    if (marchiogs) {
      marchiogs.setAttribute("style","background:url(images/marchioGS.png);width:90px;height:50px;position:absolute;top:55px;left:530px;z-index:10;cursor:move;");
      var marchiogs_effect = new Fx.Morph(marchiogs, {duration: 1000, 'transition': Fx.Transitions.Elastic.easeOut});
      marchiogs.makeDraggable({
  			onComplete: function(){
  				marchiogs_effect.start({'top':55,'left':530});
  			}
  		});
		}


    
    // tooltips
    /*
    $$('.Tips').store('tip:title', 'Titolo tooltip');
    $$('.Tips').store('tip:text', 'Testo esempio bla bla bla');
    */
    var myTips = new Tips('.Tips', {});

    $$('.imgTips').store('tip:text', 'ingrandisci');
    var myTips = new Tips('.imgTips', {});
    
    // rollover menu
    /*
    $$('img.menu').each(function(img) {
    	var src = img.getProperty('src');
    	img.addEvent('mouseenter', function() { img.setProperty( 'src',src.replace('out','over') ); });
    	img.addEvent('mouseleave', function() { img.setProperty( 'src',src.replace('over','out') ); });
    });
    */
    
});
