﻿var ___script=null;
var UArr = new Array(); var DArr = new Array();var GArr = new Array(); var _frObj,SrvCode=null,mnet_=null,mnet__=null;
var isORq = true;var rnd__=String(Math.random()).substr(2,15);var d_=document;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 fqarr = new Array();
	var isc = false;
	var cname = f__.fqtype == 1 ? "fqsession": "fqcookie";
	var fqcookie = new String(getCookie(cname));
	var fqarr__ = fqcookie.split(",");
	for(_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(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.fqlist = this.GetFqList();
//    var stru__ = "javascript:document.write(\'<script src="+BUrl+"/orfad.a2?target=" + this.url_ +"&fqlist="+this.fqlist+"&rnd="+ rnd__ + "><\/script>\');"
//    document.write("<script defer='defer' src="+BUrl+"/orfad.a2?target=" + this.url_ +"&fqlist="+this.fqlist+"&rnd="+ rnd__ + "><\/script>");

    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(navigator.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(divname__, returnstring__){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(dn__, rs__)
{/**/}

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;
        d_.getElementById(div).appendChild(s__);
        isORq = true;
        //MNetViewed("-1", "-1");
        GArr[GArr.length] = gparam;
    }
    else
    {
        if (!isORq) {
            d_.write('<scr' + 'ipt language=JavaScript src=' + BUrl + '/getad.a2?target=' + div + '&DOL_chache=' + rnd__ + '><\/scri' + 'pt>');
            //MNetViewed(div, "-2");
        }
        else {
            if (SrvCode != null) {
                var bancodes = new Array(); bancodes = SrvCode.split(String.fromCharCode(163));
                for (i = 0; i < bancodes.length; i++) {
                    var bancode = new Array(); 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 = new Array(); 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 (navigator.userAgent.toLowerCase().indexOf("safari") != -1) {
        isORq = false;        
    }
    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();
    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__);
    var a__ = d_.body.appendChild(mnet_.sObj);
    
    for(i=0;i<DArr.length;i++)
    {
        eval("MNetBanner('"+DArr[i]+"','"+GArr[i]+"','Again')");
    }
}
// *********************************************************************
// *********************************************************************
//Ad.Js

var blnIsNS = (navigator.appName.indexOf('Netscape') >= 0 && parseFloat(navigator.appVersion) >= 4) ? true : false;
var blnIsIE = (d_.all) ? true : false;
var blnIsMac= (navigator.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 = '';
	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="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"'+
		' type="application/x-shockwave-flash" width="'+intWidth+'" height="'+intHeight+'"></embed>'+
		'</OBJECT></div>');
		if(intTop!=null) {
			tmp = '';
		}
		
if(isORq)
	return tmp;
else
	d_.write(tmp);
}

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 (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('<embed style="position:relative;z-index:999990;" src="'+strUrl+'" width="'+String(intWidth)+'" height="'+String(intHeight)+'" allowScriptAccess="sameDomain" allowFullScreen="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
		arrHTML.push("</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 lclStrBnrId = "Bnr_"+(id_counter++)
 	//d_.write("<div id='"+lclStrBnrId+"'></div>");
 	//var lyr = d_.getElementById(lclStrBnrId);
 	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+'">'+
	'<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+'"'+
	'></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);
	}
}
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, isCenter)
{
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;
	positionTop = Math.round(positionTop);
	positionLeft = Math.round(positionLeft);
	
	    
	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)
{
    if (days)
    {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
        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);
}

document.write('<sc'+'ript src=\"http://ad.e-kolay.net/BT__.js?v=1.5\"></s'+'cript>');

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 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" width="' + intWidth + '" height="' + intHeight + '" ' +
    '     pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed> ' +	
	' </object> ' +
	'</div>';

    setTimeout("CloseFloatingBanner()", 7000);

    if (isORq) {
        return tmp;
    } else {
        document.write(tmp);
    }
}