$.fn.initFavorites = function(){ var url = window.location; var col2 = $('> div.col2 ', $(this).parent()); var title = $('h1.title', col2).text() || $('div.adv h2.title').text() || $('meta[name=description]').attr("content") || $('title').text(); var content = $('div.content p:eq(0), div.content p:eq(1)', col2).text().substring(0, 300) || $('div.ob div.col2 > div:eq(0)').html() || $('div.content p', col2).text().substring(0, 300) + '...'; var img = $('div.content img:eq(0)', col2).attr('src') || $('div.ob div.col3 > div:eq(0) img:eq(0)').attr('src') || OPTS.URL.STATIC + 'templates/images/aclogo.png'; var bgy_step = -22; var links = { 'facebook': { 'href':'http://www.facebook.com/sharer.php?u='+url, 'title':'Facebook', 'bgy':0 }, 'linkedin': { 'href':'http://www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&source=Automarket.su', 'title':'Linked In', 'bgy':1 }, 'vkontakte': { 'href':'http://vkontakte.ru/share.php?url=' + encodeURIComponent(url), 'title':'ВКонтакте', 'bgy':2 }, 'myspace': { 'href':'javascript:void(window.open(\'http://www.myspace.com/Modules/PostTo/Pages/?u=\'+encodeURIComponent(document.location.toString()),\'ptm\',\'height=450,width=440\').focus())', 'title':'MySpace', 'bgy':3, 'tagert':'self' }, 'twitter': { 'href':'http://twitter.com/home/?status=' + encodeURIComponent(title + ' — ' + url), 'title':'Twitter', 'bgy':4 }, 'mailru': { 'href':'http://connect.mail.ru/share?share_url=' + encodeURIComponent(url), 'title':'Мой мир на Mail.ru', 'bgy':5 }, 'goobleb': { 'href':'http://www.google.com/bookmarks/mark?op=add&bkmk=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title), 'title':'Google Bookmarks', 'bgy':6 }, 'googler': { 'href':'http://www.google.com/reader/link?url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&srcTitle=Automarket.su&srcURL=http%3A%2F%2Fwww.automarket.su/', 'title':'Google Reader', 'bgy':10 }, 'odnoklass': { 'href':'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st._surl=' + encodeURIComponent(url), 'title':'Одноклассники', 'bgy':7 }, 'lj': { 'href':'http://www.livejournal.com/update.bml', 'title':'LiveJournal', 'bgy':8 }, 'yazaklad': { 'href':'http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&lurl=' + encodeURIComponent(url) + '&lname=' + encodeURIComponent(title), 'title':'Яндекс.Закладки', 'bgy':9 }, 'yahoo': { 'href':'http://bookmarks.yahoo.com/toolbar/savebm?u=' + encodeURIComponent(url) + '&t=' + encodeURIComponent(title), 'title':'Yahoo! Bookmarks', 'bgy':11 } } var conteiner = $('