function embedcode () {
  var obj = document.getElementById ("embedcode");
  if (obj.style.visibility == "visible") obj.style.visibility = "hidden";
  else {
    obj.style.visibility = "visible";
    obj.select ();
  }
  return false;
}


$(document).ready (function () {
  $("a").focus (function () { $(this).blur (); });
  $("#share .favs").jFav ();
  /*$("#mail_dialog").dialog ({
	autoOpen: false,
	title: 'Invia per email',
	modal: true,
	open: function () { $("#box_mainvideo").css ("visibility", "hidden"); },
	close: function () { $("#box_mainvideo").css ("visibility", "visible"); }
	});
  $("#share .mail").click (function () {
	$("#mail_dialog").dialog ("open");
	return false; });*/
  /*$(".prev").hover (function () {
	$(this).css ("background-color", "#000");
	var $child = $(this).children (":first");
	$child.fadeTo (1000, 0.5);
    }, function () {
	var $child = $(this).children (":first");
	$child.css ("opacity", 1);
	$(this).css ("background-color", "transparent");
    });*/
  //$(".prev img:first-child").hover (function () { $(this).fadeTo (1000, 0.5); }, function () { $(this).css ("opacity", 1); });
  if (document.getElementById("fotogallery_box_slide_left")) {
	document.getElementById("fotogallery_box_slide_left").onmouseup = function (){
		document.getElementById("fotogallery_box_slide").getElementsByTagName("div")[0].scrollLeft -= 138;
		return false;
	}
  }
  if (document.getElementById("fotogallery_box_slide_right")) {
	document.getElementById("fotogallery_box_slide_right").onmouseup = function (){
		document.getElementById("fotogallery_box_slide").getElementsByTagName("div")[0].scrollLeft += 138;
		return false;
	}
  }
  if ($(".fotolabel .close_label").length) {
	$(".fotolabel .close_label").click(function(){
		var fotolabel = this.parentNode.parentNode;
		if (fotolabel.className.indexOf("fotolabel-min") < 0) {
			fotolabel.className += " fotolabel-min";
			this.title = "Mostra etichetta";
		} else {
			fotolabel.className = fotolabel.className.replace(/ ?fotolabel-min\b/,'');
			this.title = "Nascondi etichetta";
		}
	});
  }
});

