function ouvre_menu($elt)
{
	$Elt=document.getElementById($elt);
	if($Elt.style.display=='none')
		$Elt.style.display='block';
	else
		$Elt.style.display='none';
}

function affiche($elt1, $elt2, $nb)
{
	$elt1=document.getElementById($elt1);
	$elt1.style.display='block';
	
	$elt2=document.getElementById($elt2);
	$elt2.style.display='none';	
}

function affiche_cache($elt)
{
	$Elt=document.getElementById($elt);
	if($Elt.style.display=='none')
		$Elt.style.display='block';
	else
		$Elt.style.display='none';
}

function affiche($elt)
{
	$elt=document.getElementById($elt);
	if($elt.tagName=='LABEL' || $elt.tagName=='SELECT')
		$elt.style.display='inline';
	else
		$elt.style.display='block';
}

function cache($elt)
{
	$elt=document.getElementById($elt);
	$elt.style.display='none';	
}


function confirmSubmit(msg) {
	agree=confirm(msg);
	if (agree)
		return true;
	else
		return false;
}

function mycarousel_initCallback(carousel)
{
	// Pause autoscrolling if the user clicks the prev or next button.
	carousel.buttonNext.bind('click', function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});

	carousel.buttonPrev.bind('click', function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});

	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};

function mycarousel_itemLoadCallback(carousel, state)
{
    for (var i = carousel.first; i <= carousel.last; i++) {
        if (carousel.has(i)) {
            continue;
        }

        if (i > mycarousel_itemList.length) {
            break;
        }

        // Create an object from HTML
        var item = jQuery(mycarousel_getItemHTML(mycarousel_itemList[i-1])).get(0);

        // Apply thickbox
        tb_init(item);

        carousel.add(i, item);
    }
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    var url_m = item.url.replace(/\/p\//g, '/g/');
    return '<a href="' + url_m + '"><img src="' + item.url + '" width="75" height="75" border="0" alt=""/></a>';
};


