<!--SCRIPT: tnw dot it Functions (C) info@tnw.it ;

window.addEvent('domready', function(){
  //chiama callback funzione
  var timed_to_execute = function(){
    //setta altezza content
  if( $('left') && $('right') ){
    var height_left    = parseInt( $('left').getSize().y );
    var height_right   = parseInt( $('right').getSize().y );
    var height_content = parseInt( $('content').getSize().y );
    
    var content_from_top = parseInt( $('content').getPosition().y );
    var footer_from_top = parseInt( $('footer_menu').getPosition().y );
    
    var diff_from_top   = footer_from_top - content_from_top;
    
    if( ( height_left > height_right ) || ( height_left > height_content ) ){
    
      $('content').setStyle('height', diff_from_top + 50 );
      
    }else{
      $('content').setStyle('height', diff_from_top+ 50 );
    }
  }else if( $('single_column') ){
    $('content').setStyle('height', parseInt( $('single_column').getSize().y ) + 50 );
  }
  }
  var timer = timed_to_execute.delay(500);
  
  //menu ul fading in/out
  /*
  $each($$('#navigation a'), function(el) {
    var original = el.getStyle('color');
    var morph = new Fx.Morph(el,{ 'duration':'700', link:'cancel' });
    el.addEvents({
      'mouseenter' : function() { morph.start({ 'color':'#ffcc00' }) },
      'mouseleave' : function() { morph.start({ 'color': original }) }
    });
  });
  */
  // initialize Nivoo-Slider
  if( $('slider') ){
    new NivooSlider($('slider'), {
        animSpeed: 750,
        effect: 'wipeLeft',
        interval: 5000,
        orientation: 'vertical',
        slices: 3,
        directionNav: false,
        pauseOnHover: true,
        directionNavHide: true,
        autoPlay: true
    });
  }

} );

