//script x prob ie con fade
jQuery.fn.fadeIn = function(speed, callback) {
    return this.animate({opacity: 'show'}, speed, function() {
        if (jQuery.browser.msie)
            this.style.removeAttribute('filter');
        if (jQuery.isFunction(callback))
            callback();
    });
};

jQuery.fn.fadeOut = function(speed, callback) {
    return this.animate({opacity: 'hide'}, speed, function() {
        if (jQuery.browser.msie)
            this.style.removeAttribute('filter');
        if (jQuery.isFunction(callback))
            callback();
    });
};

jQuery.fn.fadeTo = function(speed,to,callback) {
    return this.animate({opacity: to}, speed, function() {
        if (to == 1 && jQuery.browser.msie)
            this.style.removeAttribute('filter');
        if (jQuery.isFunction(callback))
            callback();
    });
};


//script caricati alla fine del DOM
$(document).ready(function() {
	//Slide apertura carosello in HP
	if ($('DIV').is('#carosello')) {
		$('#carosello').hide();
	}

	//Dove acquistarlo - lista punti vendita
	if ($('A').is('.lkPV')) {
		$(".lkPV").colorbox({iframe:true, width:742, height:480});
	}

	//righe tabella - punti vendita
	if ($('DIV').is('#listaPV')) {
		$("tr:even").addClass('yin');
		$("tr:odd").addClass('yang');
	}

	//Video supporto box overlayer
	if ($('DIV').is('.lancVid')) {
		$(".videoSup").colorbox({iframe:true, width:732, height:480});
	}

	//Menu supporto in due colonne (solo su pagina supporto.html)
	if ($('#colDx').is('.colM')) {
		$('#colDx .listFaq').makeacolumnlists({cols:2,colWidth:215});
	}
	
	//apri/chiudi faq
	if($('DIV').is('.faq')) {
		$('.listPiuF h4').click(function(){
				var tit = $(this);
				var par = $(this).next();
				par.toggle(par.css('display') == 'none');
			}
		);
		
	}
});


//f per aprire e chiudere
function appare(){
	$('#carosello').slideToggle(500);
}

//f per aprire popup
function lancio(finestra,w,h){
	var l = Math.floor((screen.width-w)/2);
	var t = Math.floor((screen.height-h)/2);
	window.open(finestra,'popup','width=' +w+ ',height=' +h+ ',top=' +t+ ',left=' +l);
}
