// JavaScript Document

function nuevoAjax() {
	
         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 cargaProyecto(ID){
		var contenido,ID;
		contenido = document.getElementById("proyecto");
		ajax=nuevoAjax(); 
		var tit ="tit"+ID;
		ajax.open("GET", "proyecto_"+ID+".html",true);
		
		if(ID==1){
			document.getElementById("proyectos").style.	backgroundColor="#990099";
			}
			
				if(ID==2){
			document.getElementById("proyectos").style.	backgroundColor="#669933";
			}	
	 ajax.onreadystatechange=function(){

		if (ajax.readyState==4) {
				
				
				 contenido.innerHTML = ajax.responseText;
					}
				}
				ajax.send(null)
			}
			

function cargaProyectoCat(ID){
		var contenido,ID;
		colors(ID);
		contenido = document.getElementById("proyectos");
		ajax=nuevoAjax(); 
		
		ajax.open("GET", "proyecto_cat.php?ID_p="+ID,true);
		

	 ajax.onreadystatechange=function(){

		if (ajax.readyState==4) {
		
				 contenido.innerHTML = ajax.responseText;
					}
				}
				ajax.send(null)
			}

function cargaProyectoEng(ID){
		var contenido,ID;
		colors(ID);
		contenido = document.getElementById("proyectos");
		ajax=nuevoAjax(); 
		
		ajax.open("GET", "proyecto_eng.php?ID_p="+ID,true);
		

	 ajax.onreadystatechange=function(){

		if (ajax.readyState==4) {
		
				 contenido.innerHTML = ajax.responseText;
					}
				}
				ajax.send(null)
			}
			
function normalitza(j){
	
	for(i=0;i<numProj;i++){
		var tit2="tit"+i;
	
		document.getElementById(tit2).style.color="#8A4F09";
		}
		var tita="tit"+j;
	document.getElementById(tita).style.color="#000000";
	}

function cargaProyectoEsp(ID,i){
		var contenido,ID;
		var tit="tit"+i;
		
		colors(ID);
		contenido = document.getElementById("proyectos");
		ajax=nuevoAjax(); 
		
		ajax.open("GET", "proyecto_esp.php?ID_p="+ID,true);
		normalitza(i);
		
	 ajax.onreadystatechange=function(){

		if (ajax.readyState==4) {
						
				 contenido.innerHTML = ajax.responseText;
				cargaFotos(0,ID);
				
					}
				}
				ajax.send(null)
			}


function cargaIdiomes(ID){
		var contenidoH,ID;
	 	
		contenidoH = document.getElementById("detalle");
		ajax2=nuevoAjax(); 
		
		ajax2.open("GET", "proyectos_idiomes.php?ID_p="+ID,true);
		

	 ajax2.onreadystatechange=function(){

		if (ajax2.readyState==4) {
		
				 contenidoH.innerHTML = ajax2.responseText;
					}
				}
				ajax2.send(null)
			}
	*/		
function colors(ID){
	var ID;
	if(ID==1){ document.getElementById("proyectos").style.backgroundColor="#CD0E8C";}
	if(ID==2){ document.getElementById("proyectos").style.backgroundColor="#147807";}
	if(ID==3){ document.getElementById("proyectos").style.backgroundColor="#070770";}
	if(ID==4){ document.getElementById("proyectos").style.backgroundColor="#006666";}
	if(ID==5){ document.getElementById("proyectos").style.backgroundColor="#FF6600";}
	if(ID==6){ document.getElementById("proyectos").style.backgroundColor="#990000";}
	if(ID==7){ document.getElementById("proyectos").style.backgroundColor="#CD0E8C";}
	if(ID==8){ document.getElementById("proyectos").style.backgroundColor="#147807";}
	if(ID==9){ document.getElementById("proyectos").style.backgroundColor="#070770";}
	if(ID==10){ document.getElementById("proyectos").style.backgroundColor="#006666";}
	if(ID==11){ document.getElementById("proyectos").style.backgroundColor="#FF6600";}
	if(ID==12){ document.getElementById("proyectos").style.backgroundColor="#990000";}
	if(ID==13){ document.getElementById("proyectos").style.backgroundColor="#CD0E8C";}
	if(ID==14){ document.getElementById("proyectos").style.backgroundColor="#147807";}
	if(ID==15){ document.getElementById("proyectos").style.backgroundColor="#070770";}
	if(ID==16){ document.getElementById("proyectos").style.backgroundColor="#006666";}
	if(ID==17){ document.getElementById("proyectos").style.backgroundColor="#FF6600";}
	if(ID==18){ document.getElementById("proyectos").style.backgroundColor="#990000";}
	
	
}
	
function cargaFotos(range,ID_p){
		var contenido,range,ID_p;

		contenido = document.getElementById("proyectos2");
		ajax=nuevoAjax(); 
		
		ajax.open("GET", "fotos.php?range="+range+"&ID_p="+ID_p,true);
		
		document.getElementById("proyectos2").selectionStart = 0;
		

	 ajax.onreadystatechange=function(){

		if (ajax.readyState==4) {
		
				 contenido.innerHTML = ajax.responseText;
					}
				}
				ajax.send(null)
			}
	
