/**
 *
 */

function StartPictureCarousel() {
    $('#news-content-image').attr({ src: ''});
}

function StopPictureCarousel() {
    
}

function LoadStaticContent(iContentID, sContainer) {
    $('#' + sContainer).fadeOut(500, function() {
            $.get("./AjaxBackend/getStaticContent.php",{ContentID: iContentID},
                function success(sData){
                    $('#' + sContainer).html(sData);
            });
            $('#' + sContainer).fadeIn(500);
        });
}

function LoadDynamicNews(iContentID) {
	$('#news-content-text').animate({width: ['toggle', 'swing'],
            opacity: 'toggle'
            }, 500, function() {
                            $.get("./AjaxBackend/getNewsData.php",{ContentID: iContentID},
                                function success(sData){
                                    $('#news-content-text').html(sData);
                                    $('#news-content-image').fadeOut(500, function() {
                                        $('#news-content-image').attr({ src: './PageData/NewsPictures/News_' + iContentID + '.jpg' });
                                    })
                                    $('#news-content-image').fadeIn(500);
                            });
                            $('#news-content-text').animate({width: ['toggle', 'swing'],
                                                        opacity: 'toggle'
                                                        }, 500)
            });
}

function LoadAllNewsList(sLanguageID) {
    $('#TextZoomContainer').fadeIn(500);
    $.get("./AjaxBackend/getNewsList.php", {LanguageID: sLanguageID},
        function success(sData){
            $('#TextZoomLeft').html(sData);
    });
}

function LoadArchivedNews(iContentID) {
	$('#TextZoomRight').fadeOut(500, function() {
                            $.get("./AjaxBackend/getNewsData.php",{ContentID: iContentID},
                                function success(sData){
                                    $('#TextZoomRight').html('<img src="./PageData/NewsPictures/News_' + iContentID + '.jpg" />' + sData);
                            });
                            $('#TextZoomRight').fadeIn(500)
            });
}

function ShowPicture(sPicturePath) {
    $('#PictureZoom').attr({ src: sPicturePath});
    $('#PictureZoomText').html('<a href="javascript:HideMessageBox()">Cliquez pour fermer</a>');
    $('#PictureZoomContainer').fadeIn(500);
}

function HideMessageBox() {
    $('#PictureZoomContainer').fadeOut(500);
}

function HideMessageBox(sContainer) {
    $('#' + sContainer).fadeOut(500);
}

function ChangePanelImage() {
    var saImagesPath = new Array(   './MediaContent/LIGNECLUB/barettes.jpg',
                                    './MediaContent/D&C/D&C.jpg',
                                    './MediaContent/E6-E6 AMBIANCE/AMB-E6 -2.jpg');


    $('#news-content-image').fadeOut(1500, function() {
        do {
            iNewImageIndex = Math.floor(Math.random() * (saImagesPath.length + 1));
        } while(saImagesPath[iNewImageIndex] == $('#news-content-image').attr("src"));

        $('#news-content-image').attr({ src: saImagesPath[iNewImageIndex] });
    })
    $('#news-content-image').fadeIn(1500);
}

$(function() {
	$("#main").tabs({
		fx: {
                        opacity: 'toggle'
                    }
	});

	/*
        $("#tabs-products").tabs({
		fx: {
                        width: ['toggle', 'swing'],
                        opacity: 'toggle'
                    }
	}).addClass('ui-tabs-vertical ui-helper-clearfix');
	$("#tabs-products li").removeClass('ui-corner-top').addClass('ui-corner-left')
        */

});

/**
 * 
 */

// setInterval('ChangePanelImage();', 10000);

