
function riabilita(nome,flag,ambito){
	
	$("input[name='data[" + ambito + "][fdata"+nome+"]']").val(flag);

	if(flag == 1){
		
		//alert('nascondo');
		$("#escludi"+nome).hide();
		$("#aggiungi"+nome).show();

		
		$("#date"+nome).slideUp();
	
	}
	else{
		
		//alert('attivo');
		
		$("#aggiungi"+nome).hide();
		$("#escludi"+nome).show();
		
		$("#date"+nome).slideDown();
	}
		
}


$(document).ready(function(){
		
	
	$('.addModal').each(function(){
        var $link = $(this);
        // $(this).button();
        var $adding = $('<div id="' + $link.attr('id') + '" class="adding ' + $link.attr('rel') + '"></div>');
        $adding.insertAfter($link);
        
        
        // al click
        $link.click(function(){
        
            if ($('div#' + $link.attr('id')).is(':visible')) {
            
                $('div#' + $link.attr('id')).slideUp();
                
                
            }
            else {
            
                $adding.load($link.attr('href')).slideDown();
                
                
                // $link.add($adding).slideDown();
            
            
            
            }
            
            return false;
        });
        
        
    });
	
	
		$('input:radio').each(function() {
			
			
			var prova = $(this).attr('name');
			
			$(this).addClass('float_l');
			
			
		});
		
		

	    $('.angolo').corner();
	   
	    $('a.lightbox').lightBox();
	//attivo tabs
		$('#tabform ul').tabs({ cookie: { expires: 30 },fxFade: true, fxSpeed: 'normal', fxAutoHeight: true });

        $("table.tablesorter").tablesorter({widgets: ['zebra']}); 
		//$('.angolo').corner();	


//$('#fragment-costi input').numeric();
$('#ribassotext').html('');
conti();
$('#fragment-costi input').blur(function () {
										  
					conti();					  
			});
											  
								

$("#aprisettori").click(


			function() 
		    {
			 $.post("/tipos/search", 
				{ 
/*					lingua: $("#lingua").val(),
					tuonome: $("#tuonome").val(),
					tuaemail: $("#tuaemail").val(),
					amiconome: $("#amiconome").val(),
					amicoemail: $("#amicoemail").val(),
					messaggio: $("#messaggio").val()
*/
},
				function(data){	
				//recupero dati 
				$("#vedisettori").html(data); 

				}
				);	
			}
			);
			
	
	
	
			
			
    });


tinyMCE.init({
	/*mode : "textareas",
	language : "it",
	theme : "advanced",
	editor_selector : "mceEditor",
	editor_deselector : "mceNoEditor",
	theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "none",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
	*/
	mode : "textareas",
	language : "it",
	theme : "advanced",
	editor_selector : "mceEditor",
	editor_deselector : "mceNoEditor",
	theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
	theme_advanced_buttons2 : "pastetext,pasteword,selectall",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "none",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
	convert_urls : false,
	//plugin per copia-incolla da word
	plugins : "paste",
	paste_convert_headers_to_strong : true,
	paste_auto_cleanup_on_paste : true,
	theme_advanced_buttons3_add : "pastetext,pasteword,selectall",
	width:"90%",
	height:"250px"
});


tinyMCE.init({
	/*mode : "textareas",
	language : "it",
	theme : "advanced",
	editor_selector : "mceEditor",
	editor_deselector : "mceNoEditor",
	theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "none",
	extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
	*/
	mode : "textareas",
	language : "it",
	theme : "advanced",
	editor_selector : "mceEditor2",
	editor_deselector : "mceNoEditor2",
	theme_advanced_buttons1 : "bold,italic,underline,pastetext,pasteword,selectall",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "none",
	extended_valid_elements : "",
	convert_urls : false,
	//plugin per copia-incolla da word
	plugins : "paste",
	paste_convert_headers_to_strong : true,
	paste_auto_cleanup_on_paste : true,
	theme_advanced_buttons3_add : "pastetext,pasteword,selectall",
	width:"90%",
	height:"250px",
	forced_root_block : false,
   force_br_newlines : true,
   force_p_newlines : false
});




 
 


