function fbs_click(){
    u=location.href;
    t=document.title;
    window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}
function twiter_click(){                            
    var u=location.href;                                
    var urlLength = location.href.length;
    var documentLength = document.title.length;
    var tamanio = documentLength + urlLength;
    
    var MaxTamanio = 140;
  
    var t = document.title;
                               
    if (tamanio  > MaxTamanio)
    {
        t = ''; 
        var TitlePalabras  = document.title.split (" ");
        var estado = true;
        var indice = TitlePalabras.length - 1;
        var tamanioDif = tamanio - MaxTamanio;
        while (estado)
        {                                    
           var tamanioWord =  TitlePalabras[indice].length;                                       
           TitlePalabras[indice] = '';
           indice = indice - 1;
           tamanioDif= tamanioDif - tamanioWord;
           if (indice < 0)
           {
                estado= false;
           }
           else if (tamanioDif <= 0)
           {
                estado= false;
           }                                      
        }
    
        for (var ind = 0 ; ind < TitlePalabras.length ; ind++)
        {
            if (TitlePalabras[ind] != '')
            {
                var NewTitle = t + ' ' + TitlePalabras[ind] + ' ... ' + u ;
                if (NewTitle.length < MaxTamanio)
                {
                   t = t + ' ' + TitlePalabras[ind];
                }
            }
        }
        
    }
    window.open('http://twitter.com/home?status=' + t  + ' ... ' + u ,'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}

function GetThisDelicious(){                            
    var T = document.title;
    var U = location.href;
    var targetUrl = 'http://del.icio.us/post?url=' + encodeURIComponent(U) + '&title=' + encodeURIComponent(T);
    window.open(targetUrl,'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}

function GetThis(){                            
    var T = document.title;
    var C = ' ';
    var U = location.href;
    var L = ' ';
    var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(T) + '&c=' + encodeURIComponent(C) + '&u=' + encodeURIComponent(U) + '&l=' + L;
    window.open(targetUrl,'sharer','toolbar=0,status=0,width=626,height=436');
    return false;
}
