$(document).ready(function(){

	$('#parrafo').jScrollPane({
		scrollbarWidth		: 4
	});
	
	$('.scrollproducto').jScrollPane({
		scrollbarWidth		: 4
	});
	
	$('.scroll').jScrollPane({
		scrollbarWidth		: 4
	});
	
	$('.scrolltienda').jScrollPane({
		scrollbarWidth		: 4
	});
	
	$('#creacAuthScroll').jScrollPane({
		scrollbarWidth		: 4
	});
	
	$(".youtube_fb").click(function() {
		$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'			: 680,
				'height'		: 495,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
				   	 'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});
	 
		return false;
	});
	
	$("a.single").fancybox({
		titlePosition	 	: 'inside',
		centerOnScroll		: true,
		overlayShow			: true,
		zoomSpeedIn			: 600,
		zoomSpeedOut		: 500,
		easingIn			: 'easeOutBack',
		easingOut			: 'easeInBack',
	});
	
	$("a[rel=galeriafotos]").fancybox({
		'titlePosition' 	: 'inside',
		'cyclic'			: true,
		'centerOnScroll'	: true
	});
	
	$('#fb_avisoslegales').fancybox({
		ajax 			: {},
		autoDimensions 	: false,
		width			: 640,
		height			: 480,
		centerOnScroll	: true,
		onComplete		: 	function()
							{
								$('#parrafoAjax').jScrollPane({
									scrollbarWidth		: 4
								});
							}
	});
	
	$('#fb_condicionesgenerales').fancybox({
		ajax 			: {},
		autoDimensions 	: false,
		width			: 640,
		height			: 480,
		centerOnScroll	: true,
		onComplete		: 	function()
							{
								$('#parrafoAjax').jScrollPane({
									scrollbarWidth		: 4
								});
							}
	});
	
	$('#fb_envios').fancybox({
		ajax 			: {},
		autoDimensions 	: false,
		width			: 640,
		height			: 480,
		centerOnScroll	: true,
		onComplete		: 	function()
							{
								$('#parrafoAjax').jScrollPane({
									scrollbarWidth		: 4
								});
							}
	});
	
	$("img.rollover").hover(
		function()
		{
			this.src = this.src.replace("_off","_on");
		},
		function()
		{
			this.src = this.src.replace("_on","_off");
		}
	);
	
});
