
function share(s,title)
{
   title = (title!='')? encodeURIComponent(title) : encodeURIComponent(document.title);
   url = encodeURIComponent(location.href.replace(/#none/,""));
   
   src = "";
   switch(s) 
   {
      case 'vk': src = 'http://vkontakte.ru/share.php?url='+url+'&title='+title; break;
      case 'fb': src = 'http://www.facebook.com/sharer.php?u='+url; break; 
      case 'm': src = 'http://connect.mail.ru/share?share_url='+url; break;  
      case 'g': src = 'http://www.google.com/bookmarks/mark?op=add&bkmk='+url+'&title='+title; break; 
      case 'ok': src = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl='+url; break;   
      case 'tw': src = 'http://twitter.com/share?text='+title+'&url='+url; break; 
      case 'lj': src = 'http://www.livejournal.com/update.bml?event='+url+'&subject='+title;  break; 
//      case 'ya': src = 'http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&lurl='+url+'&lname='+title; break; 
   }
  
   open(src,"","width=700,height=500,resizable=1,status=1");
}  


function oWin(p)
{
  w="780"
  h="570"

  if(document.getElementById('screen') && document.getElementById('screen').clientWidth > 1024){
     w="980"
     h="770"
  }

  open("pages.php?"+p,"","width="+w+",height="+h+",scrollbars=1,resizable=1");
}

function openImg(url,iw,ih){

  wImg = open(url,'','width='+(parseInt(iw)+24)+', height='+(parseInt(ih)+24)+',scrollbars=1,resizable=1')

  wImg.document.open()
  wImg.document.write("<html><title>&copy; Gipsy Voice</title><body topmargin=0 leftmargin=0>")
  wImg.document.write("<a href='javascript:self.close()'><img src='"+url+"' width='"+iw+"' height='"+ih+"' alt='Закрыть окно' border=0></a>")
  wImg.document.write("</body></html>")
  wImg.document.close()

}

function openSmiles(){

  open('/smiles.php','','width=430, height=180')

}
