/*
 *
 *	@titre: global.
 *	@description: javascript global.
 *	@auteur: neov - http://www.neov.net.
 *	@creation: 20100713.
 *	@modification: - .
 *	@required: jquery 1.4.2.
 *
*/


$(
	function()
	{
		// simulation target blank.
		$('.target-blank').each(
			function()
			{
				$(this).click(
					function()
					{
						var targetLink = $(this).attr('href') ;
						window.open(targetLink) ;
						
						return false ;
					}
				) ;
			}
		) ;
		
		// ouverture layer.
		//$('').pop({popUp: '#login'});				// popup login
		$('.oubli-mdp').pop({popUp: '#oubli'}) ;	// popup oubli mot de passe

		// fermeture layer.
		$('.layer .fermer').hidePop() ;
		
		// ouverture popup.
		$('.popcontact').popup({width: 890, height: 440}) ;
		$('.popcredit').popup({width: 890, height: 310}) ;
		$('.popdonnee').popup({width: 890, height: 395}) ;
		$('.popdesinscription').popup({width: 890, height: 440}) ;
		$('.popreglement').popup({width: 900, height: 550, resize: 'yes', scrollbars: 'yes'}) ;
		$('.popmention').popup({width: 900, height: 550, resize: 'yes', scrollbars: 'yes'}) ;
		
		// ajout favori
		$('.ajout-favori').click(
			function()
			{


			}
		);

		if(window.opera) {
			if ($(".ajout-favori").attr("rel") != ""){
				$(".ajout-favori").attr("rel","sidebar");
			}
		}
   
		$("a.ajout-favori").click(
			function(event)
			{
				event.preventDefault(); // prevent the anchor tag from sending the user off to the link
				var url = this.href;
				var title = this.title;

				if (window.sidebar) { // Mozilla Firefox Bookmark
					window.sidebar.addPanel(title, url, "");
				} else if( window.external ) { // IE Favorite
					window.external.AddFavorite( url, title);
				} else if(window.opera) {	// Opera 7+
					return false; // do nothing - the rel="sidebar" should do the trick
				} else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)
					alert('Unfortunately, this browser does not support the requested action, please bookmark this page manually.');
				}
			}
		);


		$(".zZoom").each(function () {
			$(this).click(function () {
				var id = $(this).attr('id').replace('zZoom_','');
				$('#zoom_'+id).showPop ('', false) ; 
			})
		}) ;
	}
) ;
