/*********************************************************************************************/

/* Este script ha sido desarrollado exclusivamente para Feriempleo 2007. Queda terminantemente 

/* prohibida la copia y uso sin autorizacion escrita del autor: www.clubpaginasweb.com		 */

/*********************************************************************************************/

function objhttp(){

	try {

		objetus = new ActiveXObject("Msxml2.XMLHTTP");

	} catch (e) {

		try {

			objetus = new ActiveXObject("Microsoft.XMLHTTP");

		} catch (E) {

			objetus = false;

		}

	}

	if(!objetus && typeof XMLHttpRequest!='undefined'){

		objetus = new XMLHttpRequest();

	}

	return objetus;

}



function mostrarEmpleado(id, accion){//Agregada el 02-Sept-2008

	_objcroquishttp = objhttp();

	_URL = "/actor.php?";//poner la maldita pleca antes del nombre del archivo cuando se esta utilizando urls amigables

	_URL += "idEmpleado=" + id;

	_URL += "&tipoAccion=" + accion;

	_objcroquishttp.open("GET",_URL,true);

	_elDiv = "emp" + id

	_objcroquishttp.onreadystatechange=function(){

		if(_objcroquishttp.readyState==1) {

			document.getElementById(_elDiv).innerHTML = "Cargando los datos del empleado...";

		}

		if(_objcroquishttp.readyState==4) {

			var response = _objcroquishttp.responseText;

			document.getElementById(_elDiv).innerHTML = response;

		}

	}

	_objcroquishttp.send(null);

}



function imprimir(){

	window.print();

}



function confirmarBorradoNoti(id, noticia){

	var respuesta = confirm("¿Esta seguro que desea borrar la noticia " + noticia + "?");

	if(respuesta){

		location.href='eliminar.php?idnoti=' + id;

	} else {

		return false;

	}

}



function confirmarBorradoRef(id, referencia){

	var respuesta = confirm("¿Esta seguro que desea borrar la referencia " + referencia + "?");

	if(respuesta){

		location.href='eliminar.php?idref=' + id;

	} else {

		return false;

	}

}



function confirmarBorradoUrl(id, url){

	var respuesta = confirm("¿Esta seguro que desea borrar el sitio " + url + "?");

	if(respuesta){

		location.href='eliminar.php?idsitio=' + id + '&sitio=' + url;

	} else {

		return false;

	}

}



function confirmarBorradoCliente(id, cliente){

	var respuesta = confirm("¿Esta seguro que desea borrar el cliente " + cliente + "?");

	if(respuesta){

		location.href='eliminar.php?idcliente=' + id + '&cliente=' + cliente;

	} else {

		return false;

	}

}



function editarUrl(id){

	location.href='editarurl.php?idsitio=' + id;

}



function editarRef(id){

	location.href='nuevareferencia.php?editar=' + id;

}



function editarCliente(id){

	location.href='nuevocliente.php?editar=' + id;

}



function cancelar(pag){

	location.href=pag;

}



id = 0;

function cargarNoticias(){

	id = id + 1;

	if(id == 5){

		id = 1;

	}

	_objcroquishttp = objhttp();

	_URL = "/actor.php?";//poner la maldita pleca antes del nombre del archivo cuando se esta utilizando urls amigables

	_URL += "noticia=" + id;

	_objcroquishttp.open("GET",_URL,true);

	_objcroquishttp.onreadystatechange=function(){

		/*if(_objcroquishttp.readyState==1) {

			document.getElementById("reciente").innerHTML = "Cargando los datos del empleado...";

		}*/

		if(_objcroquishttp.readyState==4) {

			var response = _objcroquishttp.responseText;

			document.getElementById("reciente").innerHTML = response;

		}

	}

	_objcroquishttp.send(null);

	setTimeout("cargarNoticias()", 3000);

}