	//clasirane box

	function changeListContent(sender_select, active)
	{
		if (sender_select.value == window[active]) return;

		document.getElementById(window[active]).className = 'hidden';
		document.getElementById(sender_select.value).className = 'visible';
		window[active] = sender_select.value;
	}

	function radioButton(sender, form_name, hidden, value)
	{
		var obj = sender.parentNode.getElementsByTagName('span')[0];

		if (obj.id != 'checked_radio_button_' + form_name + hidden)
		{
			var active = document.getElementById('checked_radio_button_' + form_name + hidden);
			if (active)
			{
				active.id = '';
				active.className = 'radio_button';
			}

			obj.id = 'checked_radio_button_' + form_name + hidden;
			obj.className = 'radio_button checked_radio';

			document.forms[form_name].elements[hidden].value = value;
		}
	}


	//change content info
	function MoveActiveContent(root_id, tag, active_id, ms_move, index)
	{
		this.obj = document.getElementById(root_id).getElementsByTagName(tag);
		this.active_id = active_id;
		this.active_element = document.getElementById(this.active_id);

		this.index = index;
		this.ms_move = ms_move;
		this.timer = null;
	}

	MoveActiveContent.prototype.startMove = function()
	{
		var self = this;
		this.timer = setInterval(function(){self.moveNextContent()}, this.ms_move);
	}

	MoveActiveContent.prototype.stopMove = function()
	{
		clearInterval(this.timer);
	}

	MoveActiveContent.prototype.removeActive = function()
	{
			document.getElementById(this.active_element.getAttribute('title')).className = 'hidden';
			this.active_element.id = '';
	}

	MoveActiveContent.prototype.setActive = function(sender)
	{
		if (!isNaN(sender))
		{
			if (sender == this.index) return;

			this.index = sender;
		}

		this.removeActive();

		var obj = this.obj[this.index];
			document.getElementById(obj.getAttribute('title')).className = 'visible';
			obj.id = this.active_id;
			this.active_element = obj;
	}

	MoveActiveContent.prototype.moveNextContent = function()
	{
		if (++this.index >= this.obj.length) this.index = 0;

		this.setActive();
	}

	MoveActiveContent.prototype.movePreviousContent = function()
	{
		if (--this.index < 0) this.index = this.obj.length - 1;

		this.setActive();
	}

	//user tools for zoom text, print, send friend

	var curFont = 11;

	function replaceClassNameObj(obj, regExp, replacer)
	{
		obj.className = obj.className.replace(regExp, replacer);
	}

	function incrementDecrementFont(obj_id, cur_button, ot_button_id, step)
	{
		CountClicks();
		if (cur_button.className.indexOf(' disable') > -1) return;

		curFont += step;
		document.getElementById(obj_id).style.fontSize = curFont + 'px';

		if (curFont <= 10 || curFont >= 13)
		{
			cur_button.className += ' disable';
		}
		else replaceClassNameObj(document.getElementById(ot_button_id), / disable$/, '');
	}

	function sendNewsFriends(heading, news_text, url, id_pic)
	{
		/*var popup_news = window.open('send_news.php?heading=' + heading + '&news_text=' + news_text +' &referer=' + (url != null ? url : document.URL) + '&id_pic=' + id_pic, 'send_news_test', 'width = 488, height = 375, left = 10, top = 10');*/
		var popup_news = window.open('send_news.php?heading=' + encodeURI(heading) + '&news_text=' + encodeURI(news_text) +' &referer=' + encodeURI((url != null ? url : document.URL)) + '&id_pic=' + encodeURI(id_pic), 'send_news_test', 'width = 488, height = 375, left = 10, top = 10');


	}

	function printingNews()
	{
		var obj = document.getElementById('big_news_container');
		var popup_news = window.open('', 'printing_news', 'width = 488, height = 700, scrollbars = yes, resizeble = no, left = 0, top = 0');
		popup_news.document.open();
		popup_news.document.write('<link rel="stylesheet" type="text/css" href="style/style.css"><link rel="stylesheet" type="text/css" href="style/print_news.css"><style type="text/css">html, body {overflow-x: hidden;}</style><style type="text/css" media="print">.heading_title_container {display: none;}</style>');
		popup_news.document.write('<h3 class="heading_title_container"><button class="print_button" style="float: right; display: inline; position: relative; top: -3px;" onclick="window.print();"></button>Print preview</h3>');
		popup_news.document.write(obj.parentNode.innerHTML);
		popup_news.document.close();
	}

	//popup poc for galery
	function openPicPopUp(url) {
		if (!document.getElementById('pop_up')) {
			var obj = document.createElement('a');
				obj.id = 'pop_up';
				obj.href = window.location.hash;
				obj.onclick = closePicPopUp;
				obj.style.position = 'absolute';
				obj.style.padding = '27px 10px 10px 10px';
				obj.style.border = '1px solid white';
				obj.style.zIndex = '99999';
				obj.style.overflow = 'hidden';
				obj.style.visibility = 'hidden';
				obj.style.background = 'black url(images/gallery_pop_up_close.gif) no-repeat right top';

			document.getElementById('container').appendChild(obj);
		}
		var pop_up = document.getElementById('pop_up');
			pop_up.innerHTML = '<img id="pop_up_img" src="' + url + '" alt="" onload="resizePicPopUp()">';
	}

	function resizePicPopUp() {
		var pop_up_margin = 60;
		var pop_up_offset_top = 222;

		var img = document.getElementById('pop_up_img');
		var container = document.getElementById('container');
		var banner = document.getElementById('zone_21');
			banner.style.display = 'none';

		var img_max_width = container.offsetWidth - (2 * pop_up_margin);
		var img_max_height = container.offsetHeight - (2 * pop_up_margin) - pop_up_offset_top;
		var img_ratio = img.offsetWidth / img.offsetHeight;
		var container_ratio = container.offsetWidth / container.offsetHeight;
		if (img_ratio >= container_ratio) {
			var img_width = (img.offsetWidth > img_max_width) ? img_max_width : img.offsetWidth;
			var img_height = img_width / img.offsetWidth * img.offsetHeight;
		}
		else if (img_ratio < container_ratio) {
			var img_height = (img.offsetHeight > img_max_height) ? img_max_height : img.offsetHeight;
			var img_width = img_height / img.offsetHeight * img.offsetWidth;
		}

		var pop_up = document.getElementById('pop_up');
			pop_up.style.width = img.style.width = img_width+'px';
			pop_up.style.height = img.style.height = img_height+'px';
			pop_up.style.left = (container.offsetWidth - pop_up.offsetWidth) / 2 + 'px';
			pop_up.style.top = pop_up_offset_top+'px';
			pop_up.style.visibility = 'visible';
	}

	function closePicPopUp() {
		var pop_up = document.getElementById('pop_up');
			pop_up.style.visibility = 'hidden';
		var banner = document.getElementById('zone_21');
			banner.style.display = 'block';
	}


	function openPicPopUpOld(url)
	{
		var pop_up = new Object();
			pop_up.width = 160;
			pop_up.height = 90;
			pop_up.x = (screen.width-pop_up.width)/2;
			pop_up.y = (screen.height-pop_up.height)/2;

		var picPopUp = window.open('', 'pop_up', 'width='+pop_up.width+', height='+pop_up.height+', left='+pop_up.x+', top='+pop_up.y+', screenX='+pop_up.x+', screenY='+pop_up.y+', scrollbars=yes');
		picPopUp.document.open();
		picPopUp.document.write('<style type="text/css"> * {margin: 0; padding: 0; *overflow: auto;}</style>');
		picPopUp.document.write('<title>Галерии - Sportal.bg</title>');
		picPopUp.document.write('<body onload="opener.resizeWin(self);"><img id="pic_popup" src="' + url + '" alt=""></body>');
		picPopUp.document.close();
	}

	function resizeWin(sender)
	{
		var obj = sender.document.getElementById('pic_popup');
		var w = obj.offsetWidth;
		var h = obj.offsetHeight;

		if (window.innerWidth)
		{
			w += sender.outerWidth - sender.innerWidth;
			h += sender.outerHeight - sender.innerHeight;
		}
		else
		{
			w += 10;
			h += 29;
		}

		w = (w > screen.width) ? screen.width : w;
		h = (h > screen.height) ? screen.height : h;
		sender.resizeTo(w, h);
		sender.moveTo((screen.width - w) / 2, (screen.height - h) / 2);
		sender.focus();
	}


	//index optimization - insert image source
	function setImageSrc(container_id) {
		var images = document.getElementById(container_id).getElementsByTagName('img');

		for (i = 0; images[i]; i++) {
			if (images[i].src.indexOf(".jpg") == -1) {
				var id = images[i].id.replace(container_id+'_','');
				var image_name = 0.00000001 * id + 1;
				if (image_name < 2) {
					image_name = image_name.toFixed(8).toString().replace('1.','')+'.jpg';
					images[i].src += image_name;
				}
			}
		}
	}

	function addImageSrc(obj,event,function_string,container_name,container_id,path) {
		obj[event] = new Function(
			function_string+';'+
			'setImageSrc("'+container_name+'"+'+container_id+');'
		);
		obj[event]();
	}



	//mouseover efekt for forecast table

	function setEffectTd(sender, index, classN)
	{
		var obj = sender.parentNode.parentNode.getElementsByTagName('tr');
		for (var i = 1; i < obj.length; i++)
		{
			obj[i].getElementsByTagName('td')[index].className = classN;
		}
	}

	//checkbox

	function checkbox(obj, formR, hiddenEl)
	{
		var hiddenElement = document.forms[formR].elements[hiddenEl];
		if (obj.className == 'checkbox')
		{
			obj.className += ' checked';
			hiddenElement.value = 'true'
			return;
		}

		replaceClassNameObj(obj, / checked$/, '');
		hiddenElement.value = '';
	}

	function checkbox2(obj, formR, hiddenEl, index)
	{
		var hiddenElement = document.forms[formR].elements[hiddenEl];
		if (hiddenElement.length > 0) hiddenElement = hiddenElement[index];

		if (obj.className == 'checkbox')
		{
			obj.className += ' checked';
			hiddenElement.checked = true;
			return;
		}

		replaceClassNameObj(obj, / checked$/, '');
		hiddenElement.checked = false;
	}
	//galery images select
	function galery_images_select(item)
	 { var o=document.getElementById('active_galery_pic');
	   o.id='';
	   item.id='active_galery_pic';
	  }


	//counter for video on index page
	function hitCounterMovie(sender)
	{
		var xmlHttp = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
		xmlHttp.open('GET', sender, true);
		xmlHttp.send(null);
	}


	//ComboBox
	function addEvent(element, handler, callback, capture)
	{
		if (window.addEventListener) element.addEventListener(handler, callback, capture);
		else element.attachEvent('on' + handler, callback);
	}

	function removeEvent(element, handler, callback, capture)
	{
		if (window.removeEventListener) element.removeEventListener(handler, callback, capture);
		else element.detachEvent('on' + handler, callback);
	}


	var currentComboBox = null;
	var flagComboBox = false;
	function moveSelected(sender, index)
	{
		if (sender.className == 'selected') return;

		currentComboBox.getElementsByTagName('li')[currentComboBox.currentSelected].className = '';
		sender.className = 'selected';
		currentComboBox.currentSelected = index;
	}

	function changeSelected(index, text, value)
	{
		if (index == currentComboBox.selectedIndex) return;

		currentComboBox.selectedIndex = index;
		updateTextValue(text, value);
		if (currentComboBox.listener) currentComboBox.listener.call(this, currentComboBox);
	}

	function showComboBox(combo_dom)
	{
		if (combo_dom != currentComboBox) hideComboBox();

		currentComboBox = combo_dom;
		currentComboBox.parentNode.style.zIndex = 9999; //M$ stupid browser hack!!!
		var combo = combo_dom.getElementsByTagName('div')[0];
			moveSelected(combo.getElementsByTagName('li')[combo_dom.selectedIndex], combo_dom.selectedIndex);
			combo.style.display = (combo.style.display != 'block') ? 'block' : 'none';
			flagComboBox = false;
	}

	function hideComboBox()
	{
		if (!currentComboBox || !flagComboBox)
		{
			flagComboBox = true;
			return;
		}
		currentComboBox.parentNode.style.zIndex = 100; //M$ stupid browser hack!!!
		currentComboBox.getElementsByTagName('div')[0].style.display = 'none';
		currentComboBox = null;
	}

	function updateTextValue(text, value)
	{
		var obj = currentComboBox.getElementsByTagName('input');
		currentComboBox.value =  obj[0].value = value;
		currentComboBox.getElementsByTagName('span')[0].innerHTML = text;
	}

	function OptionItem(text, value, selected)
	{
		this.text = text;
		this.value = (!value) ? this.text : value;
		this.selected = selected;
	}

	function ComboBox(name)
	{
		this.name = name;
		this.options = new Array();
		this.selectedIndex = 0;
		this.onchange_listener = null;
	}

	ComboBox.prototype.addOption = function(Option)
	{
		this.options.push(Option);

		if (Option.selected) this.selectedIndex = this.options.length - 1;
	}

	ComboBox.prototype.removeOption = function(index)
	{
		this.options.splice(index, 1);
	}

	ComboBox.prototype.setOnChangeListener = function(callback)
	{
		if (!(callback instanceof Function))
		{
			throw new Error('Arguments must be Function!!!');
		}

		this.onchange_listener = callback;
	}

	ComboBox.prototype.renderComboBox = function(id_element)
	{
		if (!this.options.length) return;

		var selectedElement = this.options[this.selectedIndex];

		var combo_root = document.createElement('div');
			combo_root.className = 'combo_box';
			combo_root.selectedIndex = this.selectedIndex;
			combo_root.currentSelected = this.selectedIndex;
			combo_root.value = this.options[this.selectedIndex].value;
			combo_root.listener = this.onchange_listener;
			combo_root.onclick = function(){showComboBox(this);};
		var htmlCode = '<span>' + selectedElement.text + '</span><input type="hidden" name="' + this.name + '" value="' + selectedElement.value + '"><div><ul>';

		for (var i = 0, len = this.options.length; i < len; i++)
		{
			htmlCode += '<li onclick="changeSelected(' + i + ',\'' + this.options[i].text + '\',\'' + this.options[i].value + '\')" onmouseover="moveSelected(this, '+ i +')">' + this.options[i].text + '</li>';
		}

		htmlCode += '</ul></div>';
		combo_root.innerHTML = htmlCode;
		document.getElementById(id_element).appendChild(combo_root);
	}


	addEvent(document, 'click', hideComboBox, false);

	function showLiveScore(sender, hidden_id)
	{
		var obj = document.getElementById('match_popup');
		obj.style.top = sender.offsetTop + sender.offsetHeight + sender.parentNode.parentNode.offsetTop + 'px';
		obj.innerHTML = document.getElementById(hidden_id).innerHTML;
		obj.style.display = 'block';
	}

	function sendPicFriends()
	{
		var src = document.images[0].src;
		var par_src = parent.document.URL;
		window.location.href = 'mailto:?subject=Вашия приятел ви изпраща снимка от http://sportal.bg&body=Здравейте, вашия приятел ви изпраща снимка от <a href="http://sportal.bg">http://sportal.bg</a><br><a href="' + src + '">' + src + '</a><br>Повече снимки, може да видите на адрес: <a href="' + par_src +'">' + par_src + '</a>';
	}

	function removeSpacerImg()
	{
		if (document.getElementById('main') && self == top)
		{
			var offset = 0;
			var curr = null;

			for (var i = 0; i < 3; i++)
			{
				var curr_obj = document.getElementById('wraper_box_' + i);
				if (curr_obj)
				{
					var img = curr_obj.getElementsByTagName('img');
					var div = document.createElement('div');
						div.style.height = 4 + 'px';
						div.style.overflow = 'hidden';
						div.appendChild(img[img.length - 1]);
						curr_obj.appendChild(div);

					if (offset < curr_obj.offsetHeight)
					{
						offset = curr_obj.offsetHeight;
						curr = curr_obj.lastChild;
					}
				}
			}
			if (curr) curr.parentNode.removeChild(curr);
		}
	}

	addEvent(window, 'load', removeSpacerImg);


	function checkActiveLiveScores()
	{
		var row = document.getElementById('ls_p1_container').getElementsByTagName('tr');
		var i = 0;
		while(i < row.length && row[i].className != 'active_match') i++;

		if (i < row.length) setActiveLiveScores();
	}

	function setActiveLiveScores()
	{
		var obj = document.getElementById('top_head_nav').getElementsByTagName('a');
		for (var i = 0; i < obj.length; i++)
		{
			if (obj[i].innerHTML.indexOf('Live Scores') > -1)
			{
				obj[i].style.color = '#FE850C';
			}
		}
	}

	//brand link......
	function brandLink(css_file, url, body_url)
	{
		if (self != top || !document.getElementById('wraper_box_1')) return;
		var obj = document.getElementsByTagName('link');
		var site_container = document.getElementById('container');
		var top_heading = document.getElementById('wraper_box_1').getElementsByTagName('table')[0];
		var brand_div = document.getElementById('brand_banner');
		var heading = document.getElementById('wraper_box_1').getElementsByTagName('h3');
			if (document.getElementById('wraper_box_2')) {
				var heading_video = document.getElementById('wraper_box_2').getElementsByTagName('h3');
			}

		if (brand_div || top_heading.className == 'heading_title_table' || heading.length || heading_video.length)
		{
			for (var i = 0; i < obj.length; i++)
			{
				if (obj[i].href.indexOf(css_file) > -1)
				{
					var link = document.createElement('a');
						link.href = url;
						link.className = 'brand_link';
						link.target = 'blank';

					if (brand_div) brand_div.appendChild(link);

					for (var j = 0; j < heading.length; j++)
					{

						if (heading[j].className.indexOf('heading_title_container') !== false) {
							heading[j].appendChild(link.cloneNode(true));

							if (heading[j].parentNode.getElementsByTagName('td').length > 0) {
								var box_brand_banner = heading[j].parentNode.getElementsByTagName('td')[heading[j].parentNode.getElementsByTagName('td').length - 1];
                            	if (box_brand_banner.className == 'box_brand_banner') {
	                            	var box_brand_link = link.cloneNode(true);
										box_brand_link.className = "box_brand_link";
	                            	box_brand_banner.appendChild(box_brand_link);
                            	}
                            }
						}
					}

					var top_heading_link = link.cloneNode(true);
						top_heading_link.id = "top_heading_link";
					if (top_heading.className == 'heading_title_table') top_heading.parentNode.insertBefore(top_heading_link, top_heading);

					var body_link = link.cloneNode(true);
						body_link.id = "body_link"
						if (body_url) body_link.href = body_url;
					site_container.parentNode.insertBefore(body_link,site_container);

					return;
				}
			}
		}
	}


	function fieldToNum(form_id, field)
	{
		var obj = document.getElementById(form_id).elements[field];
		obj.value = obj.value.substring(4, obj.value.length);
	}

	function updateFileValue(sender, id_element)
	{
		document.getElementById(id_element).value = sender.value;
	}



	addEvent(window, 'load', function (){brandLink('bet365.css', 'http://www.bet365.com?affiliate=GM_00000100', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=1492__zoneid=25__maxdest=http://www.tribestan.eu/');});
	addEvent(window, 'load', function (){brandLink('unibet.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=1018__zoneid=25__maxdest=https://bg.unibet.com/register/register.do');});
	addEvent(window, 'load', function (){brandLink('devin_v2.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=777__zoneid=25__maxdest=http://www.devin-bg.com/');});
	addEvent(window, 'load', function (){brandLink('betfair_v2.css', 'http://www.betfair.com/?rfr=9596');});
	addEvent(window, 'load', function (){brandLink('johnnie_wallker_v2.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=1382__zoneid=25__maxdest=http://www.johnnie-walker.bg');});
	addEvent(window, 'load', function (){brandLink('betathome.css', 'http://www.bet-at-home.com/campaign.aspx?cid=4534&lang=BG');});
	addEvent(window, 'load', function (){brandLink('ceresit_gallery_2.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2209__zoneid=25__maxdest=http://ceresit.bg/component/virtuemart/details/142/35/%D0%97%D0%B0-%D0%BA%D0%B5%D1%80%D0%B0%D0%BC%D0%B8%D1%87%D0%BD%D0%B8-%D0%BF%D0%BE%D0%BA%D1%80%D0%B8%D1%82%D0%B8%D1%8F/%D0%A3%D0%BD%D0%B8%D0%B2%D0%B5%D1%80%D1%81%D0%B0%D0%BB%D0%BD%D0%B8-%D0%BB%D0%B5%D0%BF%D0%B8%D0%BB%D0%B0/classic-universal/121');});
	addEvent(window, 'load', function (){brandLink('ceresit_gallery_3.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2990__zoneid=25__maxdest=http://www.ceresit.bg/');});
	addEvent(window, 'load', function (){brandLink('ceresit.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=1851__zoneid=25__maxdest=http://www.ceresit.bg/');});
	//addEvent(window, 'load', function (){brandLink('ariana_2.css', 'http://bg.hit.gemius.pl/hitredir/id=nXAwEjssiwk.4JKkuR_qoqeinO7UosyrlLocYjB166z.p7/stparam=nhqtcjnpjj/url=www.ariana.bg');});
	addEvent(window, 'load', function (){brandLink('ariana_4.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2194__zoneid=25__maxdest=http://ariana.bg/');});
	addEvent(window, 'load', function (){brandLink('marcopolo.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=1991__zoneid=25__maxdest=http://www.marc-o-polo.com/');});
	addEvent(window, 'load', function (){brandLink('samsung.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2034__zoneid=25__maxdest=http://www.samsung.com/ro/bg/3d/');});
	addEvent(window, 'load', function (){brandLink('moment_formula.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2063__zoneid=25__maxdest=http://www.moment.bg/');});
	addEvent(window, 'load', function (){brandLink('moment_basket.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2062__zoneid=25__maxdest=http://www.moment.bg/');});
	addEvent(window, 'load', function (){brandLink('zagorka_video_v2.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2189__zoneid=25__maxdest=http://zagorka.bg/');});
	addEvent(window, 'load', function (){brandLink('zagorka_tennis.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2256__zoneid=25__maxdest=http://tennis.zagorka.bg/');});
	addEvent(window, 'load', function (){brandLink('ariana_5.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2194__zoneid=25__maxdest=http://ariana.bg/');});
	addEvent(window, 'load', function (){brandLink('max_telecom_volley.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2304__zoneid=25__maxdest=http://www.maxtelecom.bg/internet/maxfree');});
	addEvent(window, 'load', function (){brandLink('nike.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2445__zoneid=25__maxdest=http://www.nikefootball.com');});
	addEvent(window, 'load', function (){brandLink('brand_4ever.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2455__zoneid=25__maxdest=http://4ever.bg/promo/');});
	addEvent(window, 'load', function (){brandLink('fitnes.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2516__zoneid=25__maxdest=http://www.2fitbyboevski.com/index.php');});
	addEvent(window, 'load', function (){brandLink('kamenitza.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2587__zoneid=25__maxdest=http://www.kamenitzafanclub.com/bg/age_select');});
	addEvent(window, 'load', function (){brandLink('pravetz.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2662__zoneid=25__source=Sportal.bg+-+Golf__cb=35dea943f7__oadest=http://www.pravets-golfclub.com/');});
	addEvent(window, 'load', function (){brandLink('puma_running.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2667__zoneid=25__maxdest=http://www.puma.com/running');});
	addEvent(window, 'load', function (){brandLink('max_telecom_f1.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2678__zoneid=25__maxdest=http://www.maxtelecom.bg/internet/maxfree');});
	addEvent(window, 'load', function (){brandLink('unibet_cska_levski.css', 'http://adserving.unibet.com/redirect.aspx?pid=19756&bid=10583');});
	addEvent(window, 'load', function (){brandLink('turkish_airlines.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=2760__zoneid=25__maxdest=http://www.thy.com');});
	addEvent(window, 'load', function (){brandLink('bet365_know.css', 'http://www.bet365.com?affiliate=GM_00000100');});
	addEvent(window, 'load', function (){brandLink('full_tilt_poker.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=3020__zoneid=25__maxdest=http://www.facethepro.net/bg/?key=MDAwMDAwMDAwMDAzMENENzAwMDAwMDAwMDAwMDAwQUY-');});
	addEvent(window, 'load', function (){brandLink('betfair_end_2010.css', 'http://www.betfair.com/?rfr=9995');});
	addEvent(window, 'load', function (){brandLink('chipi.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=3081__zoneid=25__maxdest=http://www.chipi.bg');});
addEvent(window, 'load', function (){brandLink('johnnie_walker_3.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=3277__zoneid=25__maxdest=http://www.johnniewalker.bg');});
addEvent(window, 'load', function (){brandLink('max_telecom.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=3275__zoneid=25__maxdest=http://www.maxtelecom.bg/');});
addEvent(window, 'load', function (){brandLink('lg_video.css', 'http://bg.hit.gemius.pl/hitredir/id=ogHgizedm12Mw5bnbHjUbOTSrtIRq_ckpouG6IrcuAv.Q7/stparam=widskwforu/url=http://www.lg.com/bg/televizor-audio-video/televizor/index.jsp');});
addEvent(window, 'load', function (){brandLink('bbbff.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=3456__zoneid=25__maxdest=http://www.bbbff.com/');});


    // start nescafe
	function nescafeChanges(css_file) {
		// start hide live scores in branded section
		var obj = document.getElementsByTagName('link');
		for (var i = 0; i < obj.length; i++) {
			if (obj[i].href.indexOf(css_file) > -1) {
				var ls_box = document.getElementById('ls_p1_container');
				ls_box.parentNode.removeChild(ls_box);

				var ls_box_content = document.getElementById('ls_hidden_content');
				ls_box_content.parentNode.removeChild(ls_box_content);
		    }
		}
		// end hide live scores in branded section

		// start add banner for impressions count on the menu button
		if (document.getElementById('nescafe_v2')) {
			var banner_container = document.createElement('div');
				banner_container.id = 'nescafe_counter';
				banner_container.style.position = 'absolute';
				banner_container.style.top = '0';
				banner_container.style.left = '0';
				banner_container.style.width = '1px';
				banner_container.style.height = '1px';
				banner_container.innerHTML = "<iframe id='abb85532' name='abb85532' src='http://bms.msk.bg/delivery/afr.php?zoneid=123&amp;target=_blank&amp;cb=INSERT_RANDOM_NUMBER_HERE' framespacing='0' frameborder='no' scrolling='no' width='1' height='1'><a href='http://bms.msk.bg/delivery/ck.php?n=a92176fe&amp;cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://bms.msk.bg/delivery/avw.php?zoneid=123&amp;cb=INSERT_RANDOM_NUMBER_HERE&amp;n=a92176fe' border='0' alt='' /></a></iframe>";

			document.getElementById('nescafe_v2').appendChild(banner_container);
		}
		// end add banner for impressions count on the menu button
	}
	addEvent(window, 'load', function (){
		brandLink('nescafe_v2.css', 'http://bms.msk.bg/delivery/ck.php?oaparams=2__bannerid=1461__zoneid=25__maxdest=http://nescafe.bg/?mv=3&i');
		nescafeChanges('nescafe_v2.css');
	});
	// end nescafe
