var pik = true;
function dhtmlLoadScript(url)
{
var e = document.createElement("script");
e.src = url;
e.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(e);
}
/*
onload = function()
{
/ dhtmlLoadScript("dhtml_way.js");
vk_social();
}
*/
function vk_social()
{
if($('.social_bar').length)
{
title = $('title').html();
cover = $('.page_cover').attr('src');
description = $('.text-beta').html() ? $('.text-beta').html() : $('description').html();
url = $('.page_cover').attr('rel');
if(!/^http/.test(cover))
{
cover = window.location.protocol+'//'+window.location.host+cover;
console.log(cover);
}
if(!/^http/.test(url))
{
url = window.location.protocol+'//'+window.location.host+url;
console.log(url);
}
t = VK.Share.button({
url: url,
title: title,
description: description.substr(0,256),
image: cover,
noparse: true
},
{
type: 'custom',
text: ''
}
);
$('.social_bar').append(t);
}
}
$(document).ready(function()
{
// vk_social();
});