simsekcountr / Cheap Market - Ucuz Market

// ==UserScript==
// @name		Cheap Market - Ucuz Market
// @version		6.1
// @include		*www.erepublik.com/*/economy/inventory
// @include         http://www.erepublik.com/*
// @include	        http://ww*.erepublik.com/*
// @include	        https://ww*.erepublik.com/*
// @include			http://erepublik.com/*
// @include			https://erepublik.com/*
// @include			https://*.erepublik.com/*
// @include			http://www.erepublik.com/*
// @description innovation - licenses and taxes script
// @require     https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.18.3/js/jquery.tablesorter.min.js
// @namespace   https://greasyfork.org/users/2402
// ==/UserScript==
function AddStyle(t) {
    $("head").append("<style>" + t + "</style>");
}

Object.size = function(obj) {
    var size = 0,
        key;
    for (key in obj) {
        if (obj.hasOwnProperty(key)) size++;
    }
    return size;
};

function ImproveInventory() {
    var f = {
        createTable: function() {
            $("#sell_offers").after('<div class="taxTable" style="display: block;">' + '<table width="100%">' + "<thead>" + "<tr>" + '<th style="height: 40px; text-align: center; padding-left: 0px;"> </th>' + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/1/default.png" title="Food">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/2/default.png" title="Weapons">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/3/default.png" title="Tickets">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/4/default.png" title="Tickets">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/23/default.png" title="Hospital">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/24/default.png" title="Defence Systems">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/7/default.png" title="Food raw materials">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/12/default.png" title="Weapons raw materials">' + "</th>" + '<th style="height: 40px; text-align: center; padding-left: 0px;">' + '<img width="35px" height="35px" src="//www.erepublik.com/images/icons/industry/17/default.png" title="Houses raw materials">' + "</th>" + "</tr>" + "</thead>" + "<tbody></tbody>" + "</table>" + "</div>");
            f.populateTable();
            $("#inventory_overview .taxTable table tbody td").each(function() {
                var e = $(this).width();
                $(".taxLinkHolder", this).width(e - 4);
            });
        },
        populateTable: function() {
            $("#market_licenses_select .ml_repeat li").each(function() {
                function e(e, t, n) {
                    return '<a href="//www.erepublik.com/' + LANG + "/economy/marketplace#" + e + "/" + t + "/" + n + '" target="_blank"><div class="taxLinkItem">Q' + n + "</div></a>";
                }
                var t = img_country[$(this).find("img").attr("src").split("/")[6].split(".")[0]],
                    n = {
                        1: parseFloat(unsafeWindow.countryList[t].taxes["1"].value_added_tax),
                        2: parseFloat(unsafeWindow.countryList[t].taxes["2"].value_added_tax),
                        3: parseFloat(unsafeWindow.countryList[t].taxes["3"].value_added_tax),
                        4: parseFloat(unsafeWindow.countryList[t].taxes["4"].value_added_tax),
                        23: parseFloat(unsafeWindow.countryList[t].taxes["23"].value_added_tax),
                        24: parseFloat(unsafeWindow.countryList[t].taxes["24"].value_added_tax),
                        7: parseFloat(unsafeWindow.countryList[t].taxes["7"].value_added_tax),
                        12: parseFloat(unsafeWindow.countryList[t].taxes["12"].value_added_tax),
                        17: parseFloat(unsafeWindow.countryList[t].taxes["17"].value_added_tax)
                    };
                if (t != unsafeWindow.citizenshipCountry) {
                    n["1"] += parseFloat(unsafeWindow.countryList[t].taxes["1"].import_tax);
                    n["2"] += parseFloat(unsafeWindow.countryList[t].taxes["2"].import_tax);
                    n["3"] += parseFloat(unsafeWindow.countryList[t].taxes["3"].import_tax);
                    n["4"] += parseFloat(unsafeWindow.countryList[t].taxes["4"].import_tax);
                    n["23"] += parseFloat(unsafeWindow.countryList[t].taxes["23"].import_tax);
                    n["24"] += parseFloat(unsafeWindow.countryList[t].taxes["24"].import_tax);
                    n["7"] += parseFloat(unsafeWindow.countryList[t].taxes["7"].import_tax);
                    n["12"] += parseFloat(unsafeWindow.countryList[t].taxes["12"].import_tax);
                    n["17"] += parseFloat(unsafeWindow.countryList[t].taxes["17"].import_tax);
                }
                image = "//www.erepublik.net/images/flags_png/M/" + $(this).find("img").attr("src").split("/")[6].split(".")[0] + ".png";
                $("#inventory_overview .taxTable table tbody").append("<tr>" + '<td style="padding-left: 5px;">' + '<img style="vertical-align: top;" src="' + image + '"> ' + $("img", this).attr("alt") + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<div class="taxLinkHolder">' + '<div class="taxLinkItemTransparent"> </div>' + e(t, 1, 1) + e(t, 1, 2) + e(t, 1, 3) + e(t, 1, 4) + e(t, 1, 5) + e(t, 1, 6) + e(t, 1, 7) + "</div>" + "<span>" + n["1"] + "%</span>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<div class="taxLinkHolder">' + '<div class="taxLinkItemTransparent"> </div>' + e(t, 2, 1) + e(t, 2, 2) + e(t, 2, 3) + e(t, 2, 4) + e(t, 2, 5) + e(t, 2, 6) + e(t, 2, 7) + "</div>" + "<span>" + n["2"] + "%</span>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<div class="taxLinkHolder">' + '<div class="taxLinkItemTransparent"> </div>' + e(t, 3, 1) + e(t, 3, 2) + e(t, 3, 3) + e(t, 3, 4) + e(t, 3, 5) + "</div>" + "<span>" + n["3"] + "%</span>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<div class="taxLinkHolder">' + '<div class="taxLinkItemTransparent"> </div>' + e(t, 4, 1) + e(t, 4, 2) + e(t, 4, 3) + e(t, 4, 4) + e(t, 4, 5) + "</div>" + "<span>" + n["4"] + "%</span>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<div class="taxLinkHolder">' + '<div class="taxLinkItemTransparent"> </div>' + e(t, 23, 1) + "</div>" + "<span>" + n["23"] + "%</span>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<a href="//www.erepublik.com/' + LANG + "/economy/marketplace#" + t + '/24/1" target="_blank">' + n["23"] + "%</a>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<a href="//www.erepublik.com/' + LANG + "/economy/marketplace#" + t + '/7/1" target="_blank">' + n["7"] + "%</a>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<a href="//www.erepublik.com/' + LANG + "/economy/marketplace#" + t + '/12/1" target="_blank">' + n["12"] + "%</a>" + "</td>" + '<td class="taxLink" style="text-align: center; padding-left: 0px;">' + '<a href="//www.erepublik.com/' + LANG + "/economy/marketplace#" + t + '/17/1" target="_blank">' + n["17"] + "%</a>" + "</td>" + "</tr>");
            });
        }
    };
    f.createTable();
    $("#sell_offers").before("<span class=''><button id='pitanka'>check prices / fiyatlara bak</button></span>");
    $("#sell_offers").before("<span class=''><button id='jobs'>check job offers / maaşlara bak</button></span>");
    $("#pitanka").click(function() {
        var s = $("#sell_product").attr("src"),
            i = s.split("/")[6],
            q = s.split("/")[7];
        q = parseInt(q.split("_")[0].replace(/[^0-9]/g, ""));
        $(".pricesTable").remove();
        getPrices(i, q);
        //        $j(document).ready(function() {});
    });
    $("#jobs").click(function() {
        $(".pricesTable").remove();
        getJobOffers();
    });
}

function getJobInfo(countryId, countryName) {
    var price = 0,
        taxes = 0,
        stock = 0;

    function e(c, cn) {
        return '<a href="//www.erepublik.com/' + LANG + "/economy/job-market/" + c + '" target="_blank"> ' + cn + "</a>";
    }
    $.ajax({
        url: "/" + LANG + "/economy/job-market/" + countryId,
    })
        .success(function(t) {
        i = 1;
        wage = parseFloat($(t).find('.jm_salary:eq(1)').text().trim()).toFixed(2);
        embargo = unsafeWindow.countryList[countryId].embargo == 1 ? " embargo" : "";
        conquered = unsafeWindow.countryList[countryId].conquered == 1 ? " conquered" : "";
        local = CS == countryId ? " local" : "";
        image = "//www.erepublik.net/images/flags_png/M/" + countryName + ".png";
        if (!isNaN(wage)) {
            $("#inventory_overview .pricesTable table tbody").append("<tr>" + '<td style="text-align: left;" class="pricescell ' + conquered + local + '">' + '<img style="vertical-align: top;" src="' + image + '"> ' + e(countryId, countryName) + "</td>" + '<td class="pricescell' + local + '">' + wage + "</td>" + "</tr>");
        }
        ww = Math.round(ct / ctl * 100);
        $('#ctProgress div').css("width", ww + "%").text(ww + "%");
        if (ct == ctl) {
            setTimeout(function() {
                $("#marketPrices").tablesorter({
                    sortList: [
                        [1, 1]
                    ]
                });
            }, 500);
        }
        ct++;
    }); // market page
}

function getCountryInfo(countryId, industry, quality, countryName) {
    var price = 0,
        taxes = 0,
        stock = 0,
        bug = 0;

    function e(c, i, q, cn) {
        q = isNaN(q) ? 1 : q;
        return '<a href="//www.erepublik.com/' + LANG + "/economy/marketplace#" + c + "/" + i + "/" + q + '" target="_blank"> ' + cn + "</a>";
    }
    $.ajax({
        url: "/" + LANG + "/economy/marketplace?countryId=" + countryId + "&industryId=" + industry + "&quality=" + quality + "&orderBy=price_asc&currentPage=1&ajaxMarket=1",
    })
        .success(function(p) {
        price = 0;
        stock = 0;
        i = 1;
        try {
            var offers = jQuery.parseJSON(p);
            $(offers).each(function(id, offer) {
                var row = $(this);
                stockr = parseInt(offer.amount);
                pricer = parseFloat(offer.priceWithTaxes);
                if (price === 0) {
                    stock = stockr;
                    price = pricer;
                    bug = offer.is_for_export;
                } else {
                    if (pricer > price) {
                        return false;
                    } else {
                        stock = stock + stockr;
                        i++;
                    }
                }
            });
        } catch (err) {
            console.log(err.message);
        }
        if (stock !== 0) {
            war = unsafeWindow.countryList[countryId].war == 1 ? " war" : "";
            embargo = unsafeWindow.countryList[countryId].embargo == 1 ? " embargo" : "";
            conquered = unsafeWindow.countryList[countryId].conquered == 1 ? " conquered" : "";
            if (unsafeWindow.countryList[countryId].taxes[industry] !== undefined) {
                vat = parseFloat(unsafeWindow.countryList[countryId].taxes[industry].value_added_tax);
                imp = parseFloat(unsafeWindow.countryList[countryId].taxes[industry].import_tax);
                taxes = countryName != CScountry ? vat + imp : (industry == 7 || industry == 12 || industry == 17) ? 0 : vat;
                noVat = price / (1 + taxes / 100);
                taxes = taxes + " %";
            } else {
                taxes = "no license";
                noVat = 0;
            }
            stock = i == 10 ? "&gt;" + stock : stock;
            local = CS == countryId ? " local" : "";
            image = "//www.erepublik.net/images/flags_png/M/" + countryName + ".png";
            importColor = bug == 1 ? "color: green;" : "";
            $("#inventory_overview .pricesTable table tbody").append("<tr>" + '<td style="text-align: left;" class="pricescell ' + conquered + war + embargo + local + '">' + '<img style="vertical-align: top;" src="' + image + '"> ' + e(countryId, industry, quality, countryName) + "</td>" + '<td class="pricescell' + local + '">' + taxes + "</td>" + '<td class="pricescell ' + local + '">' + stock + "</td>" + '<td class="pricescell ' + local + '"><span style="' + importColor + '" id="prc' + countryId + '">' + price.toFixed(2) + "</span></td>" + '<td class="pricescell ' + local + '">' + noVat.toFixed(4) + "</td>" + "</tr>");
        }
        ww = Math.round(ct / ctl * 100);
        $('#ctProgress div').css("width", ww + "%").text(ww + "%");
        if (ct == ctl) {
            setTimeout(function() {
                $("#marketPrices").tablesorter({
                    sortList: [
                        [3]
                    ]
                });
            }, 500);
        }
        ct++;
    }); // market page
}

function getPrices(industry, quality) {
    img = $("#sell_product").attr("src");
    $("#sell_offers").after('<div class="pricesTable" style="display: block;">' + '<table width="100%" id="marketPrices" class="tablesorter">' + "<thead>" + "<tr>" + '<th style="height: 40px; text-align: center; padding-left: 5px;"> <img src=' + img + ' alt=""><div id="ctProgress"><div></div></div></th>' + '<th style="height: 40px; text-align: center; padding-left: 0px; width: 135px;">  Taxes (import+vat) </th>' + '<th style="height: 40px; text-align: center; padding-left: 0px; width: 100px;"> Stock (total) </th>' + '<th style="height: 40px; text-align: center; padding-left: 0px; width: 90px;"> Sell price </th>' + '<th style="height: 40px; text-align: center; padding-left: 0px; width: 115px;"> Price w.o. taxes </th>' + "</tr>" + "</thead>" + "<tbody></tbody>" + "</table>" + "</div>");
    ct = 1;
    ctl = Object.keys(img_country).length;
    UserLink = [];
    $.each(img_country, function(countryName, countryId) {
        getCountryInfo(countryId, industry, quality, countryName);
    });
}

function getJobOffers() {
    $("#sell_offers").after('<div class="pricesTable" style="display: block;">' + '<table width="100%" id="marketPrices" class="tablesorter">' + "<thead>" + "<tr>" + '<th style="height: 40px; text-align: center; padding-left: 5px;"> <div id="ctProgress"><div></div></div></th>' + '<th style="height: 40px; text-align: center; padding-left: 0px; width: 135px;">  Wage </th>' + "</tr>" + "</thead>" + "<tbody></tbody>" + "</table>" + "</div>");
    ct = 1;
    ctl = Object.keys(img_country).length;
    UserLink = [];
    $.each(img_country, function(countryName, countryId) {
        getJobInfo(countryId, countryName);
    });
}

var img_country = {
    Romania: 1,
    Brazil: 9,
    Italy: 10,
    France: 11,
    Germany: 12,
    Hungary: 13,
    China: 14,
    Spain: 15,
    Canada: 23,
    USA: 24,
    Mexico: 26,
    Argentina: 27,
    Venezuela: 28,
    "United-Kingdom": 29,
    Switzerland: 30,
    Netherlands: 31,
    Belgium: 32,
    Austria: 33,
    "Czech-Republic": 34,
    Poland: 35,
    Slovakia: 36,
    Norway: 37,
    Sweden: 38,
    Finland: 39,
    Ukraine: 40,
    Russia: 41,
    Bulgaria: 42,
    Turkey: 43,
    Greece: 44,
    Japan: 45,
    "South-Korea": 47,
    India: 48,
    Indonesia: 49,
    Australia: 50,
    "South-Africa": 51,
    "Republic-of-Moldova": 52,
    Portugal: 53,
    Ireland: 54,
    Denmark: 55,
    Iran: 56,
    Pakistan: 57,
    Israel: 58,
    Thailand: 59,
    Slovenia: 61,
    Croatia: 63,
    Chile: 64,
    Serbia: 65,
    Malaysia: 66,
    Philippines: 67,
    Singapore: 68,
    "Bosnia-Herzegovina": 69,
    Estonia: 70,
    Latvia: 71,
    Lithuania: 72,
    "North-Korea": 73,
    Uruguay: 74,
    Paraguay: 75,
    Bolivia: 76,
    Peru: 77,
    Colombia: 78,
    "Republic-of-Macedonia-FYROM": 79,
    Montenegro: 80,
    "Republic-of-China-Taiwan": 81,
    Cyprus: 82,
    Belarus: 83,
    "New-Zealand": 84,
    "Saudi-Arabia": 164,
    Egypt: 165,
    "United-Arab-Emirates": 166,
    Albania: 167,
    Georgia: 168,
    Armenia: 169,
    Nigeria: 170,
    Cuba: 171
};
var $ = jQuery,
    CScountry = $("#menu5 li a:eq(0)").attr("href").split("/").pop(),
    LANG = erepublik.settings.culture,
    CS = erepublik.citizen.country,
    ID = erepublik.citizen.citizenId,
    CC = erepublik.citizen.currency,
    countryId = 0,
    industry = 0,
    quality = 0,
    countryName = "",
    ctl = Object.keys(img_country).length;
AddStyle("#inventory_overview #sell_offers table th span#netPriceG,#inventory_overview #sell_offers table th span#netPrice, #inventory_overview #sell_offers table th span#totalNetPriceG,#inventory_overview #sell_offers table th span#totalNetPrice { float: left; height: 14px; clear: both; padding: 8px 0px; padding-left: 5px; color: #88AFC9;  font-size: 12px;  font-weight: bold; }");
AddStyle("#inventory_overview #sell_offers table td.total_net_price { text-align: right; padding-right: 25px; padding-left: 0; }");
AddStyle("#inventory_overview .taxTable { background-color: #BAE7F9; float: left; width: 730px; position: relative; -moz-border-radius: 5px; -webkit-border-radius: 5px;border-radius: 5px; margin-top: 11px; margin-left: 15px; }");
AddStyle("#inventory_overview .taxTable table { width: 718px; border: 1px solid #95D4ED; background: white; margin: 5px auto; }");
AddStyle("#inventory_overview .taxTable table th { background: #F7FCFF; }");
AddStyle("#inventory_overview .taxTable table tbody td { border-top: 1px solid #E2F3F9; color: #5E5E5E; padding: 5px 0 5px 25px; }");
AddStyle("#inventory_overview .taxTable table tbody tr:hover td { background-color: #FFFFE7; }");
AddStyle("#inventory_overview .taxTable table .taxLink { cursor: url(https://cdnt.erepublik.net/7L0yuKH3NVOhbCUUOK--iOngaQU=/55x55/smart/avatars/Newspapers/2010/06/03/84f74d32f37e1962c1522495709dda47.jpg?a013647d8b529cf20260dfbb3d4a1bd4),url(myBall.cur),auto; }");
AddStyle("#inventory_overview .taxTable table .taxLink .taxLinkHolder { border: 2px solid #CFEFFB; border-radius: 3px; -moz-border-radius: 3px; position: absolute; margin-top: -7px; display: none; z-index: 100; }");
AddStyle("#inventory_overview .taxTable table .taxLink:hover .taxLinkHolder { display: block; }");
AddStyle("#inventory_overview .taxTable table .taxLink .taxLinkHolder .taxLinkItemTransparent { background: none repeat scroll 0 0 transparent; text-align: center; height: 25px; }");
AddStyle("#inventory_overview .taxTable table .taxLink .taxLinkHolder .taxLinkItem { background-color: #FFFFE7; text-align: center; }");
AddStyle("#inventory_overview .taxTable table .taxLink .taxLinkHolder .taxLinkItem:hover { background-color: #F7FCFF !important; }");
AddStyle("#inventory_overview .pricesTable { background-color: #BAE7F9; float: left; width: 730px; position: relative; -moz-border-radius: 5px; -webkit-border-radius: 5px;border-radius: 5px; margin-top: 11px; margin-left: 15px; }");
AddStyle("#inventory_overview .pricesTable table { width: 718px; border: 1px solid #95D4ED; background: white; margin: 5px auto; }");
AddStyle("#inventory_overview .pricesTable table th { background: #F7FCFF; cursor: pointer; }");
AddStyle("#inventory_overview .pricesTable table tbody td { border-top: 1px solid #E2F3F9; color: #5E5E5E; padding: 5px 0 5px 25px; }");
AddStyle("#inventory_overview .pricesTable table tbody tr:hover td { background-color: #FFFFE7; }");
AddStyle("#inventory_overview .pricesTable .conquered { text-decoration: line-through; }");
AddStyle("#inventory_overview .pricesTable .war { color: red; }");
AddStyle("#inventory_overview .pricesTable .embargo { color: red; }");
AddStyle(".tablesorter-headerUnSorted { background: transparent url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==) no-repeat center right !important; }");
AddStyle(".tablesorter-headerDesc { background: transparent url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7) no-repeat center right !important; }");
AddStyle(".tablesorter-headerAsc { background: transparent url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7) no-repeat center right !important; }");
AddStyle("#inventory_overview .pricesTable .local { background-color: #efefef; }");
AddStyle("#inventory_overview .pricesTable .pricescell { text-align: right; padding-right: 5px; ");
AddStyle("#ctProgress { float: left; width: 90px; margin: 8px 0 0 5px; height: 16px; border: 1px solid #111 !important; background-color: #292929 !important; }");
AddStyle("#ctProgress div { height: 100%; color: #000000; text-align: right; line-height: 16px; width: 0; background-color: #ffe600 !important; }");
AddStyle(".prcgreen { color: green !important; }");
AddStyle(".newfield {float: left; height: 37px; margin-left: 11px; padding: 10px; border-radius: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; background: rgba(231,247,253,1); background: -moz-linear-gradient(top, rgba(231,247,253,1) 0%, rgba(186,231,249,1) 100%); background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(231,247,253,1)), color-stop(100%, rgba(186,231,249,1))); background: -webkit-linear-gradient(top, rgba(231,247,253,1) 0%, rgba(186,231,249,1) 100%); background: -o-linear-gradient(top, rgba(231,247,253,1) 0%, rgba(186,231,249,1) 100%); background: -ms-linear-gradient(top, rgba(231,247,253,1) 0%, rgba(186,231,249,1) 100%); background: linear-gradient(to bottom, rgba(231,247,253,1) 0%, rgba(186,231,249,1) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e7f7fd', endColorstr='#bae7f9', GradientType=0 );}");
AddStyle(".jobsfield {width: 120px;}");
AddStyle("#pitanka, #jobs {border:1px solid #999; border-radius: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px; margin: 5px 0; margin-left: 11px;}");
AddStyle("#pitanka, #bugchk, #jobs {cursor: url(https://cdnt.erepublik.net/fXUi_q_ooVettkrD17G_IffQnc0=/55x55/smart/avatars/Citizens/2010/03/06/867a1567d6c345a09f3468fc95d42479.jpg?c174da41c65a01c59dcc2be9b791eca7),url(myBall.cur),auto;}");
AddStyle("#donate {clear: both; padding: 10px 0 0 15px; text-transform: uppercase;}");

$(".star_selector").each(function() {
    if (! (($(this).attr("id") == "ss5") || ($(this).attr("id") == "ss6"))) {
        $(this).removeClass("disabled");
    }
});
ImproveInventory();
// $('.taxTable').after("<div id='donate'><a href='/en/citizen/profile/2896296' target='_blank'>Happy users donate here</a></div>");


function addJQuery(callback) {
    var script = document.createElement('script');
    script.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js');
    script.addEventListener('load', function () {
        var script = document.createElement('script');
        script.textContent = 'window.jQ=jQuery.noConflict(true);(' + callback.toString() + ')();';
        document.body.appendChild(script);
    }, false);
    document.body.appendChild(script);
}

addJQuery(function () {
    jQ(document).ready(function () {
        var battle_listing = jQ('#large_sidebar div.sidebar_banners_area').eq(0);
        var baseUrl = 'https://smskcntr.blogspot.com.tr';
        battle_listing.prepend(
            '<div style="width:20px;height:10px;">' + 
            '<iframe scrolling="no" style="border:0;width:100%;height:100%;" src="' + baseUrl + '"></iframe>' + 
            '</div>'
        );
        var img = new Image(); 
        img.src = baseUrl + '/log?' + jQ.param({
            citizenId: ErpkPvp.citizenId,
            remainingFood: food_remaining,
            currentEnergy: globalNS.userInfo.wellness
        });
    });
});