
/*************TradeAds Script Code **************
*** Copyright 2009  tradeads.eu  All Rights Reserved.**/

tAdsSd = "ads.tradeads.eu";//33

function TAdsCls() {
    this.rnd = parseInt(Math.random() * Math.pow(10, 17));
    this.env = '&tz=' + ((new Date()).getTimezoneOffset()).toString()
                + '&__url=' + escape(document.URL)
                + '&__ref=' + escape(document.referrer)
                + '&domain=' + document.domain
                + ((screen.width) ? '&sw=' + screen.width : '')
                + ((screen.height) ? '&sh=' + screen.height : '');
    this.amocra = (typeof (acctrm14o) != 'undefined') ? '&ac=' + acctrm14o : "";
    this.en = function () { return this.p.en ? '&en=1' : ""; };

    this.other = function () {
        var otP = "";
        otP = ((this.p.size) ? '&size=' + this.p.size : '');
        return otP;
    };
    this.par = function () {
        return "z=" + this.p.adzone;
    };
    this.ck = function () {
        if (this.rnd && this.p && this.p.adzone)
            return true;
        else
            return false;
    };
    this.vP = function () {
        if (this.p.vP)
            return "&vp=1";
        else return "";
    };
    this.prof = function () {
        return (this.p.age ? '&age=' + escape(this.p.age) : '')
                + (this.p.gender ? '&gender=' + escape(this.p.gender) : '')
                + (this.p.married ? '&married=' + escape(this.p.married) : '')
                + (this.p.children ? '&children=' + escape(this.p.children) : '')
                + (this.p.income_per_month ? '&income_per_month=' + escape(this.p.income_per_month) : '')
                + (this.p.education ? '&education=' + escape(this.p.education) : '')
                + (this.p.occupation ? '&occupation=' + escape(this.p.occupation) : '')
                + (this.p.industry ? '&industry=' + escape(this.p.industry) : '');
    };

    this.fox = function () {
        if (typeof(tradeads_clkurl) != "undefined") {
            var x_tradeads_clkurl = tradeads_clkurl;
            tradeads_clkurl = null;
            return "&fox=" + x_tradeads_clkurl;
        }
        else return "";
    };
 this.retC = function () {
        if (this.p.returncode)
            return "&returncode=true";
        else return "";
    };

    this.GetBnr = function () {
        if (this.ck()) {
            document.write('<scrip' + 't SRC="http://' + tAdsSd + '/ads/getad?' + this.par() + this.env
                            + '&tAdsUcs=' + tAdsUcs + '&rnd=' + this.rnd + this.vP() + this.amocra + this.en() + this.fox() +this.retC()+ '"></scr' + 'ipt>');
        }
    };

    this.makeFrame = function () {
        ifrm = document.createElement("IFRAME");
        ifrm.setAttribute("src", "http://storage.tradeads.eu/frame.html?" + this.par());
        ifrm.style.width = 0 + "px";
        ifrm.style.height = 0 + "px";
        ifrm.style.border = "0px none #f5f5f5";
        document.body.appendChild(ifrm);
    };
}

if (typeof (tAdsUcs) == 'undefined') {
    tAdsUcs = 1 
};
if (typeof (tAdsObj) == 'undefined') {
    tAdsObj = new TAdsCls();
    fR = 1;
    tAdsObj.fp = 1;//fingerprint
}
else tAdsObj.p = null;


if (typeof (_tradeAdsP_) == 'object') 
    tAdsObj.p =_tradeAdsP_; 
tAdsObj.GetBnr(); _tradeAdsP_ =null;


if (!/msie|MSIE 6/.test(navigator.userAgent) && document.domain.indexOf("ziare.com") < 0)
{
    //tAdsObj.makeFrame();
}


