while(message.search(/\[video\](.*?)\[\/video\]/g)>=0){t=message.split('[video]'); if(t[1]) {t2=t[1].split('[/video]');video_c++; if(t2[0]&&mp.video_max>=video_c) { var ss2009=t2[0].replace("watch?v=", "v/");ss400='src="'+ss2009+'&hl=ru&fs=1"';message=message.replace('[video]'+t2[0]+'[/video]','<embed '+ss400+' type=application/x-shockwave-flash allowscriptaccess=always allowfullscreen=true width=550 height=350></embed>') } else {message=message.replace('[video]'+t2[0]+'[/video]','');}}}