﻿function getUrl(a) {
    return carSearchUrl + "bodytype=" + gup('bodytype') + "&make=" + gup('make') + "&model=" + gup('model') + "&fuelTypeID=" + gup('fuelTypeID') + "&engineSize=" + gup('engineSize') + "&priceFrom=" + gup('priceFrom') + "&priceTo=" + gup('priceTo') + "&yearFrom=" + gup('yearFrom') + "&yearTo=" + gup('yearTo') + "&kmFrom=" + gup('kmFrom') + "&kmTo=" + gup('kmTo') + "&v=" + gup('v') + "&z=" + gup('z') + "&na=" + gup('na') + "&ag=" + gup('ag')  + "&esp=" + gup('esp') + "&pr=" + gup('pr') + "&ac=" +  gup('ac') + "&sop=" + gup('sop') + "&page_size=" + numberOfItemsInResultList + "&page_index=" + a ;
};
function gup(a) {
    a = a.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var b = "[\\?&]" + a + "=([^&#]*)";
    var c = new RegExp(b);
    var d = c.exec(window.location.href);
    if (d == null) return "";
    else return unescape(d[1])
};
function IsNumeric(a) {
    var b = "0123456789.,";
    var c = true;
    var d;
    for (i = 0; i < a.length && c == true; i++) {
        d = a.charAt(i);
        if (b.indexOf(d) == -1) {
            c = false
        }
    }
    return c
};
function FormatNumber(a) {
    if (a < 1000) {
        return a
    }
    decimalNum = 0;
    bolLeadingZero = false;
    bolParens = false;
    bolPeriods = true;
    if (isNaN(parseInt(a))) return "NaN";
    var b = a;
    var c = a < 0 ? -1 : 1;
    b *= Math.pow(10, decimalNum);
    b = Math.round(Math.abs(b));
    b /= Math.pow(10, decimalNum);
    b *= c;
    var d = new String(b);
    if (!bolLeadingZero && a < 1 && a > -1 && a != 0) if (a > 0) d = d.substring(1, d.length);
    else d = "-" + d.substring(2, d.length);
    if (bolPeriods && (a >= 1000 || a <= -1000)) {
        var e = d.indexOf(",");
        if (e < 0) e = d.length;
        e -= 3;
        while (e >= 1) {
            d = d.substring(0, e) + "." + d.substring(e, d.length);
            e -= 3
        }
    }
    if (bolParens && a < 0) d = "(" + d.substring(1, d.length) + ")";
    return d
};
function FormatString(a, b, c) {
    if (a == b) {
        a = c
    }
    return a
};
function getLogDate() {
    var a = new Date();
    var b = a.getFullYear();
    var c = a.getDate();
    var d = a.getMonth() + 1;
    if (c.length <= 1) {
        c = '0' + c
    }
    if (d.length = 1) {
        d = '0' + d
    }
    var e = b + '-' + d + '-' + c;
    return e
};
function getLogRandom() {
    var a = Math.random() * 11;
    return a
};
