
//jQuery Easing solo per easeInOutExpo

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
		easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	}});


// inizio MyScript - Dgsign.it



$(document).ready(function () {
	$("#logoTop").delay(200).animate({left:"20px",opacity:"1"},400);
	$("img.wp-post-image")
	.delay(600)
	.animate({opacity:"1", left:"0"},200);
	/*$("#topWide").html("loading..").append('<img src="wp-content/themes/BargyTheme/images/img_Factory.jpg" />');*/
	
//aggiungo il logo al post tema news in home page + aggiungo link al post creato
var targetIMG = $('#categoryposts-6 ul li a.post-title');
var targetGO = targetIMG.attr("href");

$('#categoryposts-6 h3.widget-title').append('<div id="logoTeam"><a href="' + targetGO + '"><img src="wp-content/themes/BargyTheme/images/ico_logoTeam.png" /></a></div>');


//questi i parametri per il movimento slider da xtrig
var offsetLink = "-2000px";
var slideEaseDuration = 1000;
var slider = $(this);
var panelWidth = slider.find(".coda-slider").width()*2;

//assegna la classe xtrig all'icona x le immagini
$('img.ico-img-team').parent('a').addClass('xtrig');

$('a.xtrig').click (function() {
//funzione slider
$('.panel-container').animate({ marginLeft: - panelWidth },slideEaseDuration,"easeInOutExpo", function() {
	var targetPanel = 3;
	$('#coda-nav-1').find('a').removeClass('current').parents('ul').find('li:eq(' + (targetPanel - 1) + ') a').addClass('current');
	});
	
});



});

