function getThumbsWork(id){
	$.ajax({
		type: "POST",
		url: "inc/getThumbsWork.php",
		data: "id="+id,
		success: function(data) {
			
			$(".thumbs").html(data);
		},
		error: function(data) {
			alert("Nessuna risposta dal server");
		}
	});
}

function getProjectVideo(id_progetto,id_video){
	$.ajax({
		type: "POST",
		url: "inc/getProjectVideo.php",
		data: "id_progetto="+id_progetto+"&id_video="+id_video,
		success: function(data) {
			$(".projectImg").html(data);
		},
		error: function(data) {
			alert("Nessuna risposta dal server");
		}
	});
}

function getProjectPhotos(id){
	$.ajax({
		type: "POST",
		url: "inc/getProjectPhotos.php",
		data: "id="+id,
		success: function(data) {
			$(".projectImg").html(data);
		},
		error: function(data) {
			alert("Nessuna risposta dal server");
		}
	});
}

function slideSwitch() {
	var $active = $('.projectImg IMG.active');

	if ( $active.length == 0 ) $active = $('.projectImg IMG:last');

	// use this to pull the images in the order they appear in the markup
	var $next =  $active.next().length ? $active.next(): $('.projectImg IMG:first');

	// uncomment the 3 lines below to pull the images in random order
	// var $sibs  = $active.siblings();
	// var rndNum = Math.floor(Math.random() * $sibs.length );
	// var $next  = $( $sibs[ rndNum ] );
	var count = $('.projectImg IMG').size();
	$active.addClass('last-active');
	if(count!='1'){
		$next.fadeIn()
			.addClass('active')
			.animate({opacity: 1.0}, 100, function() {
				$active.removeClass('active last-active');
		});
	}else{
		$next.css({opacity: 10});
	}
}
