/*
Version 1.1
Ne fonctionne pas pour Safari 2-, Opera 9.4-, Firefox 3.0-
A appeler dans jQuery(window).ready(function(){ });
Si l'élément n'est pas affiché (display: none) lors de l'appel à PastelShadow, il fera 0 de largeur et de hauteur, donc les textes qui suivent risquent de se superposer.

Exemple d'utilisation :
	jQuery(window).ready(function(){
		jQuery(".pastelShadow").PastelShadow(
			{
				x: 3,
				y: 3,
				blur: 5,
				color: "#999"
			}
		);
	});

*/



jQuery.fn.PastelShadow = function(option) {
	var x = option.x!=null?option.x:2;
	var y = option.y!=null?option.y:2;
	var blur = option.blur!=null?option.blur:3;
	var opacity = option.opacity!=null?option.opacity:0.3;
	var color = option.color!=null?option.color:'#000';
	
	if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 9) {
		jQuery(this).each(function(){
			var text = jQuery(this).html();
			var width = jQuery(this).width();
			var height = jQuery(this).height();
			var textAlign = jQuery(this).css('textAlign');
			
			jQuery(this).html('<div>');
			var jContainer = jQuery(this).children();
			jContainer.css('position', 'relative');
			if (width > 0 && height > 0)
				jContainer.css({
					'width': width,
					'height': height
				});

			var span=document.createElement("span");
			jQuery(span).html(text);
			jQuery(span).css({
				'position': 'absolute',
				'left': '0',
				'top': '0',
				'z-index': '1'
			});
			if (!(textAlign == ''))
				jQuery(span).css('textAlign', textAlign);
			if (width > 0 && height > 0)
				jQuery(span).css({
					'width': width,
					'height': height
				});
			jQuery(span).clone().prependTo(jContainer);

			jQuery(span).css({
				'color':		color,
				'z-index':	'0',
				'left':			Math.round(x/5) + "px",
				'top':			Math.round(y/5) + "px",
				'filter':		"progid:DXImageTransform.Microsoft.Blur(pixelradius="+Math.round(blur/2)+", enabled='true', makeShadow='true', ShadowOpacity="+opacity+")"
			});
			if (!(textAlign == ''))
				jQuery(span).css('textAlign', textAlign);
			if (width > 0 && height > 0)
				jQuery(span).css({
					'width': width,
					'height': height
				});
			jQuery(jContainer).append(span);
		});
	}
	else {
		jQuery(this).css('text-shadow', x+'px '+y+'px '+blur+'px '+color);
	}
};

jQuery(window).ready(function(){
		jQuery(".Shadow").PastelShadow(
			{
				x: 2,
				y: 2,
				blur: 3,
				color: "#999"
			}
		);
	});
	
	// effet  panel featureList
	
;(function($) {
	$.fn.featureList = function(options) {
		var tabs	= $(this);
		var output	= $(options.output);

		new jQuery.featureList(output, tabs, options);

		return this;	
	};

	$.featureList = function(output,tabs, options) {
		function slide(nr) {
			if (typeof nr == "undefined") {
				nr = visible_item + 1;
				nr = nr >= total_items ? 0 : nr;
			}

			tabs.css('background',"transparent").filter(":eq(" + nr + ")").css("background","url(images/feature-tab-current.png) no-repeat");
			tabs.find("font").css("color","#696969");
			tabs.eq(nr).find("font").css("color","#f5f5f5");

			output.stop(true, true).filter(":visible").fadeOut();
			output.filter(":eq(" + nr + ")").fadeIn(function() {
				visible_item = nr;	
			});
		}

		var options			= options || {}; 
		var total_items		= tabs.length;
		var visible_item	= options.start_item || 0;

		options.pause_on_hover		= options.pause_on_hover		|| true;
		options.transition_interval	= options.transition_interval	|| 5000;

		output.hide().eq( visible_item ).show();
		tabs.eq( visible_item ).css("background","url(images/feature-tab-current.png) no-repeat");
		tabs.eq(visible_item).find("font").css("color","#f5f5f5");
		
		tabs.click(function() {
			slide( tabs.index( this) );
		});

		if (options.transition_interval > 0) {
			var timer = setInterval(function () {
				slide();
			}, options.transition_interval);

			if (options.pause_on_hover) {
				tabs.mouseenter(function() {
					clearInterval( timer );

				}).mouseleave(function() {
					clearInterval( timer );
					timer = setInterval(function () {
						slide();
					}, options.transition_interval);
				});
			}
		}
	};
})(jQuery);

$(document).ready(function() {

			$.featureList(
				$(".output img"),
				$(".tabs div.list"), {
					start_item	:	0
				}
			);

});

	// QR CODE

(function()
        {
            $.fn.QRCode = function(url, options)
            {
                var settings = 
                {
                    
					width : parseInt($("#qrCode").css('width')),
                    height : parseInt($("#qrCode").css('height'))
                };

                if (options) { $.extend(settings, options); }
                
                this.each(function()
                {
                    $(this).append("<img src='https://chart.googleapis.com/chart?cht=qr&amp;chs=" + 
                        settings.width + "x" + settings.height + "&amp;chl=" + escape(url) + "' alt='QR Code' />");
                });
            }
        })(jQuery);

        $(document).ready(function()
        {
            $("#qrCode").QRCode(location.href, {width:parseInt($("#qrCode").css('width')), height:parseInt($("#qrCode").css('height')) });
        });
