﻿window.mixer = [];
window.mixer["city"] = -1;
window.mixer["region"] = -1;

$(document).ready(function () {
    $('body').pngFix();

    $.get('/home/loadmenu/', function (data) {
        $('#om_menu').append(data);
        $('#menu').menu();

        $('#menu.last').css({ width: '19%' }).prev().css({ width: '20.6%' });

        $('#menu ul').each(function (i, el) {
            $(el).children('.line').last().remove();
        });
    });

    ShowMixer();
});

$(window).hashchange(ShowMixer);

function ShowMixer() {
    var match = new RegExp(/.*#mixer(\d{1})/).exec(window.location.href);
    if (match) {
        LoadMixer(match[1]);
    }
}

$.fn.appendScript = function (src) {
    var script = document.createElement("script");
    script.src = src;
    script.type = "text/javascript";
    $(this).append(script);
};

//replaceAll
String.prototype.replaceAll = function (search, replace) {
    return this.split(search).join(replace);
};
