﻿//performs an ajax post request

function lmajax_request(url, action, data, dataType) {

  if (url.indexOf("?") > -1)

    url += "&";

  else

    url += "?";

  url += "ajax_action=" + action;

  if (action != "") {

    $.ajax({

      type: "GET",

      url: url,

      data: data,

      cache: false,

      dataType: dataType,

      beforeSend: eval("lmajax_beforeSend_" + action),

      complete: eval("lmajax_complete_" + action),

      success: eval("lmajax_success_" + action),

      error: eval("lmajax_error_" + action)

    });

  }

  else {

    $.ajax({

      type: "GET",

      url: url,

      data: data,

      cache: false,

      dataType: dataType

    });

  }

}

// JavaScript Document
