function insertFlash(url, width, height, bgcolor, quality){
    var quality=quality || 'high'; 
    var bgcolor=bgcolor || '#ffffff'; 
    var vars='';
    document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" align="middle">');
    document.writeln('<param name="allowScriptAccess" value="sameDomain" />');
    document.writeln('<param name="movie" value="'+url+'" />');
    document.writeln('<param name="quality" value="'+quality+'" />');
    document.writeln('<param name="bgcolor" value="'+bgcolor+'" />');
    document.writeln('<param name="flashvars" value="'+vars+'" />');
    document.writeln('<embed src="'+url+'" quality="'+quality+'" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'"  align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+vars+'" />')
    document.writeln('</object>');
}

function add_fb(url, width, height) {
    if(url){
		window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(url),'sharer','toolbar=0,status=0,width='+width+',height='+height);
	}
    return false;
}

function add_vk(url, width, height) {
	if(url){
		window.open('http://vkontakte.ru/share.php?url='+encodeURIComponent(url)+'&amp;image=','sharer','toolbar=0,status=0,width='+width+',height='+height);
	}
    return false;
}

function showBlock() {
	$('.code_for_blogs').show();
	$('.code_for_blogs textarea').select();
}
