// JScript File
var siteUrl="http://www.reklamstore.com";
function createAdSpace(win,doc,url){
    url=url.substring(0,1000);
    url=url.replace(/%\w?$/,"");
        if(win.name!="reklamstore_frame")
    {

        doc.write('<iframe name="reklamstore_frame" width='+toQuote(win.reklamstore_ad_width)+" height="+toQuote(win.reklamstore_ad_height)+" frameborder="+toQuote(win.reklamstore_ad_frameborder)+" src="+toQuote(url)+' marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no">');
        doc.write("</iframe>");
    }
}

function toQuote(b)
{
    return b!=null?'"'+b+'"':'""';
}

function configureads(){

    var win=window;
    var doc=document;
    var loc=doc.location;
    var ref=doc.referrer;
    var e=null;
    win.reklamstore_org_error_handler=win.onerror;
    win.onerror=C;
    if(win.reklamstore_ad_frameborder==null)
    {
        win.reklamstore_ad_frameborder=0;
    }
    if(win.reklamstore_ad_format==null)
    {
        win.reklamstore_ad_format=win.reklamstore_ad_width+"x"+win.reklamstore_ad_height;
    }
    if(win.reklamstore_page_url==null)
    {
        win.reklamstore_page_url=ref;
        if(!zz(win,doc)){
            win.reklamstore_page_url=loc;
            win.reklamstore_last_modified_time=Date.parse(doc.lastModified)/1000;
            win.reklamstore_referrer_url=ref;
        }
    }
    else
    {
        win.reklamstore_page_location=ref;
        if(!zz(win,doc)){
            win.reklamstore_page_location=loc;
        }
    }
    win.reklamstore_page_location = loc;
    if(win.reklamstore_num_slots_by_channel==null){
        win.reklamstore_num_slots_by_channel=new Array();
    }
    if(win.reklamstore_num_slots_by_client==null){
        win.reklamstore_num_slots_by_client=new Array();
    }
    if(win.reklamstore_prev_ad_formats_by_region==null){
        win.reklamstore_prev_ad_formats_by_region=new Array();
    }
}

function zz(win,doc)
{
    var root=doc.documentElement;
    if(isTopWindow(win,doc))
        return false;
    if(win.reklamstore_ad_width&&win.reklamstore_ad_height){
        var width=1;
        var height=1;
        if(win.innerHeight){
            width=win.innerWidth;
            height=win.innerHeight;
        }else if(root&&root.clientHeight){
            width=root.clientWidth;
            height=root.clientHeight;
        }else if(doc.body)
        {
            width=doc.body.clientWidth;
            height=doc.body.clientHeight;
        }
        if(height>2*win.reklamstore_ad_height||width>2*win.reklamstore_ad_width)
        {
            return false;
        }
    }
    return true;
}

function isTopWindow(win,doc){
    return win.top.location==doc.location;
}

function appendUrl_1(paramName,paramValue)
{
    if(paramName)
    {
        window.reklamstore_ad_url+="&"+paramName+"="+paramValue;
    }
}

function renderads() 
{
    var win = window;
    var doc = document;


	//if(reklamstore_region_id == '1500'|| reklamstore_client_id =='2869')	   
	//{
	    win.reklamstore_ad_url =siteUrl + "/DenizFeneri/" +window.reklamstore_ad_width+"_"+window.reklamstore_ad_height+".html?";
	//}
	//else
	//{
		//if(window.reklamstore_region_id == "3968" || window.reklamstore_region_id== "6969")
	 	win.reklamstore_ad_url = siteUrl + "/admanager/getregion.rs?";
    		//else
   		//win.reklamstore_ad_url = siteUrl + "/admanager/render.aspx?";
    		//win.reklamstore_ad_url += "cust=" + win.reklamstore_client_id; //add customer param
	//}
		

    appendUrl_1("cust",window.reklamstore_client_id);
    appendUrl_1("rgn",window.reklamstore_region_id); //add region param
    appendUrl_1("sz",window.reklamstore_screen_size);
    appendUrl_1("rgw",window.reklamstore_ad_width);
    appendUrl_1("rgh",window.reklamstore_ad_height);
    appendUrl_1("reqUrl",win.reklamstore_page_location);
    createAdSpace(win,doc,window.reklamstore_ad_url);
}
function encode (string) {

		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
		for (var n = 0; n < string.length; n++) {

			var c = string.charCodeAt(n);

			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
		}
		return utftext;
	}

function C(){return;renderads();return true}

configureads();
renderads();






