function nuevoAjax()
{ 
	var xmlhttp=false; 
	try 
	{ 
		// No IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			// IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); } 
	return xmlhttp; 
}
 
function muestraMensaje(mensaje,nombre)
{
	divMensaje=document.getElementById(nombre);
	mensaje = "<font color=#C1272D>"+mensaje+"</font>"
	divMensaje.innerHTML=mensaje;
}


function EditarEnlace(){
	var tipo=document.form_enlaces.submit();
}

function borrar_not(seccion, id) {
	if(seccion == "galeria"){
		if(confirm("¿Está seguro de eliminar la Galeria y todas sus imágenes?")) {
				document.location.href=ruta_global+'imagenes-galeria-eliminar/'+id+'/';
		}
	}else if(seccion == "proyectos"){
		if(confirm("¿Está seguro de eliminar el Proyecto?")) {
				document.location.href=ruta_global+'proyectos-proyectos-eliminar/'+id+'/';
		}
	}else if(seccion == "noticias"){
		if(confirm("¿Está seguro de eliminar la Noticia?")) {
				document.location.href=ruta_global+'noticias-noticias-eliminar/'+id+'/';
		}
	}else if(seccion == "categoria"){
		if(confirm("¿Está seguro de eliminar la Categoria?")) {
				document.location.href=ruta_global+'documentos-categoria-eliminar/'+id+'/';
		}
	}else if(seccion == "archivos"){
		if(confirm("¿Está seguro de eliminar el Documento?")) {
				document.location.href=ruta_global+'documentos-archivos-eliminar/'+id+'/';
		}
	}else if(seccion == "usuarios"){
		if(confirm("¿Está seguro de eliminar el Usuario?")) {
				document.location.href=ruta_global+'administracion-usuarios-eliminar/'+id+'/';
		}
	}else if(seccion == "video"){
		if(confirm("¿Está seguro de eliminar el Video?")) {
				document.location.href=ruta_global+'video-galeria-eliminar/'+id+'/';
		}
	}else{
		if(confirm("¿Está seguro de eliminar el Registro?")) {
				//document.location.href=ruta_global+'proyectos-proyectos-eliminar/'+id+'/';
		}
	}
} 


//::::::::::::::::::::::::::::::::::::::::::::::::::::::
//POPUP IMAGENES
var newwindow;
var wheight = 0, wwidth = 0;
function popimg(url, title, iwidth, iheight, colour) {
	var pwidth, pheight;
	
	if ( !newwindow || newwindow.closed ) {
		pwidth=iwidth+30;
		pheight=iheight+30;
		newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
		wheight=iheight;
		wwidth=iwidth;
	}
	
	if (wheight!=iheight || wwidth!=iwidth ) {
		pwidth=iwidth+30;
		pheight=iheight+60;
		newwindow.resizeTo(pwidth, pheight);
		wheight=iheight;
		wwidth=iwidth;
	}
	
	newwindow.document.clear();
	newwindow.focus();
	newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
	newwindow.document.writeln('<a title="click para cerrar!" href="javascript:window.close();"><img src="'+ruta_global + url + '" border=0></a>');
	newwindow.document.writeln('<\/center> <\/body> <\/html>');
	newwindow.document.close();
	newwindow.focus();
}

function lanzar_form(){
	document.form_noticias.submit();
}

function cargar_documentos_cat(valor){
	window.location.href= ruta_global+"documentos-archivos-listado-"+valor+"/";
}