﻿var _d=document,_w=window,_n=navigator;
var ie=_d.all?true:false,_isIE = _n.appName.toLowerCase().indexOf('explorer')>=0;
var ie=_d.all?true:false,_isSecure=_d.location.protocol=="https:";
var _rpdom=(_isSecure?"https:":"http:")+"//ad.reklamport.com/",_redurl=_rpdom+"rpclk2.ashx";
var _stickyid="",rpCloseSeconds=8,rpfl=false,rpgoto=null,_templates=[],_vcid,_vtid,rptrscs=0;
setInterval("rptrscs++",250);

_templates["img"]="<a href='{0}?c={1}&t={2}&URL={3}' target='_blank' id='rpCont{1}.{2}'><img src='{4}' border=0 width='{5}' height='{6}' alt='TIKLAYIN'></a>";
_templates["swf"]="<div style=\'position:relative;width:{1}px;height:{2}px;z-index:{6}\' id=\'rpCont{4}.{5}\'>"+
"<object style=\'position:relative;padding:0;left:0px;top:0px;z-index:{6};\'"+
"	height=\'{2}px\' width=\'{1}px\' align=\'top\' id=\'rpCont{4}.{5}Flash\'"+
"	codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\'"+
"	classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\'>"+
"	<param name=\'movie\' value=\'{0}'>"+
"	<param name=\'quality\' value=\'high\'>"+
"	<param name=\'menu\' value=\'false\'>"+
"	<param name=\'wmode\' value=\'{3}\'>"+
"	<param name=\'allowscriptaccess\' value=\'always\'>"+
"	<embed id=\'rpCont{4}.{5}FlashEmbed\' src=\'{0}\' quality=\'high\' menu=\'false\' wmode=\'{3}\'"+
"	pluginspage=\'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\'"+
"	type=\'application/x-shockwave-flash\' width=\'{1}\' height=\'{2}\'></embed>"+
"</object></div>";
_templates["rollover"] = 
"<div id=\'rpCont{6}.{7}\' "+
"onmouseout=this.style.width=\'{0}px\';this.style.height=\'{1}px\' "+
"onmouseover=this.style.width=\'{0}px\';this.style.height=\'{3}px\' "+
"style=\'width:{0}px;height:{3}px;position:absolute;overflow:hidden;z-index:{4}\'>"+
"<object id=\'rpCont{6}.{7}Flash\' style=\'z-index:{4};\' classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' "+
"codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\' "+
"width={0} height={3}>"+
"<param name=\'movie\' value=\'{2}\' />"+
"<param name=\'quality\' value=\'high\' />"+
"<param name=\'wmode\' value=\'{5}\' />"+
"<embed id=\'rpCont{6}.{7}FlashEmbed\' style=\'position:relative;z-index:{4};\' "+
"src=\'{2}\' "+
"width={0} height={3} "+
"allowScriptAccess=\'sameDomain\' "+
"allowFullScreen=\'false\' quality=\'high\' pluginspage=\'http://www.macromedia.com/go/getflashplayer\' "+
"type=\'application/x-shockwave-flash\' "+
"wmode=\'{5}\'></embed></div>"+
"<div id=\'spacerForFF\' style=\'width:{0}px;height:{1}px;z-index:{4};\'></div>"
_templates["vid"]="<div style=\'position:relative;width:{0}px;height:{1}px;z-index:{9}\' id=\'rpCont{2}.{3}\'> "+
	"<object codebase=\'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\' width=\'{0}\' height=\'{1}\' id=\'rpCont{2}.{3}Flash\' classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' >"+
	"<param name=\'allowScriptAccess\' value=\'always\' /> "+
	"<param name=\'movie\' value=\'{7}img/rplayer.swf\' /> "+
	"<param name=\'allowFullScreen\' value=\'true\' /> "+
	"<param name=\'FlashVars\' value=\'movie={4}&cid={2}&tid={3}&title={8}&clickurl={5}%3Fc%3D{2}%26t%3D{3}%26URL%3D{6}\' /> </object>"+
	"</div>";
_templates["bg"]="<div align='left' id='divSticky{4}' name='divSticky' style='position:absolute;top:0;left:{3}px;width:{1}px;height:{2};visibility:visible'>"+
"<a href='{0}' title='TIKLAYIN!' target='_blank' style='display:block;width:{1}px;height:{2};'><img border='0' src='"+_rpdom+"img/e.gif' width='{1}px' height='{2}'/></a></div>";
function rpget(id){return _d.getElementById(id);}
function rpf(){
	if(arguments.length==0)return ""; 
	var xtr=arguments[0]; 
	for(var i=1;i<arguments.length;i++)xtr=xtr.replace(new RegExp('\\{' + (i-1) + '\\}','gm'), arguments[i]); 
	return xtr;
}
function rp_GetSwf(_imgurl,_ciid,_tid,_clkurl,_clickTag){return rpf("{0}?{5}={1}?c={2}%26t={3}%26URL={4}",_imgurl,_redurl,_ciid,_tid,escape(_clkurl).replace('&', '&amp;'),_clickTag);}
function rpOpenWin(_ciid,_tid,_popurl,_clkurl,_width,_height,_left,_top,_focuswin){
	_left=_left==0?((rp_getWidth()-_width)/2):_left;
	_top=_top==0?((rp_getHeight()-_height)/2):_top;
	var _newurl=rpf(_rpdom+"scripts/popup.asp?c={0}&t={1}&redurl={2}&popurl={3}&w={4}&h={5}",
			_ciid,_tid,_redurl,_popurl,_width,_height);
	var _newwin=_w.open(_newurl,_ciid,'toolbar=0,status=0,menubar=0,resizable=0,scrollbars=0,width='+_width+'px,height='+_height+'px,left='+_left+',top='+_top);
	if(!_focuswin){_newwin.blur();self.focus();}
}
function rpGetPageTop(){return typeof _w.pageYOffset!='undefined'?_w.pageYOffset:_d.documentElement.scrollTop?_d.documentElement.scrollTop:_d.body.scrollTop?_d.body.scrollTop:0;} 
function rpScrollAll()
{
	var _arrst=_stickyid.split(","),_st;
	for(var i=0;i<_arrst.length;i++){
		_st=rpget(_arrst[i]);
		if(_st)
			_st.style.top=rpGetPageTop()+"px";
	}
}
function rp_getWidth(){return rp_filter(_w.innerWidth?_w.innerWidth:0,_d.documentElement?_d.documentElement.clientWidth:0,_d.body?_d.body.clientWidth:0);}
function rp_getHeight(){return rp_filter(_w.innerHeight?_w.innerHeight:0,_d.documentElement?_d.documentElement.clientHeight:0,_d.body?_d.body.clientHeight:0);}

function rp_def(r_v,r_d){return(typeof(r_v)=="undefined")?r_d:r_v;}
function rp_max(){var _rpm=arguments[0];for(var i=0;i<arguments.length;i++){if(_rpm<arguments[i]){_rpm=arguments[i];}}return _rpm;}
function rp_filter(n_win,n_docel,n_body){return rp_max(rp_def(n_win,0), rp_def(n_docel,0), rp_def(n_body,0));}
function rp_closeOverlay(id){rpget(id+"Link").style.display="none";rpget(id).style.display="none";rpget(id+"Close").style.display="none";if(rpgoto)top.location.href=rpgoto;}

function rp_standart(_ciid,_tid,_clkurl,_imgurl,_width,_height,_ftype,_wmode,_zindex,_clickTag)
{
	_vcid=_ciid;
	_vtid=_tid;
	if (_wmode==null)_wmode="transparent";
	if (_zindex==null)_zindex = "100";
	if (_clickTag==null)_clickTag = "clickTAG";
	switch(_ftype){
		case "img":
			_d.write(rpf(_templates["img"],_redurl,_ciid,_tid,_clkurl,_imgurl,_width,_height));
			break;
		case "swf":
			_d.write(rpf(_templates["swf"],rp_GetSwf(_imgurl,_ciid,_tid,_clkurl,_clickTag),_width,_height,_wmode,_ciid,_tid,_zindex));
			break;
		case "vid":
			_d.write(rpf(_templates["vid"], _width, _height, _ciid, _tid, _imgurl, _redurl, _clkurl, _rpdom, "deneme",_zindex));
			break;
		case "rollover":
		    _d.write(rpf(_templates["rollover"],_width,_height,rp_GetSwf(_imgurl,_ciid,_tid,_clkurl,_clickTag),_height,_zindex,_wmode,_ciid,_tid))
		    break;
	}
}
function rp_video(_ciid,_tid,_clkurl,_imgurl,_width,_height,_title)
{
    _d.write(rpf(_templates["vid"], _width, _height, _ciid, _tid, _imgurl, _redurl, _clkurl, _rpdom,_title));
}
function rp_sticky(_ciid,_tid,_clkurl,_imgurl,_width,_height,_ftype,_wmode,_zindex,_clickTag)
{
	rp_standart(_ciid,_tid,_clkurl,_imgurl,_width,_height,_ftype,_wmode,_zindex,_clickTag);
	_stickyid+=rpf("rpCont{0}.{1},",_ciid,_tid);
	_w.onscroll=rpScrollAll;
}
function rp_floating(_ciid,_tid,_clkurl,_imgurl,_width,_height,_leftspace,_topspace,_ftype,_wmode,_zindex,_clickTag)
{
	var winW=rp_getWidth(),winH=rp_getHeight();
	rp_standart(_ciid,_tid,_clkurl,_imgurl,_width,_height,_ftype,_wmode,_zindex,_clickTag);
	var _cnt=rpget(rpf("rpCont{0}.{1}",_ciid,_tid));

	var _leftspace=_leftspace==0?((winW-_width)/2):_leftspace;
	var _topspace=_topspace==0?((winH-_height)/2):_topspace;
	if (_cnt){
		_cnt.style.position="absolute";
		_cnt.style.left=_leftspace+"px";
		_cnt.style.top=_topspace+"px";
	}
}
function _rmover(_div,_o,_height,_maxheight){
	rpget(_div.id+"Flash").style.height=(_o?_maxheight:ie?_maxheight:_height)+"px";
	_div.style.position=_o?"absolute":"relative";
	_div.style.height=(_o?_maxheight:_height)+"px";
	_div.height=(_o?_maxheight:_height)+"px";
	rpget(_div.id+"fix").style.visibility=_o?"hidden":"visible";
	rpget(_div.id+"fix").style.height=_o?_height+"px":"0px";
}
function rp_rollover(_ciid,_tid,_clkurl,_imgurl,_width,_height,_maxheight,_wmode,_zindex,_clickTag)
{
	var rpid=rpf("rpCont{0}.{1}",_ciid,_tid);
    if (!_isIE){        
        rp_standart(_ciid,_tid,_clkurl,_imgurl,_width,_height,"rollover",_wmode,_zindex,_clickTag);
        var rpEmbed = rpget(rpid+"FlashEmbed");
        var _cnt=rpget(rpid),rpflash=rpget(rpid+"Flash");
        _cnt.onmouseover = function(){rp_rolloverStyle(this,_width,_maxheight);}
        _cnt.onmouseout = function(){rp_rolloverStyle(this,_width,_height);}
        _cnt.style.height = _height + "px";
        rpflash.height = _maxheight + "px";
        rpEmbed.height = _maxheight +"px";        
    }else{        
	    rp_standart(_ciid,_tid,_clkurl,_imgurl,_width,_maxheight,"swf",_wmode,_zindex,_clickTag);
	    _d.write(rpf("<div id='{0}fix' style='width:{1}px;height:0px;z-index:0'></div>",rpid,_width));
	    var _cnt=rpget(rpid),rpflash=rpget(rpid+"Flash");
	    rpflash.style.height=_height+"px";
	    rpflash.style.overflow="hidden";
	    rpflash.style.position="absolute";
    	_rmover(_cnt,false,_height,_maxheight);
	    _cnt.onmouseover=function(){_rmover(this,true,_height,_maxheight)};
	    _cnt.onmouseout=function(){_rmover(this,false,_height,_maxheight)};
	}
}
function rp_rolloverStyle(cnt,width,height){
    cnt.style.width = width+"px";
    cnt.style.height = height+"px";
}
function rp_view(_cid,_tid)
{
	if(typeof _cid=="undefined")_cid=_vcid;
	if(typeof _tid=="undefined")_tid=_vtid;

	var _i=new Image(1,1);
	_i.src=rpf("{0}/rplvd.ashx?c={1}&t={2}",_rpdom,_cid,_tid);
	_i.onload=function(){rp_void();}
}
function rp_void(){return;}
function rp_overlay(_ciid,_tid,_clkurl,_imgurl,_width,_height,_ftype,_clickTag,_bgColor,_color,_zindex)
{
	var _html="",_leftspace=(rp_getWidth()-_width)/2,_topspace=(rp_getHeight()-_height)/2;
	_topspace=_topspace<0?20:_topspace;
	_bgColor = _bgColor||"#000";
	_color = _color||"#fff";
	_clickTag = _clickTag||"clickTAG";
	_zindex = _zindex||"99";
	
	switch(_ftype){
		case "img":
			_html=rpf(_templates["img"],_redurl,_ciid,_tid,_clkurl,_imgurl,_width,_height);
			break;
		case "swf":
			_html=rpf(_templates["swf"],rp_GetSwf(_imgurl,_ciid,_tid,_clkurl,_clickTag),_width,_height,"transparent",_ciid,_tid,_zindex);
			break;
	}
	var rpid=rpf("rpCont{0}.{1}",_ciid,_tid);
	_html=rpf("<div id='"+rpid+"Close' style='background-color:"+ _bgColor +";position:absolute;top:0;padding:10px;left:0;width:100%;height:100%'></div>"+
			"<br>{0}<div style='position:absolute;left:{1}px;top:{2}px;width:"+_width+"px;text-align:right'>"+
			"<a href=# id='"+rpid+"Link' style='text-decoration:none;padding-top:10px;color:"+ _color +";font-weight:bold;font-family:Tahoma;font-size:11px;' onclick='rp_closeOverlay(&quot;"+rpid+"&quot;);'>Kapat</a></div>", 
			_html,_leftspace,_topspace-40);
	
	_d.write(_html);
	var _cnt=rpget(rpid);
	if (_cnt){
		_cnt.style.position="absolute";
		_cnt.style.left=_leftspace+"px";
		_cnt.style.top=(20+_topspace)+"px";
	}
}
function rp_interstitial(_ciid,_tid,_clkurl,_imgurl,_width,_height,_disptype,_ftype,_bgColor,_color,_closeSeconds,_showCounter,_left,_clickTag,_zindex)
{
        rpCloseSeconds = _closeSeconds||8;
        _left = _left||10;        
		rp_overlay(_ciid,_tid,_clkurl,_imgurl,_width,_height,_ftype,_clickTag,_bgColor,_color,_zindex);
		var rpid=rpf("rpCont{0}.{1}",_ciid,_tid);
		var _cnt=rpget(rpid);
		_cnt.style.position="absolute";
		_cnt.style.left= _left + "px";
        _showCounter = _showCounter||"1";
        
    	window.setTimeout("rp_closeOverlay('"+_cnt.id+"');",rpCloseSeconds*1000);
		if (_showCounter == "1"){
		    rpget(rpid+"Link").innerHTML='<br><br>'+rpCloseSeconds--+" sn sonra kapanacak. Kapat";
		    window.setInterval("rpget('"+rpid+"Link').innerHTML='<br><br>'+(rpCloseSeconds--)+' sn sonra kapanacak. Kapat';",1000);
		}
}
function rp_background(_ciid,_tid,_clkurl,_imgurl,_offset1,_offset2)
{
	var _winW=rp_getWidth(),_winH=600;//rp_getHeight();

	var _bglink=rpf("{0}?c={1}&t={2}&URL={3}",_redurl,_ciid,_tid,_clkurl);
	var _bgh=rpf("<style>body{background:url('{0}') {1}px top no-repeat fixed;}</style>", _imgurl, _offset1>0?0:0);
	
	_bgh+=rpf(_templates["bg"],_bglink,_winW-_offset2-20,_winH+"px",_offset2,"2");
    
	_stickyid+="divSticky2,";
	if (_offset1>0){
		_bgh+=rpf(_templates["bg"],_bglink,_offset1-20,_winH+"px",0,"1");
		_stickyid+="divSticky1,";
	}
	_w.offset1=_offset1;
	_w.offset2=_offset2;
	_w.onscroll=rpScrollAll;
	_w.onresize=rpResized;
	_d.write(_bgh);
	rpResized();
}
function rpResized()
{
    window.setTimeout("rpResized()",100);
    var _xw=rp_getWidth(),_tw=offset2-offset1;
    var _li=Math.ceil((_xw-_tw)/2-offset1);
    try{if(offset1>0)_d.body.style.backgroundPosition=_li+"px 1px";}catch(r2){}
    var rpd1=rpget("divSticky1"),rpd2=rpget("divSticky2");
    if(rpd1)rpd1.style.left=_li+"px";

    if(rpd2&&offset1>0)rpd2.style.left=parseInt(offset1+_tw+_li)+"px";
}
function rp_html(_ciid,_tid,_html){_d.write(_html);}
document.write('<sc'+'ript src=\"/m/js/r/rpdh.js\"></s'+'cript>');
