$(document).ready(function() {
$("#content a[href$='.pdf']").filter(function() {
    return this.hostname && this.hostname == location.hostname;
}).attr('target', '_blank').addClass("external");
/*$("#content a[target$='_blank']").filter(function() {
    return this.hostname && this.hostname == location.hostname;
}).attr('target', '_blank').addClass("external");*/	
$("#maincontent a").filter(function() {
    return this.hostname && this.hostname !== location.hostname;
}).attr('target', '_blank').addClass("external");


/*$(".external").click(function() {
    var link = $(this).attr('href');
    $('<div>Est&aacute; a punto de abandonar www.pemex.com para dirigirse a: <br /> '+(link)+' <br /> &iquest;Est&aacute; seguro que desea continuar?</div>').dialog({
      title: "External Link",
      modal : true,
      overlay: {
        backgroundColor: '#000',
        opacity: 0.5
      },
      buttons: {
        'Si': function() {
          $(this).dialog('close').remove();
          window.open(link);
        },
        'No': function() {
          $(this).dialog('close').remove();
          return false;
        }
      }
    });
    return false;
 });*/

$(".external").click(function () { 
		  var x=window.confirm('Est\u00E1 a punto de dirigirse hacia un sitio fuera de PEMEX.com.  Para continuar haga clic en Aceptar.');
			var val = false;
			if (x)
				val = true;
			else
				val = false;
			return val;
 
        });
});
