/* Minification failed. Returning unminified contents.
(1,1): run-time error CSS1019: Unexpected token, found '$'
(1,2): run-time error CSS1019: Unexpected token, found '('
(1,12): run-time error CSS1031: Expected selector, found '('
(1,12): run-time error CSS1025: Expected comma or open brace, found '('
(29,2): run-time error CSS1019: Unexpected token, found ')'
(30,9): run-time error CSS1031: Expected selector, found ';'
(30,9): run-time error CSS1025: Expected comma or open brace, found ';'
(38,15): run-time error CSS1031: Expected selector, found '='
(38,15): run-time error CSS1025: Expected comma or open brace, found '='
(53,10): run-time error CSS1031: Expected selector, found 'AjaxRequest('
(53,10): run-time error CSS1025: Expected comma or open brace, found 'AjaxRequest('
(88,10): run-time error CSS1031: Expected selector, found 'AutoComplete('
(88,10): run-time error CSS1025: Expected comma or open brace, found 'AutoComplete('
(117,10): run-time error CSS1031: Expected selector, found 'arredondaValor('
(117,10): run-time error CSS1025: Expected comma or open brace, found 'arredondaValor('
(134,10): run-time error CSS1031: Expected selector, found 'cleanArray('
(134,10): run-time error CSS1025: Expected comma or open brace, found 'cleanArray('
(145,10): run-time error CSS1031: Expected selector, found 'showLoading('
(145,10): run-time error CSS1025: Expected comma or open brace, found 'showLoading('
(151,10): run-time error CSS1031: Expected selector, found 'stopLoading('
(151,10): run-time error CSS1025: Expected comma or open brace, found 'stopLoading('
(159,10): run-time error CSS1031: Expected selector, found 'alterarLojaUsuario('
(159,10): run-time error CSS1025: Expected comma or open brace, found 'alterarLojaUsuario('
(180,10): run-time error CSS1031: Expected selector, found 'atualizarCarrinhoTopo('
(180,10): run-time error CSS1025: Expected comma or open brace, found 'atualizarCarrinhoTopo('
(195,10): run-time error CSS1031: Expected selector, found 'limparCarrinho('
(195,10): run-time error CSS1025: Expected comma or open brace, found 'limparCarrinho('
(217,10): run-time error CSS1031: Expected selector, found 'escolherLoja('
(217,10): run-time error CSS1025: Expected comma or open brace, found 'escolherLoja('
(244,10): run-time error CSS1031: Expected selector, found 'vSomenteNum('
(244,10): run-time error CSS1025: Expected comma or open brace, found 'vSomenteNum('
(276,10): run-time error CSS1031: Expected selector, found 'logar('
(276,10): run-time error CSS1025: Expected comma or open brace, found 'logar('
(300,10): run-time error CSS1031: Expected selector, found 'logoff('
(300,10): run-time error CSS1025: Expected comma or open brace, found 'logoff('
(346,18): run-time error CSS1031: Expected selector, found '='
(346,18): run-time error CSS1025: Expected comma or open brace, found '='
(346,4525): run-time error CSS1019: Unexpected token, found '('
(346,4544): run-time error CSS1031: Expected selector, found ')'
(346,4544): run-time error CSS1025: Expected comma or open brace, found ')'
(346,8266): run-time error CSS1019: Unexpected token, found '('
(346,8280): run-time error CSS1031: Expected selector, found ')'
(346,8280): run-time error CSS1025: Expected comma or open brace, found ')'
(350,1): run-time error CSS1019: Unexpected token, found '('
(350,2): run-time error CSS1019: Unexpected token, found 'function('
(350,11): run-time error CSS1019: Unexpected token, found '$'
(350,12): run-time error CSS1019: Unexpected token, found ')'
(350,13): run-time error CSS1019: Unexpected token, found '{'
(350,14): run-time error CSS1019: Unexpected token, found '$'
(350,19): run-time error CSS1030: Expected identifier, found 'extend('
(350,19): run-time error CSS1031: Expected selector, found 'extend('
(350,19): run-time error CSS1025: Expected comma or open brace, found 'extend('
(351,397): run-time error CSS1019: Unexpected token, found ')'
(351,398): run-time error CSS1019: Unexpected token, found '}'
(351,399): run-time error CSS1019: Unexpected token, found ')'
(351,400): run-time error CSS1019: Unexpected token, found '('
(351,407): run-time error CSS1031: Expected selector, found ')'
(351,407): run-time error CSS1025: Expected comma or open brace, found ')'
 */
$(function () {
    $('img').bind('contextmenu', function () {
        return false;
    });

    $('input[name=quantidade]').bind('keypress', function (e) {
        return (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) ? false : true;
    });

    if (JSON == undefined) {
        JSON = new Object();
        JSON.stringify = function (texto) {
            jQuery.parseJSON(texto);
            /*var novoJSON = "[";
            for (var i = 0; i < texto.length; i++) {
                novoJSON = "{";
                for (var j = 0; j < texto[i].length; j++) {
                    novoJSON += texto[i][j];
                    if (i < texto.length - 1) {
                        novoJSON += ",";
                    }
                }
                novoJSON = "}";
            }
            novoJSON += "]";
            return novoJSON;*/
        }
    }
});
var JSON;


////////////////
/// Função que simula o String.format do .NET
/// Retorna o texto formatado
//  Exemplo de uso: var resultado = String.format('{0} e {1}', 'João', 'Maria');
////////////////
String.format = function () {
    var value = arguments[0];
    for (var i = 0; i < arguments.length - 1; i++) {
        var reg = new RegExp("\\{" + i + "\\}", "gm");
        value = value.replace(reg, arguments[i + 1]);
    }
    return value;
};

/// method  = [GET,POST,PUT,DELETE]
/// url   = "/Customer/UpdateName
/// data  = {id: 1, name: 'Ramon'};
/// async = true or false;
/// var success = function(data) {alert("OK"); }; //o success sempre recebera o retorno da ajax request como parametro               
/// CASO O RETORNO SEJA ESPERADO O ARGUMENTO async DEVERÁ SER false
function AjaxRequest(url, data, success, async, method, errorFunction) {
    if (method == null) {
        method = "GET";
    }
    var ajaxasync = false;
    if (async)
        ajaxasync = async;

    if (errorFunction == undefined) {
        errorFunction = function () {
            stopLoading();
            window.location.href = "/Home/Index";
        }
    }
    
    $.ajax({
        url: url,
        data: data,
        async: ajaxasync,
        type: method,
        success: function (result) {
            if (success != null)
            {
                stopLoading();
                success(result);
            }
        },
        error: function (request, status, error)
        {
            errorFunction();
            //alert(request.msg);
        }
    });
}

function AutoComplete(textfield, hiddenfield, action) {
    var obj = $("#" + textfield);
    obj.autocomplete({
        minLength: 3,
        source: function (request, response) {
            $.getJSON(action + "?busca=" + obj.val(), function (data) {
                if (!data)
                    return;

                response($.map(data, function (item) {

                   return {
                       label: item.NomeProduto + ' - ' + item.Apresentacao,
                       value: item.NomeProduto
                   };
                }));
            });
        }//,
        //select: function (event, ui) {
        //    this.value = ui.item.label;
        //    $("#" + idField).val(ui.item.value);
        //    return false;
        //}
    });
}




function arredondaValor(num) {
    num = num.toString().replace(/\$|\,/g, '');
    if (isNaN(num))
        num = "0";
    sign = (num == (num = Math.abs(num)));
    num = Math.floor(num * 100 + 0.50000000001);
    cents = num % 100;
    num = Math.floor(num / 100).toString();
    if (cents < 10)
        cents = "0" + cents;

    for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3) ; i++)
        num = num.substring(0, num.length - (4 * i + 3)) +
       num.substring(num.length - (4 * i + 3));
    return (((sign) ? '' : '-') + '' + num + '.' + cents);
}

function cleanArray(actual) {
    var newArray = new Array();
    for (var i = 0; i < actual.length; i++) {
        if (actual[i]) {
            newArray.push(actual[i]);
        }
    }
    return newArray;
}


function showLoading() {
    $("#modal").removeAttr("style");
    $("#modal").attr("style", "display: normal;");
   // $("#modal").show();
}

function stopLoading() {
    //$("#modal").hide();
    $("#modal").removeAttr("style");
    $("#modal").attr("style", "display: none;");

    //$("#modal").hide();
}

function alterarLojaUsuario(lojaId) {
    var url = "/Distribuidora/AlterarLoja";
    var data = { lojaId: lojaId };
    
    var success = function (result)
    {
        if (result)
        {
            url = "/Carrinho/CalcularItensCarrinho";
            AjaxRequest(url, null, null, false, "GET");
            window.location.href = "/Distribuidora/Index";
        }
        else
        {
            alert('Não há produtos disponiveis para esta loja!');
        }
    };

    AjaxRequest(url, data, success, true, "POST");
}

function atualizarCarrinhoTopo() {
    var url = "/Carrinho/CalcularItensCarrinho";

    var success = function (result) {
        $("#spn-total-itens").text(result[0]);
        $("#spn-total-comprado").text(result[1]);
        $("#spn-topo-quantidade").text(result[0]);
        $("#spn-topo-total").text(result[1]);
        //$("#spn-loja").text(result[2]);
    };

    AjaxRequest(url, null, success, true, "POST");
}


function limparCarrinho()
{
    if (window.confirm('Deseja limpar todos os itens do carrinho?'))
    {
        var url = "/Distribuidora/LimparCarrinho";

        //showLoading();

        var success = function (result)
        {
            $("#spn-total-itens").text(0);
            $("#spn-total-comprado").text('0,00');

            $(location).attr('href', "/Distribuidora/Index");

            $("#div-apresentacao").html(result);
        };

        AjaxRequest(url, null, success, true, "POST");
    }
}

function escolherLoja(lojaId)
{
    var url = "/Empresa/ValidaLoja";
    var data = { lojaId: lojaId };

    var success = function (result)
    {
        if (result[1] == 0)
        {
            alert('Não há produtos para esta loja!');
        }
        else
        {
            if (result[1] == 2)
            {
                $(location).attr('href', "/Empresa/Index");
            }
            else
            {
                $(location).attr('href', "/Login/Index");
            }
        }
    };

    AjaxRequest(url, data, success, false, "POST");
}

function vSomenteNum(evt, bAceitaVirgula_) {
    var key_code = evt.keyCode ? evt.keyCode :
                       evt.charCode ? evt.charCode :
                       evt.which ? evt.which : void 0;

    //Aceita a virgula para informar numeros decimais:
    if (bAceitaVirgula_ && key_code == 44)
        return true

    //key_code == 46

    // Habilita teclas <DEL>, <TAB>, <ENTER>, <ESC> e <BACKSPACE>
    if (key_code == 46 || key_code == 8 || key_code == 9 || key_code == 13 || key_code == 27) {
        return true;
    }

        // Habilita teclas <HOME>, <END>, mais as quatros setas de navegação (cima, baixo, direta, esquerda)
    else if (key_code >= 35 && key_code <= 40) {
        return true
    }

        // Habilita números de 0 a 9
    else if ((key_code >= 48) && (key_code <= 57)) {
        return true
    }

    return false;
}


//if (e.keyCode == 13) { $('#txt-senha').focus(); }

function logar()
{
    var url = "/Login/ValidarLogin";
    var data = { login: $("#txt-login").val(), senha: $("#txt-senha").val() };

    var success = function (result) {
        if (result != null) {

            if (result == 0) {
                alert('Usuário ou senha inválidos. Por favor, tente novamente.');
                return;
            }
            else {
                $("#div-topo").html(result);
                $("#div-login").hide();
                $("#div-logoff").show();
                window.location.href = "/";
            }
        }
    };

    AjaxRequest(url, data, success, false, "POST");
}

function logoff()
{
    if (window.confirm('Deseja sair do portal?'))
    {
        var url = "/Login/Deslogar";

        var success = function(result)
        {
            if (result)
            {
                $("#div-login").show();
                $("#div-logoff").hide();
                window.location.href = "/";
            }
        };

        AjaxRequest(url, null, success, true, "POST");
    }
}

/*$(function () {
    $("#txt-senha").keypress(function (e) {
        if (e.keyCode == 13) {
            $("#btn-login").click();
            return e.preventDefault();
        }
    });

    $("#txt-login").keydown(function (e) {
        if (e.keyCode == 13) {
            
            $("#txt-senha").focus();
            return e.preventDefault();
        }
    });
});*/

/*$(function () {
    $("#btn-Lista").click(function () {
        window.location.href = "/WishList/Index";
    });
});*/

/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-touch-shiv-cssclasses-teststyles-prefixes-load
 */
;window.Modernizr=function(a,b,c){function w(a){j.cssText=a}function x(a,b){return w(m.join(a+";")+(b||""))}function y(a,b){return typeof a===b}function z(a,b){return!!~(""+a).indexOf(b)}function A(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:y(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u={}.hasOwnProperty,v;!y(u,"undefined")&&!y(u.call,"undefined")?v=function(a,b){return u.call(a,b)}:v=function(a,b){return b in a&&y(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var B in n)v(n,B)&&(s=B.toLowerCase(),e[s]=n[B](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)v(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},w(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+q.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
// leanModal v1.1 by Ray Stone - http://finelysliced.com.au
// Dual licensed under the MIT and GPL

(function($){$.fn.extend({leanModal:function(options){var defaults={top:100,overlay:0.8,closeButton:null};var overlay=$("<div id='lean_overlay'></div>");$("body").append(overlay);options=$.extend(defaults,options);return this.each(function(){var o=options;$(this).click(function(e){var modal_id=$(this).attr("href");$("#lean_overlay").click(function(){close_modal(modal_id)});$(o.closeButton).click(function(){close_modal(modal_id)});var modal_height=$(modal_id).outerHeight();var modal_width=$(modal_id).outerWidth();
$("#lean_overlay").css({"display":"block",opacity:0});$("#lean_overlay").fadeTo(200,o.overlay);$(modal_id).css({"display":"block","position":"fixed","opacity":0,"z-index":11000,"left":50+"%","margin-left":-(modal_width/2)+"px","top":o.top+"px"});$(modal_id).fadeTo(200,1);e.preventDefault()})});function close_modal(modal_id){$("#lean_overlay").fadeOut(200);$(modal_id).css({"display":"none"})}}})})(jQuery);

