$(document).ready(function(){
        $.ajax({
        });
});


//ajax para marcar tarea
ok=0;
function marcar_seguimiento(seguimiento,tarea){
$.ajax({
        type: "POST",
        url: "marcar.php",
        data: "procesa=1&campo="+tarea+"&seguimiento="+seguimiento,
        success: function(datos){
			eval(datos);
			//alert(datos);
			if(ok==1){
				// se hace lo pertienente por que la operacion funciono correctamente :)
				//cambiamos la estrella del titulo
				if(marcado==1){
				document.getElementById('marca').src='img/estrella-activa.gif';
				document.getElementById('opt_marca').src='img/desmarcar.gif';
				}else{
				document.getElementById('marca').src='img/estrella-inactiva.gif';
				document.getElementById('opt_marca').src='img/marcar.gif';
					}
				//alert('quitar');
				self.parent.tb_remove();
				//cambiamos el texto y el sthick de las opciones
			}
      }
});
}
//fin de ajax para marcar tarea

/*------------------------------------------------------------------------------------*/

// JavaScript Document
function nuevoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}
/*------------------------------------------------------------------------------------*/



function cargarsumamin(){
	var id, contenedor;
	contenedor = document.getElementById('min_asig');
	id = document.getElementById('trabajador').value;
	fecha = document.getElementById('fecha').value;
	ajax=nuevoAjax();
	ajax.open("GET", "funciones/sumar_minutos_asig.php?ID="+id+"&fecha="+fecha,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
		contenedor.innerHTML = "( "+ajax.responseText+" / 480 )";
		document.getElementById('minutos').value =(parseInt(480)-parseInt(ajax.responseText));
	 	}
	}
	ajax.send(null)
}
