$(document).ready(function(){
    //	SetSelect(); // init select forfait
    // tab bottom
    var $tabs = $("#bloc").tabs();
    $tabs.tabs('select', 0);
    // tab webcam
    var $tab_webcam = $("#bloc_webcam_logos").tabs();
    $tab_webcam.tabs('select', 0);

    // tab webcam interne
    var $tab_webcam_interne = $("#bloc_webcam_logos_interne").tabs();
    $tab_webcam_interne.tabs('select', 0);

    $("form.jqtransform").jqTransform();

    //	// menu déroulant forfait
    //	$('.select-forfait span').css('cursor','pointer').click(function(){
    //		SetSelect($(this));
    //	});
    $('.select-forfait option').click(function(){
        $(this).parents("form").attr('action',$(this).attr('value'));
        return false;
    });
    $('.submit-form').click(function(){
        $(this).parents("form").submit();
        return false;
    });


    /* sIfr */

    //sIFR.replace(superduper, {
    //	selector: '.bloc-droite h2, #forfait_interne h2, #sejour_interne h2, #meteo_interne h2',
    //  	css: ['.sIFR-root { background-color: transparent;  color: #FFFFFF; }',
    //		'a { color: #FFFFFF; text-decoration: none}',
    //		'a:hover { color: #BD0926}'],
    //	wmode: 'transparent'
    //});
    //sIFR.replace(superduper, {
    //	selector: '.superduper',
    //  	css: ['.sIFR-root { background-color: transparent;  color: #FFFFFF; }',
    //		'a { color: #FFFFFF; text-decoration: none}',
    //		'a:hover { color: #BD0926}'],
    //	wmode: 'transparent'
    //});

    $('#slide-sejours').cycle({
        fx:    'scrollUp',
        delay: -1000
    });
    
    /* Fancybox */
    
    $('#bloc_webcam a , #bloc_webcam_logos_interne a , #contenu_central a').filter(function() {
        return this.href.match(/\.(jpg|png|gif)$/);
    }).fancybox();
    

    $('#bloc_webcam_logos #webcam-huez .imglink').append('<img width="200" src="'+$('#bloc_webcam_logos .imglink').attr('href')+'" />');

    $('.webcam-logo').click(function() {
        var select = $(this).attr('href');
        $('#bloc_webcam_logos .imglink img').remove();
        $('#bloc_webcam_logos .imglink').append('<img width="200" src="'+$(select+' .imglink').attr('href')+'" />');
    });

    $('#bloc_webcam_logos_interne #webcam-huez .imglink').append('<img width="110" src="'+$('#bloc_webcam_logos_interne .imglink').attr('href')+'" />');

    $('.webcam-logo').click(function() {
        var select = $(this).attr('href');
        $('#bloc_webcam_logos_interne .imglink img').remove();
        $('#bloc_webcam_logos_interne  .imglink').append('<img width="110" src="'+$(select+' .imglink').attr('href')+'" />');
    });


    $('a[rel="external"]').popupWindow({
        height:500,
        width:800,
        top:50,
        left:50
    });


});
