$(document).ready( function() {
	if ($.id("#fechanac") ) {
		$("#fechanac").calendar({autoPopUp: 'both', buttonImageOnly: true,buttonImage: 'http://murke.net/wp-content/themes/murke/imag/auxi/auxiCale.gif', buttonText: '&Iacute;cono de calendario para fecha de inicio',firstDay: 1,dayNames: ['D','L','M','M','J','V','S'],monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agoto','Septiembre','Octubre','Noviembre','Diciembre'],currentText:'Hoy',nextText:'Sig&#187;',prevText:'&#171;Ant',closeText:'Cerrar',clearText:'Limpiar'});
	}

	var intval=window.setInterval(function(){
		$.getJSON("index.php",{"ajax":"json","total":"post"},function(datos){
			if (datos.totalPost != $("#nart").html()){
				$("#nart").html(datos.totalPost);
			}
	});
		$.getJSON("index.php",{"ajax":"json","total":"comment"},function(datos){
			if(datos.totalPost != $("#ncom").html()){
				$("#ncom").html(datos.totalComentarios);
			}
		});
		$.getJSON("index.php",{"ajax":"json","total":"commentText"},function(datos){
			 if ( $("#uc-first").children().attr('id') != "comment-" + datos.id){
				$("#uc-first").prepend(datos.ultimoComentario).hide().show();
			}
		});
	},
	60000);
});

jQuery.extend({
	id : function(id) {
		var id = id.split("#");
		return document.getElementById(id[1])?true:false;
	}
});