/**
 * Created by mFramework.
 * User: Mauro
 * Date: 10/05/11
 * Time: 13:36
 */
var MF = MF || {};

MF.sendByAjax = function( url , context , fnBeforeSend , fnSuccess ) {
    $.ajax({
        url: '?ajax=1&'+url,
        context: context,
        beforeSend: fnBeforeSend,
        success: fnSuccess
    });
};

MF.getUrlVar = function( o ) {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars[o];
};

MF.getUrl = function() {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
};
