$(function() { 
	$.fn.externalLink = function(){        
        this.each(function(){
			$(this).find('a[rel="external"]').bind('click', function() { 
				window.open($(this).attr('href')); 
				return false; 
			});		
        });
        return this;
    };	
	$('.btn-cerrar').click(function(){
		$('.texto').hide('slow');
		$('.activo').removeClass('activo');
		return false;
	});
	$('.scrollbar').scrollbar();
});

function compartir(tipo,titulo) {
    //facebook
	//alert(titulo);
   // var URL = "http://esrajoy.granjerosweb.com";
    if (tipo == 1) {
		/*
        queURL = "http://www.facebook.com/dialog/feed?";
        queURL += "app_id=153545634719615&";
        queURL += "link=" + URL + "&";
        queURL += "picture=" + URL + "/img/cargando.gif&";
        queURL += "name=Rajoy&";
        queURL += "caption=" + decodeURIComponent(titulo) + "&";
        queURL += "description=" + decodeURIComponent(titulo) + "&";
        queURL += "redirect_uri=" + document.URL + "&";
        queURL += "message=" + decodeURIComponent("Compartido desde pruebas.es");
		*/
		queURL = "http://www.facebook.com/sharer.php?u=" + escape(document.URL);
    }
    //twitter
    else {
        queURL = "http://twitter.com/?status=" + document.URL;
    }
    window.open(queURL);

}
