function init(pageContext){
	//contenuto audio/video nei paragrafi
	/*
	$('div.videoContent').each(function(){
		var data = $(this).metadata();
        flashembed(this, {
        		src: pageContext.videoPlayer,
	            width: data.w,
	            height: data.h,
	            wmode: "opaque",
	           	allowfullscreen: true,
	           	allowscriptaccess: "always" 
	        },
	        {
	        	file: data.url,
	        	streamer: videoParams.host + (videoParams.port ? ':' : '') + videoParams.port + "/" + videoParams.vod,
	        	skin: pageContext.videoSkin
	        	//image: "preview.jpg",
	        	//streamer: "rtmp://edge01.fms.dutchview.nl/botr"
	        }
   	    );
	});
	*/
	// dialog box galleria fotografica
	$('a.popin').click(function(){
	    var img = $(this).children("img")
	    var url = img.attr("src");
	    var dida = img.attr("alt");
	    var imgObj = new Image();
	    var $d = makeDialog(imgObj, dida, { 
	    	close: function(event, ui) {
	            $(this).dialog('destroy');
	            $(this).remove();
		    }
	    });
	    imgObj.src = url;
	    $(imgObj).load(function(){
	    	$d.dialog('open');
	    	$d.dialog('option', 'position', 'center');
	    });
	    
	    return false;
	});
	
	// galleria fotografica jcarousel
	jQuery('#mycarousel').jcarousel({
		scroll : 2,
		visible: 6,
		buttonNextHTML: null,
	    buttonPrevHTML: null,
	    initCallback: function(carousel) {
	        jQuery('#carousel-control-next').bind('click', function() {
	            carousel.next();
	            return false;
	        });

	        jQuery('#carousel-control-prev').bind('click', function() {
	            carousel.prev();
	            return false;
	        });
	    }
	});
	
	// espandi galleria audio/video
	$('a.open_wrapMulti').click(function(){
	    if($('#wrapMulti').is(':visible')){
	        $(this).html('visualizza tutti<img src="' + pageContext.gifOpen + '" alt="visualizza tutti" class="ml8" />');
	        $(this).attr('title','visualizza tutti');
	    }else{
	        $(this).html('chiudi<img src="' + pageContext.gifClose + '" alt="chiudi" class="ml8" />');
	        $(this).attr('title','chiudi');
	    }
	    $('#wrapMulti').slideToggle();
	    return false;
	});
    
    // galleria audio/video
    var $d = makeDialog('', '', {width: 510, position: 'center',resizable:false})
    $('.openvideo').click(function(){
    	$d.setDescription($(this).parents("div.rigaMulti").find(".descVideo").text());
    	
        // embed flash
        flashembed($d.getContentDom(), {
	            src: pageContext.videoPlayer,
	            width: 470,
	            height: 290,
	            wmode: "opaque",
	           	allowfullscreen: true,
	           	allowscriptaccess: "always" 
	        },
	        {
	        	file: $(this).attr("href"),
	        	autostart : 'true',
	        	streamer: videoParams.host + (videoParams.port ? ':' : '') + videoParams.port + "/" + videoParams.vod,
	        	skin: pageContext.videoSkin,
	        	plugins: 'sharing-1',
	        	'sharing.link': document.location.href
	        	//image: "preview.jpg",
	        	//streamer: "rtmp://edge01.fms.dutchview.nl/botr"
			}
   	    );
        
        $d.dialog("open");
        
        return false;
    });
}
