[^^]{2400}.*?>)@u', "\\1$ads_336x280", $text,1);
$text=preg_replace('@([^^]{1200}.*?>)@u', "\\1$ads_540x480", $text,1);
$text=preg_replace("@/h2>@u", "/h2>$ads_336x280", $text);
$text=preg_replace("@()@u", "\\1$ads_336x280x4_top$ads_336x280x4_top$ads_336x280x4_top$ads_336x280x4_top",$text,1);
if(!strpos($text, "counter.yadro.ru"))
$text=str_replace("