$(document).ready(function(){

    $(".hacerFavoritos").click(function(e){
        e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
        var bookmarkUrl = this.href;
        var bookmarkTitle = this.title;

        if (window.sidebar) { // For Mozilla Firefox Bookmark
            window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
        } else if( window.external || document.all) { // For IE Favorite
            window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
        } else if(window.opera) { // For Opera Browsers
            $("a.enlaceFavoritos").attr("href",bookmarkUrl);
            $("a.enlaceFavoritos").attr("title",bookmarkTitle);
            $("a.enlaceFavoritos").attr("rel","sidebar");
        } else { // for other browsers which does not support
            alert('Your browser does not support this bookmark action');
            return false;
        }
    });
});


function TamVentana() { //http://www.webintenta.com/obtener-el-tamano-de-la-ventana-del-navegador-o-viewport-con-javascript.html
    var Tamanyo = [0, 0];
    if (typeof window.innerWidth != 'undefined')
    {
        Tamanyo = [
        window.innerWidth,
        window.innerHeight
        ];
    }
    else if (typeof document.documentElement != 'undefined'
        && typeof document.documentElement.clientWidth !=
        'undefined' && document.documentElement.clientWidth != 0)
        {
        Tamanyo = [
        document.documentElement.clientWidth,
        document.documentElement.clientHeight
        ];
    }
    else   {
        Tamanyo = [
        document.getElementsByTagName('body')[0].clientWidth,
        document.getElementsByTagName('body')[0].clientHeight
        ];
    }
    return Tamanyo;
}



