var CORE = new Object();


CORE.SetAnchor = function(anchor)
 {
  window.location.replace('#' + anchor);
 }

CORE.GetAnchor = function()
 {
  return window.location.hash.substr(1);
 }

CORE.LoadTwitter = function(id, twitter, common_hash)
 {
  new Ajax.Updater(id,
                   '/ajax/twitter.html',
                   { asynchronous: true,
                     method: 'GET',
                     parameters: 'twitter=' + encodeURIComponent(twitter) + '&common_hash=' + encodeURIComponent(common_hash),
                     onSuccess: Tooltips.rescan_delayed });
 }

CORE.ShareOnFacebook = function(url, title)
 {
  var w = window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(url) + '&t=' + encodeURIComponent(title), 'rpodshr', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

  if ((w == null) || (w == undefined))
   {
   }
  else 
   {
    try { w.focus(); } catch (wtf) { }
   }

  return false;
 }

CORE.ShareOnBuzz = function(url, title)
 {
  var w = window.open('http://www.google.com/reader/link?url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title), 'rpodshr', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

  if ((w == null) || (w == undefined))
   {
   }
  else 
   {
    try { w.focus(); } catch (wtf) { }
   }

  return false;
 }

CORE.ShareOnVK = function(url, title)
 {
  var w = window.open('http://vkontakte.ru/share.php?url=' + encodeURIComponent(url), 'rpodshr', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

  if ((w == null) || (w == undefined))
   {
   }
  else 
   {
    try { w.focus(); } catch (wtf) { }
   }

  return false;
 }

CORE.ShareOnYaRu = function(url, title)
 {
  var w = window.open('http://wow.ya.ru/posts_add_link.xml?URL=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title), 'rpodshr', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

  if ((w == null) || (w == undefined))
   {
   }
  else 
   {
    try { w.focus(); } catch (wtf) { }
   }

  return false;
 }

CORE.ShareOnMyMail = function(url, title)
 {
  var w = window.open('http://connect.mail.ru/share?share_url=' + encodeURIComponent(url), 'rpodshr', 'width=700,height=400,left=100,top=10,resizable=yes,scrollbars=yes,status=no');

  if ((w == null) || (w == undefined))
   {
   }
  else 
   {
    try { w.focus(); } catch (wtf) { }
   }

  return false;
 }
