function ytv(aurl){
var extra1 = '';
var extra2 = '';
var url='';
var id='';
var width='480';
var height='385';




if(aurl.match('4shared')){
url = aurl.replace('/file/', '/embed/');
}

if(aurl.match('youtube')){
url = aurl.replace('watch?v=', 'v/') + '&hl=ru&fs=1&rel=0';
}

if(aurl.match('vimeo')){
id = aurl.match(/(\d{1,})/);
url = 'http://vimeo.com/moogaloop.swf?clip_id='+ id +'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1';
}


if(aurl.match('yahoo')){
width=512;
height=322;
url =  'http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.46';
id = aurl.match(/watch\/(\d{1,})\//)[1];
extra1='<param name="flashVars" value="id=17697986&vid=6808604&lang=en-us&intl=us&thumbUrl=http%3A//l.yimg.com/a/i/us/sch/cn/video04/'+id+'_rnd09400ae6_19.jpg&embed=1" />';
extra2='flashVars="id=17697986&vid=6808604&lang=en-us&intl=us&thumbUrl=http%3A//l.yimg.com/a/i/us/sch/cn/video04/'+id+'_rnd09400ae6_19.jpg&embed=1"'
}

if(aurl.match('play.ukr.net')){
width=585;
height=345;
id = aurl.match(/key\/(.{1,})\//)[1];
url =  'http://play.ukr.net/player.swf?key=key/'+id;
}


if(aurl.match('video.bigmir.net')){
width=608;
height=342;

id = aurl.match(/(\d{1,})/)[0];
url = 'http://video.bigmir.net/extplayer/'+id+'/';
}

if(aurl.match('rutube')){
width=470;
height=353;

id = aurl.match(/v=(.{1,})/)[1];
url = 'http://video.rutube.ru/'+id+'';
}


if(aurl.match('file.qip.ru')){
width=470;
height=320;

id = aurl.match(/\/file\/(.{1,})\/(.{1,})\//);
url = 'http://file.qip.ru/embed/'+id[1]+'/'+id[2];
}

content = '<object width="'+width+'" height="'+height+'">'+
'<param name="movie" value="'+ url +'"></param>'+
'<param name="allowFullScreen" value="true"></param>'+
'<param name="allowscriptaccess" value="always"></param>'+
extra1+
'<embed src="'+ url +'" '+
'type="application/x-shockwave-flash" allowscriptaccess="always" '+
'allowfullscreen="true" width="'+width+'" height="'+height+'" '+
extra2+
'></embed></object>'+
'<br><a href="'+ aurl +'" target="_blank">'+ aurl +'</a><br><br>';

document.write(content);

}
