
	function sendEvent(swf,typ,prm) { 
	  thisMovie(swf).sendEvent(typ,prm); 
	};
	function getUpdate(typ,pr1,pr2,swf) {};
	
	function loadFile(swf,obj) { 
  		thisMovie(swf).loadFile(obj); 
		thisMovie(swf).sendEvent('playpause');
	};

	function thisMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
};

/*
	function thisMovie(movieName) {
		if(navigator.appName.indexOf("Microsoft") != -1) {
			alert($("#jtest"));
			return $("#jtest");
		} else {
			alert($("#jtest"));
			return $("#jtest");
		}
	};
*/


 $(document).ready(function(){

  $('#scrollContent').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-inpiazza').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-programma').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-people-list2').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-person').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-place-view').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.is-a-scroller').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-rassegna-stampa').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-comunicati').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-my-events').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-cp-tracker').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-cp-offers').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.section-search .box-inner').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('#search-container dl.search-results').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-myagenda').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('.view-content-myagenda2').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('#user-register').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});
  $('#user-edit').jScrollPane({scrollbarWidth:15, scrollbarMargin:10,showArrows:true,arrowSize:31,dragMaxHeight:60});


	var contenutoOrig="";

	 $(".videobutton1").click(function(e){
                var kids = $(e.target).siblings(".videotags");
		var nomeFile=kids[0].getAttribute('file');
		loadFile('jstest',{file:'/sites/default/files/movies/'+nomeFile});
	});

	 $(".videobutton1").hover(function(e){
		var kids = $(e.target).siblings(".videotags"); // .children();
//		alert("kids="+kids[0].firstChi);
		$("#videodescription").css("visibility","visible");
		if (kids.length>0) {
		contenutoOrig=$("#videodescription")[0].firstChild.nodeValue;
		var descrizione='<div id="text"><div id="photo"><img src="/sites/default/files/images/'+kids[0].getAttribute('photo')+'" /></div>'+kids[0].getAttribute('title')+'<br/>'+kids[0].getAttribute('description')+'</div>';
//  alert(descrizione);
//			$("#videodescription")[0].firstChild.nodeValue=descrizione;
	//	var container = document.getElementById("videodescription");
		var container=$("#videodescription")[0];
		$("#fasullo").remove();
		var newdiv = document.createElement("div");
		newdiv.setAttribute("id","fasullo")
		newdiv.innerHTML =descrizione 
		container.appendChild(newdiv);
/** good for firefox
			$("#videodescription")[0].innerHTML=descrizione;
**/
		}
	 },
	function(){
		$("#videodescription").css("visibility","hidden");	
		$("#videodescription")[0].firstChild.nodeValue=contenutoOrig;
	});
	



/*
	 $(".videobutton").hover(function(e){
		var kids = $(e.target).children(".videotags"); // .children();
//	        $("#flashplayer").css("visibility","hidden");
		$("#videodescription").css("visibility","visible");
		if (kids.length>0) {
		contenutoOrig=$("#videodescription")[0].firstChild.nodeValue;
			var descrizione=kids[0].getAttribute('title')+" data="+kids[0].getAttribute('date');
			$("#videodescription")[0].firstChild.nodeValue=descrizione;
		}
	 },
	function(){
//	        $("#flashplayer").css("visibility","visible");
		$("#videodescription").css("visibility","hidden");	
		$("#videodescription")[0].firstChild.nodeValue=contenutoOrig;
	});
	

*/
	
/*
	 $(".videobutton").mouseover(function(e){
		var kids = $(e.target).children(".videotags"); // .children();
//	        $("#flashplayer").css("visibility","hidden");
		$("#videodescription").css("visibility","visible");
//		if (kids.length>0) alert("titolo="+kids[0].getAttribute('title')+"<br />"+kids[0].getAttribute('description'));
	 });

	 $("#videodescription").mouseout(function(){
		$("#videodescription").css("visibility","hidden");
	 });
*/



 });

