// JavaScript Document
var handlerFunc = function(element) {
    new Effect.Opacity(element, {duration:2.0, to:1.0});
}

var errFunc = function(t) {
    alert('Error ' + t.status + ' -- ' + t.statusText);
}

function contact_send(element, name, email, msg){
  new Ajax.Updater(element, 'contact.php', {
    asynchronous:true,
    method:'post',
    postBody:'name='+name+'&email='+email+'&msg='+msg,
    /* onSuccess:handlerFunc(element), */
    onFailure:errFunc
  });
}

function contact_submit(element, name, email, msg){
    new Effect.Opacity(element, {duration:0.5, to:0.0});
    contact_send(element, name, email, msg);
    window.setTimeout("new Effect.Opacity('"+element+"', {duration:0.7, to:1.0});", 2200)
}