if (must_be_one_js_for_our_teasers!=1) {		
	var must_be_one_js_for_our_teasers = 1;
	function getTizerBlockURL(block_id)
	{
		var blockId = block_id; /* ид сайта на котором размещён счётчик */
		var cookieRef = document.cookie.split('z_wn'+blockId+'=')[1]; /* инфа о прошлом посещении страницы из кук */
		if (cookieRef !== undefined) 
			cookieRef = unescape(cookieRef.split(';')[0]);
		else
			cookieRef = '';
		var realref = ''; var reftype = 0;		
		if (window.name.split('|')[0] == 'teasercc_'+blockId)
		{
			/* инфа о реферере есть в window.name */
			realref = window.name;
			reftype = 1;
		}
		else if (cookieRef.split('|')[0] == 'teasercc_'+blockId)
		{
			/* инфа о реферере есть в куках и они включены */
			window.name = realref = cookieRef;
			reftype = 2;
		}
		else 
		{
			/* инфы нету нигде, если реферер определён - пихаем его в name и куку */
			reftype = 3;
			realref = 'teasercc_'+blockId+'|'+document.referrer;
			window.name = realref;
			var date = new Date();
			date.setTime(date.getTime()+(60*60*1000)); // 1 час			
			document.cookie = 'z_wn'+blockId+'='+escape(realref)+";expires="+date.toGMTString();+";path=/;";
		}
		/* формируем код счётчика */
		var cntr_str = 'r='+escape(realref)+'&s='+			
			((typeof(screen)=="undefined")? "" : screen.width+"_"+screen.height+"_"+(screen.colorDepth ? screen.colorDepth:screen.pixelDepth))+
			'&cref='+escape(document.referrer)+
			'&b='+blockId+
			'&u='+escape(document.URL)+
			'&rt='+reftype+
			'&t='+Math.random();
		return cntr_str;
	}
	function getblock(blockId)
	{
		var src = "http://teaser.cc/statistics/gettizerblock2.php?"+getTizerBlockURL(blockId);
		document.write('<div id="teaser_cc_'+blockId+'_unical"></div>');
		document.write("<scr"+""+"ipt src=\""+src+"\" type=\"text/javascript\"></script>");
	}
	function create_t_img(tblock, one_t)
	{//обёртка для создания картинки
		var img = window.document.createElement("img");
		img.style.border = tblock.teaser_border+"px solid "+tblock.teaser_border_color;
		img.src = "http://img.teaser.cc/i/"+one_t.id+""+tblock.tiz_size+"."+one_t.img+"?b="+tblock.id;
		img.alt = one_t.hint;
		return img;
	}
	function create_t_link(tblock, one_t, tiz_str)
	{//обёртка для создания абстрактной ссылки
		var link = window.document.createElement("a");
		link.href = 'http://teaser.cc/statistics/click2.php?b='+tblock.id+'&i='+one_t.id+tiz_str;
		link.title = one_t.hint;
		
		if(tblock.new_window) link.target = "_blank";
		return link;
	}
	function create_t_stlink(tblock, one_t, tiz_str)
	{//обёртка для создания текстовой ссылки
		var link = create_t_link(tblock, one_t, tiz_str);
		link.style.fontFamily = tblock.teaser_font;
		link.style.fontSize = tblock.teaser_font_size+"px";
		link.style.color = tblock.teaser_font_color;
		if (tblock.link_underline==1) link.style.textDecoration = "underline";
		else link.style.textDecoration = "none";		
		if (tblock.link_bold==1) link.style.fontWeight = "bold";
		link.innerHTML=one_t.text;
		return link;
	}
	function add_cell_t_row(row, celldata)
	{//обёртка для создания ячейки таблицы
		var cell = row.insertCell(-1);
		if (celldata.width!=undefined) cell.style.width = celldata.width+"px";
		if (celldata.height!=undefined)	cell.style.height = celldata.height+"px";
		cell.style.verticalAlign = celldata.va;
		cell.style.textAlign = celldata.ta;
		return cell;
	}
	function buildBlock(data)
	{//билдер тизерного блока
			var tblock = data.block;
			var teasers = data.teasers;
			var tiz_str = '&s='+			
			((typeof(screen)=="undefined")? "" : screen.width+"_"+screen.height+"_"+(screen.colorDepth ? screen.colorDepth:screen.pixelDepth))+
			'&cref='+escape(document.referrer)+
			'&b='+tblock.id+
			'&u='+escape(document.URL)+
			'&t='+Math.random();
			var d = Math.round(100/(tblock.tizer_count*2));
			var suffh="px";	if (tblock.height_is_proc==1) suffh="%";
			var suffw="px";	if (tblock.width_is_proc==1) suffw="%";
			var teaserblock = window.document.getElementById('teaser_cc_'+tblock.id+'_unical');
			teaserblock.style.background = tblock.bg_color;
			teaserblock.style.width = tblock.width+suffw; 
			teaserblock.style.height = tblock.height+suffh;
			teaserblock.style.border = tblock.border+"px solid "+tblock.border_color;
			var tbtable = window.document.createElement("table");
			tbtable.cellspacing = tblock.padding;
			tbtable.cellpadding = 0;
			tbtable.style.height="100%";
			tbtable.style.width="100%";
			teaserblock.appendChild(tbtable);
			
			if (tblock.block_type!=1)
			{//horiz
				var row = tbtable.insertRow(-1);
			}
			for (var i=0;i<teasers.length;i++)
			{
				if (tblock.block_type==1)
				{//vert
					var row = tbtable.insertRow(-1);
				}
				var one_t = teasers[i];
				var cell = add_cell_t_row(row, {va:"middle",ta:"center"})
				var link = create_t_link(tblock, one_t, tiz_str);
				var img = create_t_img(tblock, one_t);
				link.appendChild(img);
				cell.appendChild(link);
				if (tblock.teaser_text_orientation==3)//right
				{
					var cell2 = add_cell_t_row(row,{va:"middle",ta:"left"})
					link = create_t_stlink(tblock, one_t, tiz_str);
					cell2.appendChild(link);
				}
				if (tblock.teaser_text_orientation==1)//bottom
				{
					if (tblock.block_type==1)
					{//vert
						var row2 = tbtable.insertRow(-1);
						var cell2 = add_cell_t_row(row2,{va:"top",ta:"center"})
						link = create_t_stlink(tblock, one_t, tiz_str);
						cell2.appendChild(link);
					}
				}
			}
			if (tblock.block_type!=1)
			{//horiz
				if (tblock.teaser_text_orientation==1)//bottom
				{
					var row2 = tbtable.insertRow(-1);
					for (var i=0;i<teasers.length;i++)
					{
						var one_t2 = teasers[i];
						var cell2 = add_cell_t_row(row2,{va:"top",ta:"center"})
						link = create_t_stlink(tblock, one_t2, tiz_str);
						cell2.appendChild(link);
					}
				}
			}
		}
}