﻿// JScript File
$(document).ready(function () {
hideShow('topdestinations');

$('a#ISO14001').qtip( {
    content:
    {
        text: $('div#ecoLabelInfo_ISO14001').html()
    },
    style: 
    {                
        name: 'light',
        height: 150,
        width: 380,
        background: '#FFFFFF', 
        border: {
            width: 4,
            radius: 4,
            color: '#A8C02A'
        },
        tip: true
    },
    position: {
        corner: {
            target: 'bottomRight',
            tooltip: 'topLeft'
        }
    }
});

$('a#GreenKey').qtip( {
    content:
    {
        text: $('div#ecoLabelInfo_GreenKey').html()
    },
    style: 
    {
        name: 'light',
        height: 180,
        width: 380,
        background: '#FFFFFF', 
        border: {
            width: 4,
            radius: 4,
            color: '#A8C02A'
        },
        tip: true
    },
    position: {
        corner: {
            target: 'bottomRight',
            tooltip: 'topLeft'
        }
    }
});

$('a#GreenGlobe21').qtip( {
    content:
    {
        text: $('div#ecoLabelInfo_GreenGlobe21').html()
    },
    style: 
    {
        name: 'light',
        height: 150,
        width: 380,
        background: '#FFFFFF', 
        border: {
            width: 4,
            radius: 4,
            color: '#A8C02A'
        },
        tip: true
    },
    position: {
        corner: {
            target: 'bottomRight',
            tooltip: 'topLeft'
        }
    }
});

$('a#Eco-label').qtip( {
    content:
    {
        text: $('div#ecoLabelInfo_Eco-label').html()
    },
    style: 
    {
        name: 'light',
        height: 150,
        width: 380,
        background: '#FFFFFF', 
        border: {
            width: 4,
            radius: 4,
            color: '#A8C02A'
        },
        tip: true
    },
    position: {
        corner: {
            target: 'bottomRight',
            tooltip: 'topLeft'
        }
    }
});
});

function hideShow(selectedElement)
{
    //Default all selectors
    $('.liens-populaires li').removeClass();
    $('.liens-populaires span').removeClass();
    $('.liens-populaires a').removeClass();
    $('.liens-populaires a').addClass('nav_off');

    //Show selected selector
    $('li#selector-' + selectedElement + '\'').removeClass();

    $('li#selector-' + selectedElement + '\'').addClass('plus-visites on');
        
    $('li#selector-' + selectedElement + ' span').removeClass();
    $('li#selector-' + selectedElement + ' span').addClass('on');
    $('li#selector-' + selectedElement + ' a').removeClass();
    $('li#selector-' + selectedElement + ' a').addClass('nav_on');

    //Hide all elements
    $('div.list').hide();

    //Show selected element
    $('div#selection-' + selectedElement + '\'').fadeIn(1000);
}

