﻿String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); };
String.prototype.ltrim = function () { return this.replace(/^\s+/, ''); };
String.prototype.rtrim = function () { return this.replace(/\s+$/, ''); };
String.prototype.replaceAll = function (oldStr, newStr) {
    var str = this;
    var re = new RegExp(oldStr, 'gim');
    str = str.replace(re, newStr);
    return str;
};
String.format = function () {
    if (arguments.length == 0)
        return null;
    var str = arguments[0];
    for (var i = 1; i < arguments.length; i++) {
        var re = new RegExp('\\{' + (i - 1) + '\\}', 'gim');
        str = str.replace(re, arguments[i]);
    }
    return str;
};
document.write('<div id="__swfCont" style="position:absolute; top:-500px; left:-500px;"></div><div id="__swfBtCont" style="position:absolute; top:-500px; left:-500px;"></div>');
var mn = mn || {};
mn.d = document;
mn.w = window;
mn.n = navigator;
mn.ua = mn.n.userAgent.toLowerCase();
mn.FloatingBannerID = 'mdnFloating';
mn.Find = function (id) { return mn.d.getElementById ? mn.d.getElementById(id) : mn.d.all(id); };
mn.CloseBanner = function (id) {
    var elm = mn.Find(id);
    if (elm != null) elm.style.visibility = 'hidden';
};
mn.FlashSupport = function () {
    var flashSupport = (navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash']) ? navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin ? true : false : false;
    if (!flashSupport && mn.Browser.IsIE) { flashSupport = (new ActiveXObject('ShockwaveFlash.ShockwaveFlash.7')) ? true : false; }
    return flashSupport;
};
mn.Browser = new function () {
    var brID = 1;
    this.vDeter = true; this.IsIE = false; this.IsFF = false; this.IsChrome = false; this.IsSafari = false; this.IsOpera = false; this.IsWebkit = false; this.IsOther = false;
    // Useragent RegExp
    var rmz = /(firefox)[\/\s](\d+\.\d+.\d+)/gim;
    var rmz5 = /(firefox)[\/\s](\d+\.\d)/gim;
    var rwb = /(webkit)[ \/]([\w.]+)/gim;
    var rch = /(chrome)[ \/]([\w.]+)/gim;
    var rop = /(opera)(?:.*version)?[ \/]([\w.]+)/gim;
    var rie = /(msie) ([\w.]+)/gim;
    var rsa = /(version)[ \/]([\w.]+)/gim;
    var match = rch.exec(mn.ua) || rop.exec(mn.ua) || rie.exec(mn.ua) || mn.ua.indexOf('compatible') < 0 && (rmz.exec(mn.ua) || rmz5.exec(mn.ua)) || mn.ua.indexOf('safari') < 0 && rwb.exec(mn.ua) || [];
    if (match.length == 0 && mn.ua.indexOf('safari') > 0) { /* for safari*/
        match = rsa.exec(mn.ua) || [];
        match[1] = 'safari';
    }
    var version = match[2] ? match[2].split('.')[0] : '0';
    switch (match[1]) {
        case 'msie': this.IsIE = true; brID = 2; break;
        case 'firefox': this.IsFF = true; brID = 3; break;
        case 'chrome': this.IsChrome = true; brID = 4; break;
        case 'safari': this.IsSafari = true; brID = 5; break;
        case 'opera': this.IsOpera = true; brID = 6; break;
        case 'webkit': this.IsWebkit = true; break;
        default: this.IsOther = true; this._vDeter = false; break;
    }
    return { Name: match[1] || '', FullVersion: match[2] || '0', Version: version, IsIE: this.IsIE, IsFF: this.IsFF, IsChrome: this.IsChrome, IsSafari: this.IsSafari, IsOpera: this.IsOpera, IsWebkit: this.IsWebkit, IsOther: this.IsOther,
        VersionDetermined: this.vDeter, ID: brID
    };
};
var isORq = true;
mn.isOrfad = true;
mn.RunMode = function() {
    if (mn.Browser.IsFF || mn.Browser.IsChrome || mn.Browser.IsSafari) {
        isORq = false;
        mn.isOrfad = false;
    }
    if (location.hostname.indexOf("tipeez") > -1) {
        isORq = true;
        mn.isOrfad = true;
    }
};
mn.RunMode();

var d_ = document;
var n_ = navigator;
var ua_ = n_.userAgent.toLowerCase();
var http = (('https:' == d_.location.protocol) ? 'https://' : 'http://');
var _btsrc = http + 'ad.e-kolay.net/bt.js?v=2.0';
var ___script = null;
var UArr = new Array(); var DArr = new Array(); var GArr = new Array(); var _frObj, SrvCode = null, mnet_ = null, mnet__ = null;
var rnd__ = String(Math.random()).substr(2, 15); var _TargetCampaign = "";
var BUrl = "http://ad.e-kolay.net"; var PageTag;
var IsIE = (d_.all) ? true : false;
function MNSR(url) {
    rnd__ = String(Math.random()).substr(2, 15);
    this.url_ = url;
    if (url.indexOf("?") > 0)
        this.cache = "&rnd=" + rnd__;
    else
        this.cache = "?rnd=" + rnd__;
    this.bodyLoc = d_.body;
    this.scriptId = 'scriptId' + MNSR.sC++;
}

function fqobj(init) {
    if (init != "" && typeof (init) != undefined && init != null)
    { this.ciid = init.split("|")[0]; this.fqtype = init.split("|")[1]; this.fqvalue = init.split("|")[2]; this.fqmaxvalue = init.split("|")[3]; this.fqdate = init.split("|")[4]; }
    else
    { this.ciid = 0; this.fqtype = 0; this.fqvalue = 0; this.fqmaxvalue = 0; this.fqdate = null; }
}

fqobj.prototype.toString = function () { return this.ciid + "|" + this.fqtype + "|" + this.fqvalue + "|" + this.fqmaxvalue + "|" + this.fqdate; };

MNSR.prototype.UpdateFqList = function (f) {
    var isc = false;
    var cname = f.fqtype == 1 ? "fqsession" : "fqcookie";
    var fqcookie = new String(getCookie(cname));
    var fqarr = fqcookie.split(",");
    for (var i = 0; fqcookie != "" && i < fqarr.length; i++) {
        var o = new fqobj(fqarr[i]);
        if (o.ciid == f.ciid)
        { o.fqvalue++; o.fqmaxvalue = f.fqmaxvalue; fqarr.push(o.toString()); isc = true; }
        else
            fqarr.push(o.toString());
    }

    if (!isc)
        fqarr.push(f.toString());
    setCookie(cname, fqarr);
};
MNSR.prototype.GetFqList = function () {
    var returnstr = "";
    if (getCookie("fqsession") != null) {
        var fqcookie = new String(getCookie("fqsession"));
        var fqarr = fqcookie.split(",");
        for (var i = 0; i < fqarr.length; i++) {
            var o = new fqobj(fqarr[i]);
            if (o.ciid != 0 && o.fqtype == 1 && (parseInt(o.fqvalue) >= parseInt(o.fqmaxvalue) - 1))
                returnstr += returnstr != "" ? "," + o.ciid : o.ciid;
        }
    }
    return returnstr;
};

MNSR.sC = 1;
MNSR.prototype.BST = function () {
    this.sObj = d_.createElement("iframe");
    this.sObj.frameBorder = 0; this.sObj.left = -100; this.sObj.top = -100; this.sObj.width = 1; this.sObj.height = 1;
    this.sObj.setAttribute("name", this.scriptId);
    this.sObj.style.visibility = 'hidden';
    this.fqlist = this.GetFqList();
    var stru = "javascript:document.write('<script src=" + BUrl + "/orfad.a2?target=" + this.url_ + "&fqlist=" + this.fqlist + "&rnd=" + rnd__ + "><\/script>');";
    stru += "document.close();";
    this.sObj.setAttribute("src", stru);
    this.sObj.setAttribute("id", this.scriptId);
};
MNSR.prototype.RST = function () { this.bodyLoc.removeChild(this.sObj); };
MNSR.prototype.AST = function () { _frObj = this.bodyLoc.appendChild(this.sObj); };

var ieversion;
if (/MSIE (\d+\.\d+);/.test(n_.userAgent)) {
    ieversion = new Number(RegExp.$1);
}
function MNetCallBackFunction(returnstring) {
    if (returnstring != null && returnstring != "") {
        SrvCode = returnstring.replace('[timestamp]', DolRandom());
        if (IsIE && ieversion == 7) { mnet_.sObj.src = '#'; }
        mnet_.RST();
    }
}
function ApplyGeo() { mnet__ = new MNSR(Url); mnet__.BST(); mnet__.AST(); }
function ApplyFunction(dn, rs) { var rsp = eval(rs); if (typeof (rsp) != "undefined") { d_.getElementById(dn).innerHTML = rsp; } }
function ApplyHtml(dn, rs) { d_.getElementById(dn).innerHTML = rs; }
function ApplyScript() { /**/ }

function MNetBanner(div, gparam, isAgain) {
    if (gparam != null && gparam != "undefined" && isORq) // geo
    {
        var s = d_.createElement("script");
        s.setAttribute('type', 'text/javascript');
        var rs = 'document.write(\'<scr\'+\'ipt language=JavaScript src="' + BUrl + '/getad.a2?target=' + div + '&' + gparam + '&DOL_chache=' + rnd__ + '"><\/scri\' + \'pt>\');';
        s.text = rs;

        isORq = false;
        mn.isOrfad = false;
        d_.getElementById(div).appendChild(s);
        isORq = true;
        mn.isOrfad = true;
        GArr[GArr.length] = gparam;
    }
    else {
        if (!isORq) {
            d_.write('<scr' + 'ipt language=JavaScript src=' + BUrl + '/getad.a2?target=' + div + '&DOL_chache=' + rnd__ + '><\/scri' + 'pt>');
        }
        else {
            if (SrvCode != null) {
                var bancodes = SrvCode.split(String.fromCharCode(163));
                for (var i = 0; i < bancodes.length; i++) {
                    var bancode = bancodes[i].split("|", 12);
                    var campaignID = bancode[6];
                    var portalID = bancode[10];
                    var isCpa = bancode[11];
                    if (bancode[3] == div) {
                        if (d_.getElementById(div) != null) {
                            var contenttype = bancode[0].split("###", 2);
                            var tmp = _TargetCampaign != "" ? "," + bancode[2] + ";" + bancode[4] : bancode[2] + ";" + bancode[4]; //BT
                            _TargetCampaign = _TargetCampaign + tmp; //BT
                            switch (contenttype[1]) {
                                case "function": ApplyFunction(div, contenttype[0]); MNetViewed(bancode[4], bancode[2]); break;
                                case "geo": ApplyGeo(div, contenttype[0]); MNetViewed(bancode[4], bancode[2]); break;
                                case "html": ApplyHtml(div, contenttype[0]); MNetViewed(bancode[4], bancode[2]); break;
                                case "script": ApplyScript(div, contenttype[0]); MNetViewed(bancode[4], bancode[2]); break;
                            }
                            if (isCpa == "1") {
                                MNet_CpaViewed(campaignID, portalID);
                            }
                        }
                        //fq
                        var j = new fqobj(); j.tid = bancode[4]; j.ciid = bancode[2];
                        j.fqtype = bancode[7]; j.fqmaxvalue = bancode[8]; j.fqdate = new Date(bancode[9]);
                        if (bancode[7] == 1 || bancode[7] == 4)
                        { mnet_.UpdateFqList(j); }
                    }
                }
                if (isAgain != "Again") {
                    DArr[DArr.length] = div; GArr[GArr.length] = gparam;
                }
            }
            else {
                setTimeout("MNetBanner('" + div + "','" + gparam + "','" + isAgain + "');", 250);
            }
        }
    }
}

var __sentList = "";
function MNetViewed(tid, ciid) {
    if (__sentList.indexOf("-" + tid + "-") == -1) {
        __sentList = __sentList + ",-" + tid + "-";
        var rnd = DolRandom();
        var src = BUrl + "/impression.a2?tid=" + tid + "&ciid=" + ciid + "&rnd=" + rnd;
        var img = new Image(1, 1);
        img.src = src;
        img.onload = function () { _bos(); };
    }
}

function MNet_CpaViewed(cid, pid) {
    var rnd = DolRandom();
    var src = BUrl + "/cpa.a2?a=v&pid=" + pid + "&cid=" + cid + "&rnd=" + rnd;
    var img = new Image(1, 1);
    img.src = src;
    img.onload = function () { _bos(); };
}

function MNetReq(url) {
    if (isORq) {
        PageTag = url;
        GetBannerHtmlCode(url);
    }
}
function MNetBannerShow() { return; }
function GetBannerHtmlCode(url) { mnet_ = new MNSR(url); mnet_.BST(); mnet_.AST(); }
function GetBannersAgain() {
    __sentList = "";
    SrvCode = null;
    rnd__ = String(Math.random()).substr(2, 15);
    mnet_.sObj = d_.createElement("iframe");
    mnet_.sObj.frameBorder = 0; mnet_.sObj.left = -100; mnet_.sObj.top = -100; mnet_.sObj.width = 1; mnet_.sObj.height = 1;
    mnet_.sObj.setAttribute("name", rnd__);
    var fqlist = mnet_.GetFqList();
    var stru = "javascript:document.write('<script src=" + BUrl + "/orfad.a2?target=" + PageTag + "&fqlist=" + fqlist + "&rnd=" + rnd__ + "><\/script>');";
    stru += "document.close();";
    mnet_.sObj.setAttribute("src", stru);
    mnet_.sObj.setAttribute("id", rnd__);
    d_.body.appendChild(mnet_.sObj);
    for (var i = 0; i < DArr.length; i++) {
        eval("MNetBanner('" + DArr[i] + "','" + GArr[i] + "','Again')");
    }
}
// *********************************************************************
// *********************************************************************
//Ad.Js

var blnIsNS = (n_.appName.indexOf('Netscape') >= 0 && parseFloat(n_.appVersion) >= 4) ? true : false;
var blnIsIE = (d_.all) ? true : false;
var blnIsMac = (n_.appVersion.indexOf('Mac') != -1) ? true : false;
var id_counter = 0;
function DOLAD_popup(strUrl, intWidth, intHeight, intLeft, intTop) { DOLLcl_popWindow(strUrl, intWidth, intHeight, intLeft, intTop, true); return ""; }
function DOLAD_popunder(strUrl, intWidth, intHeight, intLeft, intTop) { DOLLcl_popWindow(strUrl, intWidth, intHeight, intLeft, intTop, false); return ""; }
function DOLLcl_popWindow(strUrl, intWidth, intHeight, intLeft, intTop, blnFocus) {
    var lclIntLeft = (intLeft == null || intLeft == 0) ? (screen.width - intWidth) / 2 : intLeft;
    var lclIntTop = (intTop == null || intTop == 0) ? (screen.height - intHeight) / 2 : intTop;
    var lclObjWin = window.open(strUrl, 'ekolay', 'toolbar=0,status=0,menubar=0,resizable=0,scrollbars=0,width=' + intWidth + 'px,height=' + intHeight + 'px,left=' + lclIntLeft + ',top=' + lclIntTop);
    if (!blnFocus) {
        lclObjWin.blur();
        self.focus();
    }
    return '';
}
function DOLAD_flash(strUrl, intWidth, intHeight, intTop, intLeft, strMode) {

    var lclStrMode = (strMode == null) ? "transparent" : strMode;
    var tmp = '';
    if (intTop == null) {
        tmp += ('<div style="position:relative;width:' + intWidth + 'px;height:' + intHeight + 'px;z-index:9;"><object style="position:relative;left:0px;top:0px;z-index:9;" border="0" height="' + intHeight + '" width="' + intWidth + '" align="top" id="Flash_' + strUrl + '"' +
		' codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"' +
		' height="' + intHeight + '" width="' + intWidth + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" >' +
		'<param name="movie" value="' + strUrl + '" />' +
		'<param name="allowscriptaccess" value="always" />' +
		'<param name="quality" value="high" />' +
		'<param name="wmode" value="' + lclStrMode + '" />' +
		'<embed ID="embedFlash_' + strUrl + '" ' +
		' src="' + strUrl + '"' +
		' quality="high" wmode="' + lclStrMode + '"' +
		' style="position:relative; z-index:9;"' +
		' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"' +
		' allowscriptaccess="always"' +
		' type="application/x-shockwave-flash" width="' + intWidth + '" height="' + intHeight + '"></embed>' +
		'</object></div>');
    }
    if (isORq)
        return tmp;
    else
        d_.write(tmp);
}

mn.Flash = function (strUrl, intWidth, intHeight, strNoFlash, strClick, strDestUrl, strMode) {
    var tmp = '';
    tmp = '<div style="position:relative;width:' + intWidth + 'px;height:' + intHeight + 'px;z-index:9">';
    if (mn.FlashSupport()) {
        var lclStrMode = (strMode == null) ? "transparent" : strMode;
        var flashSrc = strUrl + strClick + strDestUrl;
        tmp += '<object style="position:absolute;left:0px;top:0px;z-index:9;" border="0" height="' + intHeight + '" width="' + intWidth + '" align="top" id="Flash_' + flashSrc + '"';
        tmp += ' codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"';
        tmp += ' height="' + intHeight + '" width="' + intWidth + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" >';
        tmp += '<param name="movie" value="' + flashSrc + '" />';
        tmp += '<param name="quality" value="high" />';
        tmp += '<param name="allowscriptaccess" value="always" />';
        tmp += '<param name="wmode" value="' + lclStrMode + '" />';
        tmp += '<embed id="embedFlash_' + flashSrc + '" ';
        tmp += ' src="' + flashSrc + '"';
        tmp += ' quality="high" wmode="' + lclStrMode + '"';
        tmp += ' style="position:relative; z-index:9;"';
        tmp += ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
        tmp += ' allowscriptaccess="always"';
        tmp += ' type="application/x-shockwave-flash" width="' + intWidth + '" height="' + intHeight + '"></embed>';
        tmp += '</object>';
    }
    else {
        strClick = unescape(strClick) + escape(strDestUrl);
        tmp += '<a href="' + strClick + '" target="_blank"><img src="' + strNoFlash + '" alt="" style="border-style:none;"  width="' + intWidth + '" height="' + intHeight + '"/></a>';
    }
    tmp += '</div>';
    if (mn.isOrfad)
        return tmp;
    else {
        mn.d.write(tmp);
        return '';
    }
};

mn.Rollover = function (strUrl, intWidth, intHeight, strNoFlash, strClick, strDestUrl, intMinWidth, intMinHeight, strMode) {
    var tmpStr = '';
    if (mn.FlashSupport()) {
        var lclStrMode = (strMode == null) ? 'transparent' : strMode;
        var flashSrc = strUrl + strClick + strDestUrl;
        if (!mn.Browser.IsIE) { // not ie
            if (typeof intMinWidth == "undefined" || intMinWidth == null) return '';
            if (typeof intMinHeight == "undefined" || intMinHeight == null) return '';
            tmpStr = "<div onmouseout=this.style.width='" + String(intMinWidth) + "px';this.style.height='" + String(intMinHeight) + "px' onmouseover=this.style.width='" + String(intWidth) + "px';this.style.height='" + String(intHeight) + "px' style='width:" + String(intMinWidth) + "px;height:" + String(intMinHeight) + "px;position:absolute;overflow:hidden;z-index:999990'>";
            tmpStr += '<object style="z-index:999990;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + String(intWidth) + '" height="' + String(intHeight) + '">';
            tmpStr += '<param name="movie" value="' + flashSrc + '" />';
            tmpStr += '<param name="quality" value="high" />';
            tmpStr += '<param name="wmode" value="' + lclStrMode + '" />';
            tmpStr += '<param name="allowscriptaccess" value="always" />';
            tmpStr += '<embed style="position:relative;z-index:999990;"';
            tmpStr += ' src="' + flashSrc + '"';
            tmpStr += ' width="' + String(intWidth) + ' " height="' + String(intHeight) + '"';
            tmpStr += ' allowScriptAccess="always" allowFullScreen="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>';
            tmpStr += '</object></div>';
            tmpStr += '<div id="spacerForFF" style="width:' + String(intMinWidth) + 'px;height:' + String(intMinHeight) + 'px;z-index:0;"></div>';
        }
        else { // for ie
            var position = '';
            tmpStr = '<div id="____divRollContAd" style="position:relative;top:0px;width:' + intWidth + 'px;z-index:999990">';
            tmpStr += '<object onmouseover="try{DOLBNR_hide();} catch(e) {}" onmouseout="try{DOLBNR_show();} catch(e) {}"';
            tmpStr += ' style="position:absolute;left:0px;top:0px;z-index:999990;"';
            tmpStr += ' codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"';
            tmpStr += ' width="' + intWidth + '" height="' + intHeight + '"';
            tmpStr += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';
            tmpStr += '<param name="movie" value="' + flashSrc + '" />';
            tmpStr += '<param name="quality" value="high" />';
            tmpStr += '<param name="wmode" value="' + lclStrMode + '" />';
            tmpStr += '<param name="allowscriptaccess" value="always" />';
            tmpStr += '<embed src="' + flashSrc + '"';
            tmpStr += ' quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"';
            tmpStr += ' type="application/x-shockwave-flash"';
            tmpStr += ' style="position:relative; z-index:999990;' + position + '"';
            tmpStr += ' wmode="' + lclStrMode + '"';
            tmpStr += ' width="' + intWidth + '" height="' + intHeight + '"';
            tmpStr += ' allowscriptaccess="always"></embed>';
            tmpStr += '</object></div>';
            tmpStr += '<div id="spacerForIE" style="width:' + String(intMinWidth) + 'px;height:' + String(intMinHeight) + 'px;z-index:0;"></div>';
        }
    }
    else {
        strClick = unescape(strClick) + escape(strDestUrl);
        tmpStr += '<a href="' + strClick + '" target="_blank"><img src="' + strNoFlash + '" alt="" style="border-style:none;"  width="' + intMinWidth + '" height="' + intMinHeight + '"/></a>';
    }
    if (mn.isOrfad)
        return tmpStr;
    else {
        mn.d.write(tmpStr);
        return '';
    }    
};

mn.FloatingBanner = function (strUrl, intWidth, intHeight, strNoFlash, strClick, strDestUrl, intLeft, intTop) {

    if (mn.d.body == null) {
        setTimeout("mn.FloatingBanner('" + strUrl + "'," + intWidth + "," + intHeight + ",'" + strNoFlash + "','" + strClick + "','" + strDestUrl + "'," + intLeft + "," + intTop + ");", 1000);
        return '';
    }

    var ClosingTime = 8000;
    if ((typeof FloatingBannerClosingTime) != 'undefined') {
        ClosingTime = FloatingBannerClosingTime; // FloatingBannerClosingTime is coming adv. code
    }

    var clientWidth, clientHeight;
    if (mn.n.appName == "Netscape") {
        clientWidth = mn.d.body.clientWidth;
        clientHeight = mn.w.innerHeight;
    } else {
        clientWidth = mn.d.body.clientWidth;
        clientHeight = mn.d.body.clientHeight;
    }

    var lclIntX = (intLeft == null) ? 0 : intLeft;
    var lclIntY = (intTop == null) ? 0 : intTop;

    if (clientWidth < 770) clientWidth = 792;
    if (clientHeight < 750) clientHeight = 750;
    var positionLeft = (lclIntX == 0) ? (clientWidth / 2) - (intWidth / 2) : lclIntX;
    var positionTop = (lclIntY == 0) ? (clientHeight / 2) - (intHeight / 2) : lclIntY;
    var tmp = '<div id="' + mn.FloatingBannerID + '" style="position:absolute; z-index:2147483647; border:solid 1px #808080; text-align:center;';
    tmp += ' width:' + intWidth + 'px; height:' + intHeight + 'px;';
    tmp += ' left:' + positionLeft + 'px; top:' + positionTop + 'px;">';
    tmp += '<div style="position:absolute; text-align:right; width:' + intWidth + 'px; margin-top:-11px; left:16px;">';
    tmp += '<img src="http://ad.e-kolay.net/floating/close.png" alt="Kapat" title="Kapat" style="cursor:pointer;" onclick="mn.CloseBanner(mn.FloatingBannerID);" />';
    tmp += '</div>';
    if (mn.FlashSupport()) {
        var flashSrc = strUrl + strClick + strDestUrl;
        tmp += '<object id="mdnFloatingFlash" width="' + intWidth + '" height="' + intHeight + '"';
        tmp += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">';
        tmp += '<param name="movie" value="' + flashSrc + '" />';
        tmp += '<param name="wmode" value="transparent" />';
        tmp += '<param name="quality" value="high" />';
        tmp += '<param name="bgcolor" value="" />';
        tmp += '<param name="scale" value="noborder" />';
        tmp += '<param name="allowscriptaccess" value="always" />';
        tmp += '<embed id="floatingEmbed" src="' + flashSrc + '" quality="high" allowscriptaccess="always" wmode="transparent" scale="noborder"';
        tmp += ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"';
        tmp += ' width="' + intWidth + '" height="' + intHeight + '"></embed>';
        tmp += '</object>';
    }
    else {
        strClick = unescape(strClick) + escape(strDestUrl);
        tmp += '<a href="' + strClick + '" target="_blank"><img src="' + strNoFlash + '" alt="" style="border-style:none;"  width="' + intWidth + '" height="' + intHeight + '"/></a>';
    }
    tmp += '</div>';
    setTimeout("mn.CloseBanner(mn.FloatingBannerID)", ClosingTime);
    if (mn.isOrfad)
        return tmp;
    else {
        mn.d.write(tmp);
        return '';
    }    
};

function DOLAD_rollover(strUrl, intWidth, intHeight, clickUrl, rawClickUrl, strMode, intMinWidth, intMinHeight) {
    var lclStrMode = (strMode == null) ? "transparent" : strMode;
    var tempStrUrl = (rawClickUrl != "http://") ? strUrl + clickUrl : strUrl;
    strUrl = tempStrUrl;
    if (n_.appName.toLowerCase().indexOf('explorer') < 0) {
        if (typeof intMinWidth == "undefined" || intMinWidth == null) return "";
        if (typeof intMinHeight == "undefined" || intMinHeight == null) return "";
        var arrHtml = [];
        arrHtml.push("<div onmouseout=this.style.width='" + String(intMinWidth) + "px';this.style.height='" + String(intMinHeight) + "px' onmouseover=this.style.width='" + String(intWidth) + "px';this.style.height='" + String(intHeight) + "px' style='width:" + String(intMinWidth) + "px;height:" + String(intMinHeight) + "px;position:absolute;overflow:hidden;z-index:999990;'>");
        arrHtml.push('<object style="z-index:999990;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + String(intWidth) + '" height="' + String(intHeight) + '">');
        arrHtml.push('<param name="movie" value="' + strUrl + '" />');
        arrHtml.push('<param name="quality" value="high" />');
        arrHtml.push('<param name="wmode" value="' + lclStrMode + '" />');
        arrHtml.push('<param name="allowscriptaccess" value="always" />');
        arrHtml.push('<embed style="position:relative;z-index:999990;" src="' + strUrl + '" width="' + String(intWidth) + '" height="' + String(intHeight) + '" allowscriptaccess="always" allowfullscreen="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
        arrHtml.push("</object></div>");
        arrHtml.push("<div id='spacerForFF' style='width:" + String(intMinWidth) + "px;height:" + String(intMinHeight) + "px;z-index:0;'></div>");
        var outPut = arrHtml.join('');
        if (isORq)
            return outPut;
        else
            d_.write(arrHtml.join(''));
    }
    else {
        var position = ""; //(blnIsIE) ? '' : 'left:' + lyr.PageX + ';top:' + lyr.PageY;
        var tmp;
        tmp = '' +
            '<div id="____divRollContAd" style="position:relative; top:0px; width:' + intWidth + 'px; z-index:999990">' +
                '<object onmouseover="try{DOLBNR_hide();} catch(e) {}" onmouseout="try{DOLBNR_show();} catch(e) {}"' +
                    ' style="position:absolute;left:0px;top:0px;z-index:999990;"' +
                        ' codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"' +
                            ' width="' + intWidth + '" height="' + intHeight + '"' +
                                ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">' +
                                    '<param name="movie" value="' + strUrl + '" />' +
                                        '<param name="quality" value="high" />' +
                                            '<param name="wmode" value="' + lclStrMode + '" />' +
                                                '<param name="allowscriptaccess" value="always" />' +
                                                    '<embed' +
                                                        ' src="' + strUrl + '"' +
                                                            ' quality="high"' +
                                                                ' allowscriptaccess="always"' +
                                                                    ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"' +
                                                                        ' type="application/x-shockwave-flash"' +
                                                                            ' style="position:relative; z-index:999990; ' + position + '"' +
                                                                                ' wmode="' + lclStrMode + '"' +
                                                                                    ' width="' + intWidth + '" height="' + intHeight + '"' +
                                                                                        '></embed>' +
                                                                                            '</object></div>' +
                                                                                                '<div id="spacerForIE" style="width:' + String(intMinWidth) + 'px;height:' + String(intMinHeight) + 'px;z-index:0;"></div>';
        if (isORq)
            return tmp;
        else
            d_.write(tmp);
    }
    return "";
}
function DOLAD_img(strHtml) { if (isORq) { return strHtml; } else { d_.write(strHtml); } }
function DOLAD_HTML(strHtml) { if (isORq) { return strHtml; } else { d_.write(strHtml); } }
function ge(id) { return d_.getElementById ? d_.getElementById(id) : d_.all(id); }

function DOLAD_floating(strUrl, clickUrl, intWidth, intHeight, intLeft, intTop) {
    if (n_.appName.toLowerCase().indexOf('explorer') > 0) {
        var clientWidth, clientHeight;

        if (n_.appName == "Netscape") {
            clientWidth = d_.body.clientWidth;
            clientHeight = window.innerHeight;
        } else {
            clientWidth = d_.body.clientWidth;
            clientHeight = d_.body.clientHeight;
        }

        var lclIntX = (intLeft == null) ? 0 : intLeft;
        var lclIntY = (intTop == null) ? 0 : intTop;
        //var rnd=Math.ceil(Math.random()*99999999);

        if (clientWidth < 770) clientWidth = 792;
        var positionLeft = (lclIntX == 0) ? (clientWidth / 2) - (intWidth / 2) : lclIntX;
        var positionTop = (lclIntY == 0) ? (clientHeight / 2) - (intHeight / 2) : lclIntY;
        positionTop = Math.round(positionTop);
        positionLeft = Math.round(positionLeft);
        positionLeft = positionLeft - 8;
        var tmp = '<div id="floatingDiv' + rnd__ + '" ' +
            ' style="position: absolute;text-align:center; width:' + intWidth + 'px; height:' + intHeight + 'px; z-index:2147483647;left:' + positionLeft + 'px;top:' + positionTop + 'px;"> ' +
                ' <object id="flashobj' + rnd__ + '" style="z-index:2147483647;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
                    ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ' +
                        ' width="' + intWidth + '" height="' + intHeight + '" align="middle"> ' +
                            '    <param name="movie" value="' + strUrl + clickUrl + '" />' +
                                '    <param name="quality" value="high" />' +
                                    '    <param name="BGCOLOR" value="" />' +
                                        '    <param name="scale" value="noborder" />' +
                                            '    <param name="wmode" value="transparent" />' +
                                                '    <param name="allowscriptaccess" value="always" />' +
                                                    '    <embed id="floatingEmbed' + rnd__ + '" src="' + strUrl + clickUrl + '" quality="high" wmode="transparent" allowscriptaccess="always" z-index="2147483647" scale="noborder" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ' +
                                                        ' width="' + intWidth + '" height="' + intHeight + '" align="absmiddle"> ' +
                                                            '    </embed></object>' +
                                                                '  </div> ';

        if (isORq)
            return tmp;
        else
            d_.write(tmp);
    }
}
function closeFloatingDiv() { ge('floatingDiv' + rnd__).style.visibility = 'hidden'; }
function DOLAD_RePos() { }
function getCookie(strName) {
    var arrCookie = d_.cookie.split(";");
    for (var i = 0; i < arrCookie.length; i++) {
        var cookie = arrCookie[i].split("=");
        while (cookie[0].indexOf(" ") == 0) cookie[0] = cookie[0].substr(1);
        if (strName == cookie[0]) return unescape(cookie[1]);
    }
    return "";
}
function createCookie(name, value, days) {
    var expires = "";
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        expires = "; expires=" + date.toGMTString();
    }
    d_.cookie = name + "=" + value + expires + ";";
}
function setCookie(strName, strValue) { d_.cookie = strName + "=" + escape(strValue); }

function flashCookie(cookiename) {
    var getCookieObj = document.getElementById(cookiename);
    var cookieValue = getCookie(cookiename);
    if (getCookieObj == null)
        setTimeout("flashCookie('" + cookiename + "');", 200);
    else
        getCookieObj.SetVariable('_root.cookieValue', cookieValue);
}

function DolRandom() {
    return String(Math.random()).substr(2, 10);
}


///////// FLOATING /////////////////////


function CloseFloatingBanner() {
    ge("mdnFloating").style.visibility = "hidden";
}

function FloatingBanner(strUrl, clickUrl, intWidth, intHeight, intLeft, intTop) {
    
    if (d_.body == null) {
        setTimeout("FloatingBanner('" + strUrl + "','" + clickUrl + "'," + intWidth + "," + intHeight + "," + intLeft + "," + intTop + ");", 1000);
        return false;
    }

    var ClosingTime = 8000;

    if ((typeof FloatingBannerClosingTime) != 'undefined') {
        ClosingTime = FloatingBannerClosingTime;
    }
    
    var clientWidth, clientHeight;
    if (n_.appName == "Netscape") {
        clientWidth = document.body.clientWidth;
        clientHeight = window.innerHeight;
    } else {
        clientWidth = document.body.clientWidth;
        clientHeight = document.body.clientHeight;
    }

    var lclIntX = (intLeft == null) ? 0 : intLeft;
    var lclIntY = (intTop == null) ? 0 : intTop;

    if (clientWidth < 770) clientWidth = 792;
    if (clientHeight < 750) clientHeight = 750;
    var positionLeft = (lclIntX == 0) ? (clientWidth / 2) - (intWidth / 2) : lclIntX;
    var positionTop = (lclIntY == 0) ? (clientHeight / 2) - (intHeight / 2) : lclIntY;

    var tmp = '<div id="mdnFloating" ' +
    'style="position:absolute; z-index:2147483647; border:solid 1px #808080; width:' + intWidth + 'px; height:' + intHeight + 'px; text-align:center; left:' + positionLeft + 'px; top:' + positionTop + 'px;">' +
    ' <div style="position:absolute; text-align:right; width:' + intWidth + 'px; margin-top:-11px; left:16px;">' +
    '    <img src="http://ad.e-kolay.net/floating/close.png" alt="Kapat" title="Kapat" style="cursor:pointer;" onclick="CloseFloatingBanner();" />' +
    ' </div>' +
    ' <object id="mdnFloatingFlash" width="' + intWidth + '" height="' + intHeight + '"' +
    '     classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"> ' +
    '    <param name="movie" value="' + strUrl + clickUrl + '"> ' +
    '    <param name="wmode" value="transparent"> ' +
    '    <param name="quality" value="high"> ' +
    '    <param name="bgcolor" value=""> ' +
    '    <param name="scale" value="noborder"> ' +
    '    <param name="allowscriptaccess" value="always"> ' +
    '    <embed id="floatingEmbed" src="' + strUrl + clickUrl + '" quality="high" allowscriptaccess="always" wmode="transparent" scale="noborder" ' +
    '        pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ' +
    '        width="' + intWidth + '" height="' + intHeight + '"></embed> ' +
    ' </object> ' +
    '</div>';
    setTimeout("CloseFloatingBanner()", ClosingTime);
    if (isORq) {
        return tmp;
    } else {
        document.write(tmp);
    }
}

function FloatingBannerHTML(htmlCode, intWidth, intHeight, intLeft, intTop) {

    if (d_.body == null) {
        setTimeout("FloatingBannerHTML('" + htmlCode + "','" + intWidth + "," + intHeight + "," + intLeft + "," + intTop + ");", 1000);
        return false;
    }

    var ClosingTime = 8000;
    if ((typeof FloatingBannerClosingTime) != 'undefined') {
        ClosingTime = FloatingBannerClosingTime;
    }
    
    var clientWidth, clientHeight;
    if (n_.appName == "Netscape") {
        clientWidth = document.body.clientWidth;
        clientHeight = window.innerHeight;
    } else {
        clientWidth = document.body.clientWidth;
        clientHeight = document.body.clientHeight;
    }

    var lclIntX = (intLeft == null) ? 0 : intLeft;
    var lclIntY = (intTop == null) ? 0 : intTop;

    if (clientWidth < 770) clientWidth = 792;
    if (clientHeight < 750) clientHeight = 750;
    var positionLeft = (lclIntX == 0) ? (clientWidth / 2) - (intWidth / 2) : lclIntX;
    var positionTop = (lclIntY == 0) ? (clientHeight / 2) - (intHeight / 2) : lclIntY;

    var tmp = '<div id="mdnFloating" ' +
    'style="position:absolute; z-index:2147483647; border:solid 1px #808080; width:' + intWidth + 'px; height:' + intHeight + 'px; text-align:center; left:' + positionLeft + 'px; top:' + positionTop + 'px;">' +
    ' <div style="position:absolute; text-align:right; width:' + intWidth + 'px; margin-top:-11px; left:16px;">' +
    '    <img src="http://ad.e-kolay.net/floating/close.png" alt="Kapat" title="Kapat" style="cursor:pointer;" onclick="CloseFloatingBanner();" />' +
    ' </div><iframe src="' + htmlCode + '" frameborder="0" scrolling="no" height="' + intHeight + '" width="' + intWidth + '"  </iframe>' +
    '</div>';
    setTimeout("CloseFloatingBanner()", ClosingTime);
    if (isORq) {
        return tmp;
    } else {
        document.write(tmp);
    }
}

function mn_DetectDoctype() {
    var re = /\s+(X?HTML)\s+([\d\.]+)\s*([^\/]+)*\//gi; var res = false;
    if (document.doctype != null) { res = re.test(document.doctype.publicId); } else if (typeof document.namespaces != "undefined") { res = document.all[0].nodeType == 8 ? re.test(document.all[0].nodeValue) : false; } else { res = false; }
    if (res) { res = new Object(); res['xhtml'] = RegExp.$1; res['version'] = RegExp.$2; res['importance'] = RegExp.$3; return res; }
    else { return null; }
}

function mn_AddLoadEvent(func) { var oldEvent = window.onload; window.onload = (typeof window.onload != 'function') ? func : function () { oldEvent(); func(); }; }
function mn_AddBeforeUnLoad(func) { var oldEvent = window.beforeunload; window.onload = (typeof window.beforeunload != 'function') ? func : function () { oldEvent(); func(); }; }
function mn_AddOnUnLoad(func) { var oldEvent = window.onunload; window.onunload = (typeof window.onunload != 'function') ? func : function () { oldEvent(); func(); }; }

function DOL_IFrame(src, width, height) {
    var random = DolRandom();
    src = src.replace("[timestamp]", random);
    var id = "iframe_" + random;

    if (isORq) {
        return "<iframe src='" + src + "' name='" + id + "' id='" + id + "' width='" + width + "' height='" + height + "'  border='0' frameborder='0' scrolling='no'  marginwidth='0' marginheight='0' style='z-index:9;'></iframe>";
    } else {
        document.write("<iframe name='" + id + "' id='" + id + "' width='" + width + "' height='" + height + "'  border='0' frameborder='0' scrolling='no'  marginwidth='0' marginheight='0' style='z-index:9;'></iframe>");
        setTimeout("document.getElementById('" + id + "').src=''", 100);
        setTimeout("document.getElementById('" + id + "').src='" + src + "'", 500);
    }
}

function DOL_MakeRequestImg(url) {
    if (url != null && url.length > 0) {
        var trackImg = document.createElement("img");
        trackImg.style.display = 'none';
        url = url.indexOf('?') > -1 ? url + '&rnd=' + DolRandom() : url + '?rnd=' + DolRandom();
        trackImg.src = url;
        d_.body.appendChild(trackImg);
    }
}
function AdBePShow(width, height, duration, flashUrl, clickUrl) {
    var divAd = document.getElementById("Medyanet-AdBeP");
    var divPlayer = document.getElementById("Medyanet-ClientPlayer");

    divPlayer.style.display = 'none';
    divAd.style.display = 'block';

    var code = '' +
    '<div id="Outer" style="height:' + divAd.style.height + '; text-align:center; width:' + divAd.style.width + '; display:table-cell; vertical-align:middle; z-index:2147483646;">' +
        '<div style="border:solid 1px #808080; width:' + width + 'px; margin:auto; ">' +
            '<div style="width:' + width + 'px; text-align:right; position:absolute; z-index:2147483646;">' +
                '<img style="margin-top:-13px; right:-16px; cursor:pointer; position:absolute;" src="http://ad.e-kolay.net/floating/close.png" alt="Kapat" title="Kapat" onclick="AdBePClose();" />' +
            '</div>' +
            '<object width="' + width + '" height="' + height + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
                ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0">' +
                '<param name="movie" value="' + flashUrl + '?clickTAG=' + clickUrl + '" />' +
                '<param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="scale" value="noborder" /><param name="allowscriptaccess" value="always" />' +
                '<embed id="embed" src="' + flashUrl + '?clickTAG=' + clickUrl + '" quality="high" allowscriptaccess="always" ' +
                    'wmode="transparent" scale="noborder" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" ' +
                    'width="' + width + '" height="' + height + '"></embed>' +
            '</object>' +
        '</div>' +
    '</div>';
    divAd.innerHTML = code;
    if (duration != "0") { setTimeout("AdBePClose();", duration * 1000); }
    if (isORq) {
        return "";
    }
    else {
        document.write("");
    }
}
function AdBePClose() {
    var divAd = document.getElementById("Medyanet-AdBeP");
    var divPlayer = document.getElementById("Medyanet-ClientPlayer");

    divPlayer.style.display = 'block';
    divAd.style.display = 'none';
}
function mn_LoadJs(filePath) {
    if (filePath != null && filePath.length > 3) {
        try {
            var jsf = document.createElement('script');
            jsf.type = 'text/javascript';
            jsf.src = filePath;
            jsf.id = filePath;
            jsf.async = true;
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(jsf);
        } catch (e) { }
    }
}
function DOL_PageSkinLoad(targetName) {
    var dolRandom = String(Math.random()).substr(2, 10);
    mn_LoadJs(http + 'ad.e-kolay.net/getxml.a2?target=' + targetName + '&rnd=' + dolRandom);
    mn_LoadJs(http + 'ad.e-kolay.net/pageskin/mn_pageskin.js?v=1.82');
    setTimeout(function () { mn_PageSkinLoad(psp.w, psp.c, psp.p, psp.bi, psp.t, psp.bg, psp.st); }, 700);
}

mn_LoadJs(_btsrc);

