﻿var isRollOver = false; var id_counter = 0; var _TargetCampaign = "";
var d_ = document;
var blnIsNS = (navigator.appName.indexOf('Netscape') >= 0 && parseFloat(navigator.appVersion) >= 4) ? true : false;
var blnIsIE = (document.all) ? true : false; var blnIsMac = (navigator.appVersion.indexOf('Mac') != -1) ? true : false;
function DOLAD_popup(strUrl, intWidth, intHeight, intLeft, intTop)
{ DOLLcl_popWindow(strUrl, intWidth, intHeight, intLeft, intTop, true); }
function DOLAD_popunder(strUrl, intWidth, intHeight, intLeft, intTop)
{ DOLLcl_popWindow(strUrl, intWidth, intHeight, intLeft, intTop, false); }
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();
    }
}
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:absolute;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="quality" value="high" />' +
		'<param name="allowscriptaccess" value="always" />' +
		'<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>');
    }
    document.write(tmp);
}
function DOLAD_rollover(strUrl, intWidth, intHeight, clickUrl, rawClickUrl, strMode, intMinWidth, intMinHeight) {
    isRollOver = true;
    var lclStrMode = (strMode == null) ? "transparent" : strMode;
    var tempStrUrl = (rawClickUrl != "http://") ? strUrl + clickUrl : strUrl;
    strUrl = tempStrUrl;
    var lclStrBnrId = "Bnr_" + (id_counter++)
    document.write("<div id='" + lclStrBnrId + "'></div>");

    if (window.navigator.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>");
        document.write(arrHTML.join(''));
        document.write("<div id='spacerForFF' style='width:" + String(intMinWidth) + "px;height:" + String(intMinHeight) + "px;z-index:0;'></div>");
    }
    else {
        var lyr = document.getElementById(lclStrBnrId);
        var position = ""; //(blnIsIE) ? '' : 'left:' + lyr.PageX + ';top:' + lyr.PageY;
        var tmp;
        tmp = '' +
		'<div id="____divRollCont" 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"' +
		' 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 + '"' +
		' allowscriptaccess="always"' +
		'></embed>' +
		'</object></div>' +
		'<div id="spacerForIE" style="width:' + String(intMinWidth) + 'px;height:' + String(intMinHeight) + 'px;z-index:0;"></div>';
        document.write(tmp);
    }
}
function DOLAD_img(strHTML) { document.write(strHTML); }
function DOLAD_HTML(strHTML) { document.write(strHTML); }
function ge(id) { return d_.getElementById ? d_.getElementById(id) : d_.all(id); }
function DOLAD_floating(strURL, clickURL, intWidth, intHeight, intLeft, intTop) {
    if (window.navigator.appName.toLowerCase().indexOf('explorer') > 0) {
        var clientWidth, clientHeight;
        if (navigator.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;

        var tmp = '' +
		'<div id="floatingDiv' + rnd + '" ' +
		' align="center" style="position: absolute; 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" allowscriptaccess="always" wmode="transparent" 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> ' +
		'<script language="javascript"> ' +
		'window.floatingDiv' + rnd + '.style.left=' + positionLeft + '; ' +
		'window.floatingDiv' + rnd + '.style.top=' + positionTop + '; ' +
		'</script> ' +
		'<script language="javascript"> ' +
		'function closeFloatingDiv(){ge("floatingDiv' + rnd + '")' +
		'.style.visibility = "hidden"}' +
		'</script> ';
        document.write(tmp);
    }
}


function DOLAD_RePos() { }
function getCookie(strName) {
    var arrCookie = document.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 DOL_createcookie(name, value, days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else var expires = "";
    document.cookie = name + "=" + value + expires + "; path=ad.e-kolay.net";
}
function setCookie(strName, strValue) { document.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);
}

var IsTekSayarLoaded = false;
var scripts = document.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
    script = scripts[i];
    if (script.getAttribute("src") != null && script.getAttribute("src").lastIndexOf("teksay.js") > -1)
        IsTekSayarLoaded = true;
}
if (!IsTekSayarLoaded) {

}

function DolRandom() {
    return String(Math.random()).substr(2, 10);
}

//function getCookie__(strName) {
//    var arrCookie = document.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 setCookie__(strName, strValue){document.cookie = strName + "=" + escape(strValue);}
//function CheckCookie() {
//    var returnobj = false;	        
//    setCookie__("__cookTest","medyanet");
//    var objcook = getCookie__("__cookTest");
//    if(objcook!=null && objcook!="") returnobj = true;    
//    return returnobj;	
//}
///////// 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 clientWidth, clientHeight;
    if (navigator.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()", 7000);
    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 clientWidth, clientHeight;
    if (navigator.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()", 7000);
    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 oldOnLoad = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = function () { func(); }
    }
    else {
        window.onload = function () { oldOnLoad(); func(); }
    }
}

function DOL_IFrame(src, width, height) {
    var random = DolRandom();
    src = src.replace("[timestamp]", random);
    if (navigator.userAgent.toLowerCase().indexOf("firefox") > -1) {
        var id = "iframe_" + src;
        document.write("<iframe src='' 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='" + src + "'", 300);
    }
    else {
        document.write("<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>");
    }
}

function DOL_MakeRequestImg(url) {
    if (url != null && url.length > 0) {
        var trackImg = document.createElement("img");
        trackImg.style.display = 'none';
        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);
    }
}
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;
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(jsf);
        } catch (e) { }
    }
}
function DOL_PageSkinLoad(targetName) {
    var DOL_Random = String(Math.random()).substr(2, 10);
    mn_LoadJs('http://ad.e-kolay.net/getxml.a2?target=' + targetName + '&rnd=' + DOL_Random);
    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);
}

document.write('<sc' + 'ript src=\"http://ad.e-kolay.net/BT__.js?v=1.6\"></s' + 'cript>');
