function imager_run(iid) {

   //  'bg_color' : '#d40000','bg_alpha' : '60','font_type' : 'Arial','font_size' : '12','img_direct' : 'left','teaser':'true'}; 

   var TE_teasers_current = 0;
   var TE_teasers_max = TE_teaser_imager.length-1;
   $("img").each(function(i){
       if (this.width >= TE_configs_imager['min_width'] && this.height >= TE_configs_imager['min_height'] && !$(this).attr('no_ads')) {
		   var offset = $(this).offset();
		   offset_x_1 = offset.left;
		   offset_y_1 = offset.top;

           TE_configs_imager['teeser_height'] = TE_configs_imager['teeser_height'] > this.height ? this.height : TE_configs_imager['teeser_height'];
           $("<div id=\"image_adv_"+i+"\" style=\"display:none\"></div>").appendTo("body");
		   $("#image_adv_"+i).css({
		      'width' : this.width, 
			  'height' : TE_configs_imager['teeser_height']+'px', 
			  'background-color' : TE_configs_imager['bg_color'],
			  'opacity' : TE_configs_imager['bg_alpha']/100,
			  'position' : 'absolute',
			  'left' : offset_x_1,
			  'top' : this.height+offset_y_1-TE_configs_imager['teeser_height'],
		   }).fadeIn(1000);
		   $("<div id=\"image_adv_"+i+"_body\" style=\"display:none;width: "+(this.width-5)+"px;overflow: hidden\"></div>").appendTo("body");
		   $("#image_adv_"+i+"_body").css({ 
			  'position' : 'absolute',
			  'left' : offset_x_1,
			  'padding-left' : '5px',
			  'top' : this.height+offset_y_1-TE_configs_imager['teeser_height']+'px',

		   }).fadeIn(1000);
		   $("<div id=\"image_adv_"+i+"_close\" style=\"display:none\"><img src=\"http://adulttiz.com/close.jpg\"></div>").appendTo("body");
		   $("#image_adv_"+i+"_close").bind('click', function() {
		         $("#image_adv_"+i+"_close").fadeOut();
				 $("#image_adv_"+i+"_body").fadeOut();
				 $("#image_adv_"+i+"_adv").fadeOut();
			   	 $("#image_adv_"+i).fadeOut();
		    }).css({
		      'width' : 10, 
			  'height' : 10, 
			  'position' : 'absolute',
			  'cursor' : 'hand',
			  'cursor' : 'pointer',
			  'left' : this.width+offset_x_1-20,
			  'top' : this.height+offset_y_1-(TE_configs_imager['teeser_height']/2+8),
		   }).fadeIn(1000);
		   if (TE_configs_imager['ref_link'] == 1) {
			   $("<div id=\"image_adv_"+i+"_adv\" style=\"display:none\"><a href=\"http://adulttiz.com/to/"+TE_configs_imager['ref_id']+"\"  target=\"_blank\" style=\"font: 10px "+TE_configs_imager['font_type']+"; color: "+TE_configs_imager['font_color']+";\">Реклама на сайте</a></div>").appendTo("body");
			   $("#image_adv_"+i+"_adv").css({
			      'width' : 200, 
				  'height' : 10, 
				  'position' : 'absolute',
				  'cursor' : 'hand',
				  'cursor' : 'pointer',
				  'left' : this.width+offset_x_1-100,
				  'top' : this.height+offset_y_1-20,
			   }).fadeIn(1000);
		   }
		   $("#image_adv_"+i+"_body").html();
		   
		   var base_image_width = TE_configs_imager['teeser_height']-30;
		   var base_teaser_width = base_image_width+130;
		   var teaser_count = Math.floor((this.width-5) / (base_teaser_width+10));
		   var html_teaser = '';
		   if (teaser_count > 1) {
		      var div_width = 'width: '+base_teaser_width+'px;';
		   } else {
		   	  teaser_count = 1;
		   }
		   TE_teasers_current = 0;
		   for (var iii = 0; iii < teaser_count; iii++) {
				
                if (TE_configs_imager['img_direct'] == 'left') {
					html_teaser += '<div id="teb_img_'+TE_teasers_current+'" style="float: left; '+div_width+' height: '+TE_configs_imager['teeser_height']+'px; padding: 15px 5px; overflow:hidden">'+
					               '<a style="text-decoration: none" href="http://'+location.host+'" onmouseover="this.href=\''+TE_teaser_imager[TE_teasers_current]['link']+'\'" title="'+TE_teaser_imager[TE_teasers_current]['desc']+'" target="_blank" >'+
					               '<img id="teb_img_src_'+TE_teasers_current+'_'+iii+'" src="'+TE_teaser_imager[TE_teasers_current]['img']+'" title="'+TE_teaser_imager[TE_teasers_current]['desc']+'" alt="'+TE_teaser_imager[TE_teasers_current]['title']+'" border="0" align="left" height="'+base_image_width+'" style="margin-right: 8px;"/></a>'+
					               '<a href="http://'+location.host+'" onmouseover="this.href=\''+TE_teaser_imager[TE_teasers_current]['link']+'\'" title="'+TE_teaser_imager[TE_teasers_current]['desc']+'" target="_blank" style="font: '+TE_configs_imager['font_size']+'px '+TE_configs_imager['font_type']+'; color: '+TE_configs_imager['font_color']+';">'+TE_teaser_imager[TE_teasers_current]['title']+
					               '</a></div>';
	            } else {
					html_teaser += '<div id="teb_img_'+TE_teasers_current+'" style="float: left; '+div_width+' height: '+TE_configs_imager['teeser_height']+'px; padding: 15px 5px; overflow:hidden">'+
					               '<a style="text-decoration: none" href="http://'+location.host+'" onmouseover="this.href=\''+TE_teaser_imager[TE_teasers_current]['link']+'\'" title="'+TE_teaser_imager[TE_teasers_current]['desc']+'" target="_blank" >'+
					               '<img id="teb_img_src_'+TE_teasers_current+'_'+iii+'" src="'+TE_teaser_imager[TE_teasers_current]['img']+'" title="'+TE_teaser_imager[TE_teasers_current]['desc']+'" alt="'+TE_teaser_imager[TE_teasers_current]['title']+'" border="0" align="right" height="'+base_image_width+'" style="margin-left: 8px;"/></a>'+
					               '<a href="http://'+location.host+'" onmouseover="this.href=\''+TE_teaser_imager[TE_teasers_current]['link']+'\'" title="'+TE_teaser_imager[TE_teasers_current]['desc']+'" target="_blank" style="font: '+TE_configs_imager['font_size']+'px '+TE_configs_imager['font_type']+'; color: '+TE_configs_imager['font_color']+';">'+TE_teaser_imager[TE_teasers_current]['title']+
					               '</a></div>';
	            }
				if (TE_teasers_current == TE_teasers_max) {
				   TE_teasers_current = 0;
				} else {
				   TE_teasers_current++;
				}
		   }
		   $("#image_adv_"+i+"_body").html(html_teaser);
	   }
   });
}
