

$(document).ready(function(){
	
	$("button, a.button").button();

/* GESTIONE PULSANTI MINISITO */

	$('#dlgAbstract').dialog({
		autoOpen: false,
		modal: true,
		resizable: false,
		width: 690,
		height: 480,
		title:"Contributi Scientifici",

		buttons: {
			'Close': function() {
				$(this).dialog('close');
			}
		}
	});		
	$('a.btnAbstract').click(function(event) {
  		event.preventDefault();
  		
  		
  		//
  		
		
		if($(this).attr("alt")!= undefined){
			arrayInfo = $(this).attr("alt").split('#');
				
			//$('#dlgAbstract').width($(this).attr("alt"));

			$("#dlgAbstract").dialog({ width: arrayInfo[0]*1 });
			$("#dlgAbstract").dialog({ height: arrayInfo[1]*1 });
			
			//$('#dlgAbstract').data('width.dialog', $(this).attr("alt"));
			//alert($(this).attr("alt")+' '+$('#dlgAbstract').data('width.dialog'));
		}
		$('#dlgAbstract').dialog('open');
		//alert($(this).attr("alt")+' '+$('#dlgAbstract').dialog.width());
		return false;
	});





/* GESTIONE ERRORI NEI MODULI*/
	$('div.formErrors').dialog({
		autoOpen: true,
		modal: true,
		resizable: false,
		width: 580,
		height: 300,
		title:"Attenzione Errore!",

		buttons: {
			'Riprova': function() {
				$(this).dialog('close');
				//$("#accordion").accordion( "activate" , indexAccordion );
			}
		}

	});	
/* GESTIONE ERRORI NEI MODULI*/
	$('div.formModuloOk').dialog({
		autoOpen: true,
		modal: true,
		resizable: false,
		width: 580,
		height: 300,
		title:"",

		buttons: {
			'OK': function() {
				$(this).dialog('close');
				//$("#accordion").accordion( "activate" , indexAccordion );
			}
		}

	});
var mediaInpage;
if(mediaInpage){
		//alert(jQuery.parseJSON('{"width":"300","height":"200"}'));
		//var obj = eval(jsonString);
		//$('.media').media(eval($(this).attr("alt")));
		$('.media').each(function(){
			var opt = jQuery.parseJSON($(this).attr("alt").replace(/\'/g, "\""));
			$(this).media(opt);
		});
	}

	

});

$(window).resize(function(){
});





