window.addEvent('domready', function() {
    
    if($('rt-rotator')){
        $('rt-header-surround').setStyles({
            'margin-bottom':0
        })
    }
    
    if( ($$('#photo-album div.rokbox-album-bottom').length>0) && $('photo-album')){
        var morePhotos = new Element('div',{
            'class': 'morePhotos',
            'html' : 'plus de photos',
            'styles': {
                'display': 'block',
                  'font-size': 10,
                  'text-align' : 'center',
                  'margin' : '0 5px 10px 0'
                }
        });
        $$('#photo-album div.rokbox-album-wrapper').setStyle('margin-bottom', 0);
        morePhotos.inject($('photo-album'),'after');
    }
      
    var accordion = new Accordion($$('#accordion p.toggler'), $$('#accordion div.stretch'), {
      onActive: function(toggler, element){
        toggler.addClass('active');
      },
      onBackground: function(toggler, element){
        toggler.removeClass('active');
      }
    });
    
    if($('fb-root')){
        var fbScript = new Element('script',{
            'src' : 'http://connect.facebook.net/fr_FR/all.js#xfbml=1'
        });
        fbScript.inject($('fb-root'),'after');
        var fbComments = new Element('fb:comments',{
            'href':document.location.href,
            'num_posts':'5',
            'width':'590'
        });
        fbComments.inject($('fb-root'),'after');
     }   
     
     if($('fbilike'))
     {
        var url = ("http://www.madagascarilaytours.com/"==document.location.href)?document.location.href+"index.php":document.location.href;
            url = document.location.href;
            url += "&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font=tahoma&amp;height=80&amp;app_id=232679573423536&amp;ref=top_left";
        var fbiLikeFframe = new Element('iframe',{
            'src'   :   'http://www.facebook.com/plugins/like.php?href='+url,
            'scrolling' : 'no',
            'frameborder':'0',
            'allowTransparency':'true',
            
            'styles':{
               'border':'none', 
               'width':'250px', 
               'height':'80px',
               'overflow':'auto', 
            }
        });        
        fbiLikeFframe.inject($('fbilike'));
     }
     
     if($$('.module-content #main_com')&&$('tab_span1'))
     {
        
        $$('.module-content #main_com').setStyles({
            'background-image':'none'
        });
        $('tab_span1').set('html','');
        
        $$('div.ebookers div.module-content').setStyles({
            'background-color':'#00547A',
            'color':'#FFFFFF',
            'background':'url(/media/ilaytours/images/ebookers-logo.gif) no-repeat 10px 10px #00547A'        
        });
        
        $('flight_com').setStyles({
            'top':'100px',
            'left': '25px'
        });
        $$('#flight_com table.texte').setStyle('color','#FFFFFF');    
        
        var parent = $('td_dest').getParent('td');
        parent.set('html','Madagascar <input id="td_dest" class="in_text" type="hidden" value="Madagascar" name="td_dest">');
        /**/
     }
     
     if($$('div.recit-de-voyage')){
        var linksArray = $$('div.recit-de-voyage a');
        linksArray.each(function(item,index){
            if(item.getProperty('href') == document.location.pathname){
                var p = item.getParent('li');
                p.setProperty('class', p.getProperty('class')+' active');
                return false;
            }
        });
     }
     
     
});
