/**
 * @author Roy
 */




function toggleDivMailer(thisNode) {
	var divMailer = document.getElementById('divMailer');
//	alert(thisNode.parentNode.id);
//	divMailer.style.display="inline";	
	
	$("#divMailer").fadeIn("fast");
		
}

function showRequest(formData, jqForm, options) { 
    // formData is an array; here we use $.param to convert it to a string to display it 
    // but the form plugin does this for you automatically when it submits the data 
    var queryString = $.param(formData); 
 
    // jqForm is a jQuery object encapsulating the form element.  To access the 
    // DOM element for the form do this: 
    // var formElement = jqForm[0]; 
 
    alert('About to submit: \n\n' + queryString); 
 
    // here we could return false to prevent the form from being submitted; 
    // returning anything other than false will allow the form submit to continue 
    return true; 
} 

$('#divMailerForm').submit(function() { 
    // submit the form 
    $(this).ajaxSubmit(); 
    // return false to prevent normal browser submit and page navigation 
    return false; 
});

$("#divMailer").ajaxSuccess(function(request, settings){
  $(this).append("<li>Successful Request!</li>");
  $("#divMailer").fadeOut("slow");
//  this.className="invisible";
});

function invokeAjax(form,url) {
 	
  $("#divMailer").ajaxError(function(request, settings){
  $(this).append("<li>Error requesting page " + settings.url + "</li>");
});

$("#divMailer").ajaxSuccess(function(request, settings){
  $(this).append("<li>Successful Request!</li>");
  $("#divMailer").fadeOut("slow");
//  this.className="invisible";
});
 	
 	$.ajax({
  	type: "POST",
  	url: url,
  	data: "name=John&location=Boston"

  });
 }


