/****
	bouton close box connexion
****/
function formatTitle_connexion(title, currentArray, currentIndex, currentOpts) {
    return '<div id="tip7-title"><span><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="/js/maille/plugins/fancybox/closeBlack.jpg" /></a></span></div>';
}

jQuery(document).ready(function() {		
		jQuery(".connexionHeaderTop").click(function(){		
            jQuery.fancybox(
				{		
					'href'				: jQuery('#loginboxaction').val(),
					'autoDimensions'	: true,
					'width'         	: 352,
					'height'        	: 'auto',
					'showCloseButton'	: false,
					'overlayShow'		: true,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					'titlePosition' 	: 'inside',
					'titleFormat'		: formatTitle_connexion
                }
			);
            return false;
         	});	
						   
});

function formatTitle_sendtoafriend(title, currentArray, currentIndex, currentOpts) {
    return '<div id="tip7-title"><span><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="/js/maille/plugins/fancybox/closeBlack.jpg" /></a></span></div>';
}

jQuery(document).ready(function() {		
		jQuery("#sendtofriend").click(function(){		
            jQuery.fancybox(
				{		
					'href'				: jQuery(this).attr('rel'),
					'autoDimensions'	: true,
					'width'         	: 450,
					'height'        	: 'auto',
					'showCloseButton'	: false,
					'overlayShow'		: true,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					'titlePosition' 	: 'inside',
					'ajax'				: {'type' 	: 'post',
										   'cache'	: false},
					'titleFormat'		: formatTitle_sendtoafriend
                }
			);
            return false;
         	});	
						   
});


function formatTitle_messages(title, currentArray, currentIndex, currentOpts) {
    return '<div id="tip7-title"><span><a href="javascript:;" onclick="jQuery.fancybox.close();"><img src="/js/maille/plugins/fancybox/closeBlack.jpg" /></a></span></div>';
}

jQuery(document).ready(function() {		
		if(jQuery('#globalMessages').length){
				jQuery.fancybox(
				jQuery('#globalMessages').html(),
				{		
					'autoDimensions'	: true,
					'width'         	: 452,
					'height'        	: 'auto',
					'showCloseButton'	: false,
					'overlayShow'		: true,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					'titlePosition' 	: 'inside',
					'titleFormat'		: formatTitle_messages
                });
	}
						   
});

function newCloseButton(){
	return '<a id="fancybox-close2" style="display: inline;" onclick="jQuery.fancybox.close();"></a>';
}

jQuery(document).ready(function() {		
		jQuery(".enlarge-image-fancybox").click(function(){		
            jQuery.fancybox(
				{		
					'href'				: this.href,
					'showCloseButton'	: true, //'showCloseButton'	: false,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					//'titleFormat'		: newCloseButton,
					//'titlePosition' 	: 'inside',
					'ajax'				: {'type' 	: 'image'}
                }
			);
            return false;
         	});	
						   
});

jQuery(document).ready(function($) {		 
	$('.blocTabloMonPanier a.see-more-details').each(function(){
		var rel = $(this).attr('rel');
		if(rel) {	 
			$(this).click(function(){ 
				if($('#'+rel).is(":visible")){ 				
					$(this).find('#on').show();
					$(this).find('#off').hide();
					$('#'+rel).hide();
				}else{
					$(this).find('#on').hide();
					$(this).find('#off').show();
					$('#'+rel).show();
				}
			});
		}	 
	}); 
	
						   
});	
