function scrollItRight(pag,numRows,cat) {
	$('#boxPhotogallerySotto').fadeOut(function(){
											$.ajax({
												   type: "GET",
												   url: "../_ajax/galleryUpdateDE.inc.php",
												   data: "page="+pag+"&cat="+cat+"&numRows="+numRows,
												   success: function(msg){
																$('#boxPhotogallerySotto').html(msg).fadeIn();
																//TB_init();
																tb_init('a.thickbox, area.thickbox, input.thickbox');
															}
												   });
												});
	return false;
}

function scrollItLeft(pag,numRows,cat) {
	$('#boxPhotogallerySotto').fadeOut(function(){
											$.ajax({
												   type: "GET",
												   url: "../_ajax/galleryUpdateDE.inc.php",
												   data: "page="+pag+"&cat="+cat+"&numRows="+numRows,
												   success: function(msg){
																$('#boxPhotogallerySotto').html(msg).fadeIn();
																//TB_init();
																tb_init('a.thickbox, area.thickbox, input.thickbox');
														}
												   });
												});
	return false;
}

function TB_init(){
	$("a.thickbox").click(function(){
	var t = this.title || this.innerHTML || this.href;
	TB_show(t,this.href);
	this.blur();
	return false;
	});
}

function TB_show(t,url){
	 $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
	 $("#TB_overlay").click(TB_remove);
	 $(window).resize(TB_position);
	 $(window).scroll(TB_position);
	 $("#TB_overlay").show();
	 $("body").append("<div id='TB_load'><div id='TB_loadContent'><img src='images/circle_animation.gif' /></div></div>");
	 var urlString = /.jpg|.jpeg|.png|.gif|.html|.htm|.php|.cfm|.asp|.aspx|.jsp|.jst|.rb|.txt/g;
	 var urlType = url.match(urlString);
	 if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif'){//code to show images
		$("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"</div><div   id='TB_closeWindow'><a href='#' id='TB_closeWindowButton'>close</a></div>");
		$("#TB_closeWindowButton").click(TB_remove);
	 }
}
