  $(document).ready(function() {

    $("#dialog-form").dialog({
	autoOpen: false,
	height: 350,
	width: 400,
	modal: true,
	buttons: {
		'Send': function() {
		    $.post("mail.php",{
		      name: $("#dialog-form input[name='name']").val(),
		      surname: $("#dialog-form input[name='surname']").val(),
		      email: $("#dialog-form input[name='email']").val(),
		      telefono: $("##dialog-form input[name='telefono']").val(),
		      messaggio: $("#dialog-form textarea[name='messaggio']").val()
		    },
		     function(data)
		      {
			if(data == 'OK')
			  alert("Thank you for contacting us. You will be contacted by one of our team members as soon as possible");
			else
			  alert("Incorrect e-Mail or Message!");
		      }
		    );

		  alert("Thank you for contacting us. You will be contacted by one of our team members as soon as possible.");
		  $("#dialog-form :input").val("");
		  $(this).dialog('close');
		},
		Annulla: function() {
		    $(this).dialog('close');
		}
	},
	close: function() {
	}
    });

    $("#overlay").dialog({
	autoOpen: false,
	height: 450,
	width: 600,
	modal: true
    });

    // override some default options
    $('div.expandable p').expander({
      slicePoint:       100,  // default is 100
      expandText:         '[...]', // default is 'read more...'
      collapseTimer:    0, // re-collapses after 5 seconds; default is 0, so no re-collapsing
      userCollapseText: '[^]'  // default is '[collapse expanded text]'
    });

  });

