//serie di img da caricare
var imgseries = "loadingAnimation.gif,bg_btn_bit_hover.jpg,bg_btn_ric_hover.jpg,bg_btn_vp_hover.jpg";
var imgdir = jsroot + "img/";
//inizializzazione dopo caricamento di pagina (basato su jquery)
$(document).ready(function(){
	imgloader(); // caricamento immagini grafica
	blankPage(); //new blank page
});
//caricamento immagini
function imgloader() {
	imgarr = imgseries.split(",");
	imgLoadernb = new Array();
	for (var i=0; i<imgarr.length; i++) {
		imgLoadernb[i] = new Image();
		imgLoadernb[i].src = imgdir + imgarr[i];
	};
}
//link blank
function blankPage(){
	for (var i=0; i<document.links.length; i++)
		if (document.links[i].className.indexOf("blank") != -1) {
			document.links[i].target="_blank";
		}
}
// disabilita il bottone prenota e carica attendere
function disabilitabtn(btn1) {
	if(btn1!=undefined)
		{var bottone1 = document.getElementById(btn1);
		bottone1.style.display='none';
		}
	var attenderediv = document.getElementById("attendere");
	attenderediv.style.display='block';
}


/*fancy*/

$(document).ready(function() {
	/* This is basic - uses default settings */
	
	$("a#single_image").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	200, 
		'speedOut'		:	50, 
		'overlayShow'	:	true,
		
		'titlePosition'	: 'over',
		'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
		return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}, 
		'overlayColor' : '#000',
		'overlayOpacity' : 0.6 
	});
	
	/* Using custom settings */
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	/* Apply fancybox to multiple items */
	
	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	150, 
		'speedOut'		:	50, 
		'overlayShow'	:	true,
		
		'titlePosition'	: 'over',
		'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
		return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}, 
		'overlayColor' : '#000',
		'overlayOpacity' : 0.6 
	});
	
	/*condizioni di acquisto*/
	$("#condizioni").fancybox({
		'width' : '75%',
		'height' : '75%',
		'autoScale' : false,
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'type' : 'iframe',
		'titleShow' : false
	});
	/*schedda ordine*/
	$("#scheda_ordine").fancybox({
		'width' : '75%',
		'height' : '95%',
		'autoScale' : false,
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'type' : 'iframe',
		'titleShow' : false
	});
	
	/* articoli correlati*/
	$(function() {
		$("div.scrollable2").scrollable({
		size:5,
		loop: false, 
		speed: 600
		});
	});
	/* scroll home promo */
	$(function() {
		$("div.scrollable").scrollable({
		size:3,
		loop: false, 
		speed: 600
		});
	});
	/*stampa*/
	$("#printmb").fancybox({
	'width' : '70%',
	'height' : '95%',
	'autoScale' : false,
	'transitionIn' : 'none',
	'transitionOut' : 'none',
	'type' : 'iframe',
	'titleShow' : false
	});
	/*invia mail*/
	$("#sendmb").fancybox({
	'width' : '50%',
	'height' : '75%',
	'autoScale' : false,
	'transitionIn' : 'none',
	'transitionOut' : 'none',
	'type' : 'iframe',
	'titleShow' : false
	});
	
});



