
//----------------------------------------------------------- Cacher ou montrer un div --------------------------------------------------------------------
function cacher(id)
{
	document.getElementById(id).style.display = 'none';
}function montrer(id)
{
	document.getElementById(id).style.display = 'block';
}

//----------------------------------------------------------- filtre --------------------------------------------------------------------
function high(which2){
which2.filters.alpha.opacity=100;
}
function low(which2){
which2.filters.alpha.opacity=80;
}

//-----------------------------------------------------------------Pour jcarousel--------------------------------------------------------------------------
var mycarousel_itemList = [
    {url: 'images/manege/christ.jpg', title: 'Alleluia', link: 'recherche_categories.php?categorie=alleluia&liturgie=tous&page=1'},
    {url: 'images/manege/saintesprit.jpg', title: 'Saint Esprit' , link: 'recherche_categories.php?categorie=espritsaint&liturgie=tous&page=1'},
	{url: 'images/manege/guitare.jpg', title: 'Tablatures' , link: 'rechercher_tab.php'},
    {url: 'images/manege/marie2.jpg', title: 'Chants à Marie', link: 'recherche_categories.php?categorie=marie&liturgie=tous&page=1'},
    {url: 'images/manege/louange.jpg', title: 'Louange', link: 'recherche_categories.php?categorie=louange&liturgie=tous&page=1'},
	{url: 'images/manege/casque.jpg', title: 'Ecouter' , link: 'rechercher_tab.php'},
    {url: 'images/manege/noel2.jpg', title: 'Chants de Noël', link: 'recherche_categories.php?categorie=noel&liturgie=tous&page=1'}
];

function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a
    // given index who is out of the actual item range.
    var idx = carousel.index(i, mycarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    return '<a href="' + item.link + '"><img src="' + item.url + '" width="75" height="75" alt="' + item.title + '" style="filter:alpha(opacity=100);" onmouseover="low(this)" onmouseout="high(this)"/></a>';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
		auto: 4, //nombre de secondes entre chaque scroll
		animation: 2000, //vitesse
		scroll : 1,
        wrap: 'circular',
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
    });
});

//-------------------------------------------------------pour le fondu image---------------------------------------------------------------------------------
$(document).ready( 
	function(){ 
		$('#news').innerfade({ 
			animationtype: 'slide', 
			speed: 750, timeout: 2000, 
			type: 'random', containerheight: '1em' }); 
		$('#portfolio').innerfade({ 
			speed: 2000, 
			timeout: 7000, 
			type: 'sequence', 
			containerHeight: '249px' }); 
		$('.fade').innerfade({
			 speed: 2000, 
			timeout: 1000, 
			type: 'sequence', 
			containerheight: '1.5em' });
		 } ); 
		 
//--------------------------------------------------------------ouvrir la fenetre inscription-------------------------------------------------------------------
 function nouvellefenetre() {
 mafenetre =
   window.open("inscription.php","MyPopupWindow","resizable=no,menubar=no,status=no,scrollbars=n­o,menubar=no, width=600, height=650");
  }
  
//--------------------------------------------------------------ouvrir la fenetre achat-------------------------------------------------------------------
function popupachat(ean) {
 mafenetre =
   window.open('achat.php?ean='+ean,"MyPopupWindow","directories=no,resizable=no,menubar=no,status=no,scrollbars=no,menubar=no, width=300, height=300");
  }
