// JavaScript Document



if (document.all)
  document.write('<link rel="stylesheet" href="css/fuentesIE.css" type="text/css">')


/*function cargaPagina(url,div,parametros)
{
	new Ajax(url,{method: 'post', postBody:parametros, update:div}).request();
}*/
function cargaPagina(url,div,parametros)
{
	//new Ajax(url,{method: 'post', postBody:parametros, update:div}).request();
	
	new Request(
	{
		method: 'post',
		url: url,
		evalScripts: true,
		onSuccess: function(texto){
		$(div).innerHTML = texto;}
	}).send(parametros);
}
function bajaSeccion(sec,alto){

			//cargaPagina('includes/cargando.php', 'div_general');
			/*$('div_general').innerHTML = '<div style="float:left; display:inline; width:100%; height:auto; text-align:center; margin-top:50px;"><div style="float:left; display:inline; width:100%; height:auto;"><img src="../imagenes/cargando.gif" alt="Cargando..." title="Cargando..." /></div><div style="float:left; display:inline; width:100%; height:auto; font-family:\'Unit-Regular\', Myriad Pro, sans-serif; font-size:10px; color:#000000; font-style:italic;">CARGANDO...</div></div>';*/
			cargaPagina("includes2/i"+sec+".php","div_general")
			/*$("div_general").set('tween', {duration: '500'});
			$("div_general").tween('height', alto);		*/
		
}
function subeSeccion(seccion,alto){
			//cargaPagina('../includes2/ineolith.php', 'div_general');
			/*if($('div_general').style.height == 'auto')
				$('div_general').style.height = $('div_general').offsetHeight+'px';
			$("div_general").set('tween', {duration: '500'});
			$("div_general").tween('height', '0');	*/
			switch(seccion){
				case 'index':
				var x = setTimeout("bajaSeccion('index',433)",500);
			
				break;
				case 'empresa':
				var x = setTimeout("bajaSeccion('empresa',741)",500);
				break;
				case 'neolith':
				var x = setTimeout("bajaSeccion('neolith',458)",500);
				break;
				case 'aplicaciones':
				var x = setTimeout("bajaSeccion('aplicaciones',433)",500);
				break;
				case 'proyectos':
				var x = setTimeout("bajaSeccion('proyectos',460)",500);
				break;
				case 'catalogo':
				var x = setTimeout("bajaSeccion('catalogo',636)",500);
				break;
				case 'contacto':
				var x = setTimeout("bajaSeccion('contacto',1032)",500);
				break;
				case 'noticias':
				var x = setTimeout("bajaSeccion('noticias',433)",500);
				break;
				case 'distribuidores':
				var x = setTimeout("bajaSeccion('distribuidores',393)",500);
				break;
				case 'videos':
				var x = setTimeout("bajaSeccion('videos',393)",500);
				break;				
			}
			
}

function bajaSubSeccion(sec,alto){
		
			if(sec != 'aplicaciones'){
				cargaPagina("includes3/ii"+sec+".php","div_txt_neolith")
				//$("div_txt_neolith").set('tween', {duration: '500'});
				//$("div_txt_neolith").style.height= alto+"px";
				if(sec=='neolith'){
					sec='producto'
					
				}
			}else{
				
			}
			
			
			setTimeout("cambiaImagen('"+sec+"')",500);
			
		
}
function subeSubSeccion(seccion){

			/*if($('div_txt_neolith'))
				nuevoAltoDivGeneral = 433 + $('div_txt_neolith').offsetHeight + 25;
			$("div_general").style.height = nuevoAltoDivGeneral+"px";*/
			
			//document.getElementById("div_general").style.height = "auto";
			//$("div_txt_neolith").set('tween', {duration: '500'});
			//$("div_txt_neolith").tween('height', '0');	
			switch(seccion){
				case 'neolith':
				var x = setTimeout("bajaSubSeccion('neolith',550)",500);
				break;
				case 'medio_ambiente':
				var x = setTimeout("bajaSubSeccion('medio_ambiente',260)",500);
				break;
				case 'aplicaciones':
				//var x = setTimeout("bajaSubSeccion('aplicaciones',0)",500);
				//setTimeout("cambiaImagen('"+seccion+"')",500);
				window.location="neolith.php";
				break;
				case 'colores':
				var x = setTimeout("bajaSubSeccion('colores',200)",500);
				break;
				case 'caracteristicas':
				var x = setTimeout("bajaSubSeccion('caracteristicas',781)",500);
				break;

				case 'div_amarillo_seccion1':
				var x = setTimeout("bajaSubSeccion('aplicaciones_oficinas',790)",500);
				break;
				case 'div_amarillo_seccion2':
				var x = setTimeout("bajaSubSeccion('aplicaciones_oficinas',790)",500);
				break;
				case 'div_amarillo_seccion3':
				var x = setTimeout("bajaSubSeccion('aplicaciones_oficinas',790)",500);
				break;
				case 'div_amarillo_seccion4':
				var x = setTimeout("bajaSubSeccion('aplicaciones_oficinas',790)",500);
				break;
				case 'div_amarillo_seccion5':
				var x = setTimeout("bajaSubSeccion('aplicaciones_oficinas',790)",500);
				break;

				
			}
			
}

function cambiaFondoBoton(div){
	if(div=='index'){
		document.getElementById("btn_"+div).style.background="url(imagenes/logo_index2.jpg)";
	}else if(div=='neolith'){
		document.getElementById("btn_"+div).style.background="url(imagenes/logo_neolith2.jpg)";
	}
	else{
		document.getElementById("btn_"+div).style.background="url(imagenes/fondo_menu2.gif)";
	}
	
	
}

function cambiaFondoBoton2(tipo, div){
	//Tipo 1 = onmouseout; tipo 2 = onclick

	if(tipo == 1){
		if(window['menuSuperior_desplegado']==div){
			
		}else{
			if(window['menuSuperior_desplegado']=='index' && (div=='index' || div=='neolith')){
				if(div=='index'){
					document.getElementById("btn_"+div).style.background="url(imagenes/logo_index1.jpg)";
				}else{
					document.getElementById("btn_"+div).style.background="url(imagenes/logo_neolith1.jpg)";
				}
				
				
			}else{
				if(div=='index'){
					document.getElementById("btn_"+div).style.background="url(imagenes/logo_index1.jpg)";
				}else if(div=='neolith'){
					document.getElementById("btn_"+div).style.background="url(imagenes/logo_neolith1.jpg)";
				}
				else{
					document.getElementById("btn_"+div).style.background="url(imagenes/fondo_menu1.gif)";
				}
				
			}
			
		}
		
		
	}
		//";
	else if(tipo == 2)
	{	
		if(div=='index'){
			if(window['menuSuperior_desplegado']=='neolith'){
				
				document.getElementById("btn_"+window['menuSuperior_desplegado']).style.background="url(imagenes/logo_neolith1.jpg)";
			}else{
				document.getElementById("btn_"+window['menuSuperior_desplegado']).style.background="url(imagenes/fondo_menu1.gif)";
			}
			document.getElementById("btn_"+div).style.background="url(imagenes/logo_index2.jpg)";
			window['menuSuperior_desplegado'] = div;
		}else if(div=='neolith'){
			if(window['menuSuperior_desplegado']=='index'){
				
				document.getElementById("btn_"+window['menuSuperior_desplegado']).style.background="url(imagenes/logo_index1.jpg)";
			}else{
				document.getElementById("btn_"+window['menuSuperior_desplegado']).style.background="url(imagenes/fondo_menu1.gif)";
			}
			
			document.getElementById("btn_"+div).style.background="url(imagenes/logo_neolith2.jpg)";
			window['menuSuperior_desplegado'] = div;
		}
		else{
			if(window['menuSuperior_desplegado']== 'index'){
				document.getElementById("btn_"+window['menuSuperior_desplegado']).style.background="url(imagenes/logo_index1.jpg)";
				document.getElementById("btn_"+div).style.background="url(imagenes/fondo_menu1.gif)";
				window['menuSuperior_desplegado'] = div;	

			}else if(window['menuSuperior_desplegado']== 'neolith'){
				document.getElementById("btn_"+window['menuSuperior_desplegado']).style.background="url(imagenes/logo_neolith1.jpg)";
				document.getElementById("btn_"+div).style.background="url(imagenes/fondo_menu1.gif)";
				window['menuSuperior_desplegado'] = div;
			}
			else{
				document.getElementById("btn_"+window['menuSuperior_desplegado']).style.background="url(imagenes/fondo_menu1.gif)";
				document.getElementById("btn_"+div).style.background="url(imagenes/fondo_menu2.gif)";
				window['menuSuperior_desplegado'] = div;	
			}
				
		}
		
	}
	
}

function cambiaFondo_menuNeolith(tipo, id){
	//Tipo 1 = onmouseout; tipo 2 = onclick
	if(tipo == 1 && $('menuNeolith_desplegado').value != id)
		document.getElementById("menuNeolith_"+id).style.color="#000000";
	else if(tipo == 2)
	{
		document.getElementById("menuNeolith_"+$('menuNeolith_desplegado').value).style.color="#000000";
		document.getElementById("menuNeolith_"+id).style.color="#FFFFFF";
		$('menuNeolith_desplegado').value = id;
	}
}

function cambiaColor_menuNeolith(tipo, id){
	//Tipo 1 = onmouseover; tipo 2 = onmouseout; tipo 3 = onclick
	if(tipo == 1)
		$('menu_proyectos_'+id).style.color = '#000000';
	else if(tipo == 2 && $('menuProyectos_desplegado').value != id)
		document.getElementById("menu_proyectos_"+id).style.color="#FFFFFF";
	else if(tipo == 3)
	{
		document.getElementById("menu_proyectos_"+$('menuProyectos_desplegado').value).style.color="#FFFFFF";
		document.getElementById("menu_proyectos_"+id).style.color="#000000";
		$('menuProyectos_desplegado').value = id;
	}
}

function cambiaImagen_izq(div,array_fotos){
	
	
	back_anterior=document.getElementById(div).style.backgroundImage;
	pos=0;
	
	for (i=0;i<array_fotos.length;i++){ 
		url='url("fotos/'+array_fotos[i]+'")';
		
		
		if(url == back_anterior){
			break;
		}
		pos++;
	}
	
	if(pos>0){
		document.getElementById(div).style.background="url(fotos/"+array_fotos[pos-1]+")";
	}else{
		
	}
	
	
}
function cambiaImagen_der(div,array_fotos){
	
	back_anterior=document.getElementById(div).style.backgroundImage;
	pos=0;
	
	for (i=0;i<array_fotos.length;i++){ 
		url='url("fotos/'+array_fotos[i]+'")';
		
		
		if(url == back_anterior){
			break;
		}
		pos++;
	}
	
	if(pos < array_fotos.length-1){
		document.getElementById(div).style.background="url(fotos/"+array_fotos[pos+1]+")";
	}else{
		
	}
	
	
}

function muestra_div_colores1(){
	if(document.getElementById("div_colores1").style.display=="inline"){
		document.getElementById("flecha1_colores").src="imagenes/flecha_izq.gif";
		document.getElementById("div_colores1").style.display="none"
		//document.getElementById("div_txt_neolith").style.height="200px";
		document.getElementById("flecha2_colores").src="imagenes/flecha_izq.gif";
		
	}else{	
		document.getElementById("flecha1_colores").src="imagenes/flecha_abajo_gif.gif";
		document.getElementById("div_colores1").style.display="inline";
		document.getElementById("div_colores2").style.display="none";
		//document.getElementById("div_txt_neolith").style.height="400px";
		document.getElementById("flecha2_colores").src="imagenes/flecha_izq.gif";
		
	}
	
	
	
	
}
function muestra_div_colores2(){
	if(document.getElementById("div_colores2").style.display=="inline"){
		document.getElementById("flecha2_colores").src="imagenes/flecha_izq.gif";
		document.getElementById("div_colores2").style.display="none"
		//document.getElementById("div_txt_neolith").style.height="200px";
		document.getElementById("flecha1_colores").src="imagenes/flecha_izq.gif";
	}else{
		document.getElementById("flecha2_colores").src="imagenes/flecha_abajo_gif.gif";
		document.getElementById("div_colores2").style.display="inline";
		document.getElementById("div_colores1").style.display="none";
		//document.getElementById("div_txt_neolith").style.height="490px";
		document.getElementById("flecha1_colores").src="imagenes/flecha_izq.gif";
	}
	
	
}
function cambiarImagenColor(tipo,color){
	
	if(tipo==1){

		$("img_colores_principal").src="fotos/"+color;
	
	}else{
		$("img_colores_principal").src="fotos/"+color;
	
	}
	
}

function cargaColoresColorfeel(){
	
                    fotos_colorfeel=new Array(10);
                    fotos_colorfeel[0]='Arancio.jpg';
                    fotos_colorfeel[1]='Avorio.jpg';
                    fotos_colorfeel[2]='Chocolate.jpg';
                    fotos_colorfeel[3]='Cobalto.jpg';
                    fotos_colorfeel[4]='Humo.jpg';
                    fotos_colorfeel[5]='Mela.jpg';
                    fotos_colorfeel[6]='Moka.jpg';
                    fotos_colorfeel[7]='Nero.jpg';
                    fotos_colorfeel[8]='Nieve.jpg';
                    fotos_colorfeel[9]='Perla.jpg';
                    
                    string_colores="";
                    for(i=1;i<10;i++){
                        
                        nom=fotos_colorfeel[i].split(".");
						
						string_colores +=  "<div class='div_color' onclick='cambiarImagenColor(1,\""+fotos_colorfeel[i]+"\")'><img  alt='' src='imagenes/colores/colorfeel/"+fotos_colorfeel[i]+"' class='img_color'  /><div class='texto_color'> "+i+" / "+nom[0]+"</div></div>"
                       /* document.write("<div class='div_color' onclick='cambiarImagenColor(1,\""+fotos_colorfeel[i]+"\")'> ");
                        document.write("<img  alt='' src='imagenes/colores/colorfeel/"+fotos_colorfeel[i]+"' class='img_color'  />");
                        document.write("<div class='texto_color'> "+i+" / "+nom[0]+"</div>");
                        document.write("</div>");*/
						
                    }
					document.getElementById("div_colores1").innerHTML=string_colores;
                        
                
	
	
	
}

function cargaColoresFusion(){
	
	
                    fotos_fusion=new Array(11);
                    fotos_fusion[0]='Arena.jpg';
                    fotos_fusion[1]='Barro.jpg';
                    fotos_fusion[2]='Basalt-Beige.jpg';
                    fotos_fusion[3]='Basalt-Black.jpg';
                    fotos_fusion[4]='Basalt-Grey.jpg';
                    fotos_fusion[5]='Belgian-Blue.jpg';
                    fotos_fusion[6]='Cement.jpg';
                    fotos_fusion[7]='Carbono-Black.jpg';
                    fotos_fusion[8]='Carbono-White.jpg';
                    fotos_fusion[9]='Lava.jpg';
                    fotos_fusion[10]='Phedra.jpg';
                    string_colores="";
                    
                    for(i=0;i<=10;i++){
                        
                        nom=fotos_fusion[i].split(".");
						string_colores +=  "<div class='div_color' onclick='cambiarImagenColor(2,\""+fotos_fusion[i]+"\")'><img  alt='' src='imagenes/colores/fusion/"+fotos_fusion[i]+"' class='img_color'  /><div class='texto_color'> "+(i+11)+" / "+nom[0]+"</div></div>"
                       /* document.write("<div class='div_color' onclick='cambiarImagenColor(2,\""+fotos_fusion[i]+"\")'> ");
                        document.write("<img  alt='' src='imagenes/colores/fusion/"+fotos_fusion[i]+"' class='img_color'  />");
                        document.write("<div class='texto_color'> "+(i+11)+" / "+nom[0]+"</div>");
                        document.write("</div>");*/
                    }
                        
                document.getElementById("div_colores2").innerHTML=string_colores;
                
                
}
function muestraFlechas(s){
	if(s=='der'){
		$("flecha2").set('tween', {duration: '1000'});
		$("flecha2").tween('opacity', 1);
	}else{
		$("flecha1").set('tween', {duration: '1000'});
		$("flecha1").tween('opacity', 1);	
	}
	
	
	
}
function ocultaFlechas(s){
	if(s=='der'){
		$("flecha2").set('tween', {duration: '1000'});
		$("flecha2").tween('opacity', 0);
	}else{
		$("flecha1").set('tween', {duration: '1000'});
		$("flecha1").tween('opacity', 0);	
	}
	
	
	
}
function muestraFlechasP(s,n){
	if(s=='der'){
		$("flechader"+n).set('tween', {duration: '1000'});
		$("flechader"+n).tween('opacity', 1);
	}else{
		$("flechaizq"+n).set('tween', {duration: '1000'});
		$("flechaizq"+n).tween('opacity', 1);	
	}
	
	
	
}
function ocultaFlechasP(s,n){
	if(s=='der'){
		$("flechader"+n).set('tween', {duration: '1000'});
		$("flechader"+n).tween('opacity', 0);
	}else{
		$("flechaizq"+n).set('tween', {duration: '1000'});
		$("flechaizq"+n).tween('opacity', 0);	
	}
	
	
	
}
function muestraFlechasN(s,n){
	if(s=='der'){
		$("flechader"+n).set('tween', {duration: '1000'});
		$("flechader"+n).tween('opacity', 1);
	}else{
		$("flechaizq"+n).set('tween', {duration: '1000'});
		$("flechaizq"+n).tween('opacity', 1);	
	}
	
	
	
}
function ocultaFlechasN(s,n){
	if(s=='der'){
		$("flechader"+n).set('tween', {duration: '1000'});
		$("flechader"+n).tween('opacity', 0);
	}else{
		$("flechaizq"+n).set('tween', {duration: '1000'});
		$("flechaizq"+n).tween('opacity', 0);	
	}
	
	
	
}

function eventosFlechas(div){
	 $(div).addEvent('mouseover', function() {
         muestraFlechas();
      });
	   $(div).addEvent('mouseout', function() {
         ocultaFlechas();
      });
	
}

function mustra_prensa(s){
	document.getElementById("img_prensa").style.width="847px";
	document.getElementById("img_prensa").style.height="1134px";
	document.getElementById("img_prensa").src="fotos/"+s+".jpg";
	document.getElementById("div_general").style.height="1360px";
	
	
}
function cambiaImagen(sec){
	origen="absolute_"+window["paginaNeolith"];
	destino="absolute_"+sec;
		$(origen).set('tween', {duration: '1000'});
		$(origen).tween('opacity', 0);
		t=setTimeout("document.getElementById(origen).style.zIndex=1;",1000)
		setTimeout('clearTimeout(t)',2000);
		
		$(destino).set('tween', {duration: '1000'});
		$(destino).tween('opacity', 1);
		window["paginaNeolith"]=sec
		t2=setTimeout("document.getElementById(destino).style.zIndex=2;",1000)
		setTimeout('clearTimeout(t2)',2000);
		
}
function cambiaImagenProyectos(sec){
	origen="absolute_"+window["paginaProyecto"];
	destino="absolute_"+sec;
	$(origen).set('tween', {duration: '500'});
	$(origen).tween('opacity', 0);
	t=setTimeout("document.getElementById(origen).style.zIndex=1;",500)
	setTimeout('clearTimeout(t)',500);
	
	$(destino).set('tween', {duration: '500'});
	$(destino).tween('opacity', 1);
	window["paginaProyecto"]=sec
	t2=setTimeout("document.getElementById(destino).style.zIndex=2;",500)
	setTimeout('clearTimeout(t2)',500);
	
	
}
function baja_texto_proyecto(sec){
	tipo=sec.substr(8,1)
	
	$("div_fondo2_proyectos").set('tween', {duration: '500'});
	$("div_fondo2_proyectos").tween('height',205);
	cargaPagina("textos_proyectos.php","textoProyecto","tipo="+tipo);
	
	document.getElementById("div_general").style.height ='433px'
	$("div_general").set('tween', {duration: '500'});
	$("div_general").tween('height',666);
}
function sube_texto_proyecto(sec){
	
	tipo=sec.substr(8,1)
	
	$("div_fondo2_proyectos").set('tween', {duration: '500'});
	$("div_fondo2_proyectos").tween('height',0);
	
	
	setTimeout("baja_texto_proyecto('"+sec+"')",500);
	
}
function subeTextoProyectos(sec){
			tipo=sec;
			cargaPagina("textos_proyectos.php","textoProyecto","tipo="+tipo);
			$("div_fondo2_proyectos").style.height="205px";
			/*document.getElementById("div_general").style.height ='auto'
			if(document.getElementById("div_fondo2_proyectos").style.height =='205px'){
				
				sube_texto_proyecto(sec);
			}else{
				
				//cargaPagina("textos_proyectos.php","textoProyecto","tipo="+tipo);
				//$("div_fondo2_proyectos").set('tween', {duration: '500'});
				//$("div_fondo2_proyectos").tween('height',205);
				$("div_fondo2_proyectos").style.height="205px";
				

			}*/
	setTimeout("cambiaImagenProyectos('"+sec+"')",500);
	
	
}

function rotaImagenesEmpresa(){
var hs2 = new noobSlide({box: $('box2'),items: [1,2,3,4,5,6,7,8,9,10],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev1'),next: $('next1')}});

}

function rotaImagenesHome(){
var hs2 = new noobSlide({box: $('box2'),items: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev1'),next: $('next1')}});

}
function rotaImagenesProducto(){
var hs2 = new noobSlide({box: $('box2'),items: [1,2,3,4,5,6,7,8,9,10,11,12],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev1'),next: $('next1')}});

}
function rotaImagenesAmbiente(){
var hs2 = new noobSlide({box: $('box3'),items: [1,2,3],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev2'),next: $('next2')}});

}
function rotaImagenesCaracteristicas(){
var hs2 = new noobSlide({box: $('box10'),items: [1,2],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev4'),next: $('next4')}});

}

//rotarimagenes proyectos

function rotaImagenesProyecto1(){
var hs2 = new noobSlide({box: $('box1'),items: [1,2],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev1'),next: $('next1')}});

}
function rotaImagenesProyecto2(){
var hs2 = new noobSlide({box: $('box2'),items: [1,2,3],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev2'),next: $('next2')}});

}
function rotaImagenesProyecto3(){
var hs2 = new noobSlide({box: $('box3'),items: [1,2],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev3'),next: $('next3')}});

}



function rotaImagenesProyecto5(){
var hs2 = new noobSlide({box: $('box5'),items: [1,2],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev5'),next: $('next5')}});

}
function rotaImagenesProyecto6(){
var hs2 = new noobSlide({box: $('box6'),items: [1,2],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev6'),next: $('next6')}});

}
function rotaPrensa(){
	var hs2 = new noobSlide({box: $('box1'),items: [1,2,3,4],interval: 3000,fxOptions: {duration: 1000,wait: false},size: 158,buttons: {previous: $('prev1'),next: $('next1')}});


}
function rotaImagenesap1(){
var hs2 = new noobSlide({box: $('boxapp1'),items: [1,2,3],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev100'),next: $('next100')}});

}
function rotaImagenesap2(){
var hs2 = new noobSlide({box: $('boxapp2'),items: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev200'),next: $('next200')}});

}
function rotaImagenesap3(){
var hs2 = new noobSlide({box: $('boxapp3'),items: [1,2,3,4,5],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev300'),next: $('next300')}});

}
function rotaImagenesap4(){
var hs2 = new noobSlide({box: $('boxapp4'),items: [1,2,3,4,5,6,7],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev400'),next: $('next400')}});

}
function rotaImagenesap5(){
var hs2 = new noobSlide({box: $('boxapp5'),items: [1,2,3,4,5,6],interval: 3000,fxOptions: {duration: 1000,wait: false},buttons: {previous: $('prev500'),next: $('next500')}});

}
function cambiaPrensa(s){
	document.getElementById("img_prensa").src="fotos/"+s+"2.jpg";
	//bajaPrensa();
}
function subePrensa(s){
	setTimeout("cambiaPrensa('"+s+"')",500);
	//setTimeout('bajaPrensa()',500);
	//$("div_img_neolith_prensa").set('tween', {duration: '500'});
	//$("div_img_neolith_prensa").tween('height', 0);	
	//$("div_general").set('tween', {duration: '500'});
	//$("div_general").tween('height', 225);
	
		
	
}
function bajaPrensa(){
	//$("div_img_neolith_prensa").set('tween', {duration: '500'});
	//$("div_img_neolith_prensa").tween('height', 1230);	
	//$("div_general").set('tween', {duration: '500'});
	//$("div_general").tween('height', 1453);
}
function DeslizaPrensa(s){
		//h=((document.getElementById("div_img_neolith_prensa").style.height).split('px'))
		document.getElementById("div_general").style.height="auto"
		//if(h[0] > 0){
			subePrensa(s);
		//}else{
		//	bajaPrensa();
		//}
		//document.getElementById("img_prensa").style.width="847px";
		//document.getElementById("img_prensa").style.height="1134px";
		//document.getElementById("img_prensa").src="fotos/"+s+".jpg";
		//document.getElementById("div_general").style.height="1360px";

}

function cargaNacionales(){
		
			$("div_general").style.height = 'auto';
			var s = document.getElementById('sel_dist_1');
			var v = s.options[s.selectedIndex].innerHTML;
			var vNum = s.options[s.selectedIndex].value;

	//	v=document.getElementById("sel_dist_1").value;
		
		//var vv = v.options[v.selectedIndex].value;

			cargaPagina("includes/listar_distribuidores.php","datos_distribuidor","loc="+vNum+"&locNombre="+v);
			document.getElementById("datos_distribuidor").style.display="inline";
			document.getElementById("datos_distribuidor2").style.display="none";		
			
}

 function cargaInternacionales(){
			$("div_general").style.height = 'auto';
			var s = document.getElementById('sel_dist_2');
			var v2 = s.options[s.selectedIndex].innerHTML;
			var vNum2 = s.options[s.selectedIndex].value;
			
			cargaPagina("includes/listar_distribuidores2.php","datos_distribuidor2","loc="+vNum2+"&locNombre="+v2);
			document.getElementById("datos_distribuidor2").style.display="inline";
			document.getElementById("datos_distribuidor").style.display="none";
}		

function pagSiguienteAnterior(tipo, pag){
	//Tipo = 1, opcion siguiente; Tipo = 2, opcion anterior
	alert(tipo+'_'+pag)
	if(tipo == 1)
	{
		for(a=pag; a<(pag+5); a++)
			$('resultado_'+a).style.display = 'inline';
	}
}

function cambiaAplicacion(s){
	origen="absolute_"+window["paginaaplicacion"];	
	destino="absolute_"+s;
	$('menu_aplicaciones').style.display='inline';	
		$(origen).set('tween', {duration: '1000'});
		$(origen).tween('opacity', 0);
		t=setTimeout("document.getElementById(origen).style.zIndex=1;",1000)
		
		
		$(destino).set('tween', {duration: '1000'});
		$(destino).tween('opacity', 1);
		window["paginaaplicacion"]=s;
		t2=setTimeout("document.getElementById(destino).style.zIndex=2;",1000);
		
		subeTextoAplicaciones(s);
		
		
	
	
}
    function baja_texto_aplicacion(tipo){
	//$("txt_aplicacion").set('tween', {duration: '500'});
	//$("txt_aplicacion").tween('height',117);
	//cargaPagina("textos_aplicaciones.php","txt_aplicacion2","tipo="+tipo);
	
	//document.getElementById("div_general").style.height ='auto'
	//$("div_general").set('tween', {duration: '500'});
	//$("div_general").tween('height',541);
}
function sube_texto_aplicacion(tipo){
	
	//$("txt_aplicacion").set('tween', {duration: '500'});
	//$("txt_aplicacion").tween('height',0);
	
	
	//setTimeout("baja_texto_aplicacion('"+tipo+"')",500);
	
}
function subeTextoAplicaciones(sec){
			var tipo=sec;
			if(sec != 'aplicaciones2'){
				cargaPagina("textos_aplicaciones.php","txt_aplicacion2","tipo="+tipo)
				document.getElementById("txt_aplicacion").style.height="115px";	
			}else{
				cargaPagina("textos_aplicaciones.php","txt_aplicacion2","tipo="+tipo)
				document.getElementById("txt_aplicacion").style.height="0px";
					
			}
			window["paginaaplicacion"]=sec;
			/*document.getElementById("div_general").style.height ='auto'
			if(sec == 'aplicaciones2'){
				
			}else{
				if(document.getElementById("txt_aplicacion").style.height >'0px'){
					
					sube_texto_aplicacion(tipo);
				}else{
					
					cargaPagina("textos_aplicaciones.php","txt_aplicacion2","tipo="+tipo);
					//$("txt_aplicacion").set('tween', {duration: '500'});
					//$("txt_aplicacion").tween('height',117);
					
					
	
				}	
				
			}*/
			
	//setTimeout("cambiaImagenProyectos('"+sec+"')",500);
	
	
}

function cargaResultadosBusqueda(tipo){
	$('div_general').style.height = 'auto';
	
	if(tipo == 1)
	{
		cargaPagina('resultados.php', 'div_general', 'busqueda='+$('input_textoAbuscar').value);
		$('input_textoAbuscar2').value = $('input_textoAbuscar').value;
	}
	else if(tipo == 2)
		cargaPagina('resultados.php', 'div_general', 'busqueda='+$('input_textoAbuscar2').value);
}

function desaparece_barra(id){
	$(id).morph({opacity:'0.01'})	
}

function ver_barra(id){
	$(id).morph({opacity:'1'})	
}

function fundido(s,n){
	//alert(s+n);
	x=window['contador'];
	if(x==n)
	{
		window['contador']=1;
		$(s+x).set('tween', {duration: '1000'});
		$(s+x).tween('opacity', 0);
		
		$(s+'1').set('tween', {duration: '1000'});
		$(s+'1').tween('opacity', 1);	

	}else{
		$(s+(x)).set('tween', {duration: '1000'});
		$(s+(x)).tween('opacity', 0);	
		
		$(s+(x+1)).set('tween', {duration: '1000'});
		$(s+(x+1)).tween('opacity', 1);		
			
		window['contador'] = window['contador'] +1;
	}	
}

function fundidop(n,i){
	switch(i){
		case 1:
			s="monasterio"
		break;
		case 2:
			s="laboratorio"
		break;
		case 3:
			s="escuela"
		break;
		case 4:
			s="centro"
		break;
		case 5:
			s="bmw"
		break;
		case 6:
			s="nave"
		break;
			
	}
	x=window['contador'];
	
	
	
	if(x==n){
		window['contador']=1;
		$(s+x).set('tween', {duration: '1000'});
		$(s+x).tween('opacity', 0);
		
		$(s+'1').set('tween', {duration: '1000'});
		$(s+'1').tween('opacity', 1);	

	}else{
		$(s+x).set('tween', {duration: '1000'});
		$(s+x).tween('opacity', 0);
		
		$(s+(x+1)).set('tween', {duration: '1000'});
		$(s+(x+1)).tween('opacity', 1);	
		window['contador'] = window['contador'] +1 ;

	}
	
	
	
	
}
function fundidop_back(n,i){
	
	switch(i){
		case 1:
			s="monasterio"
		break;
		case 2:
			s="laboratorio"
		break;
		case 3:
			s="escuela"
		break;
		case 4:
			s="centro"
		break;
		case 5:
			s="bmw"
		break;
		case 6:
			s="nave"
		break;
			
	}
	
	if(window['contador'] == 1){
			$(s+'1').set('tween', {duration: '500'});
			$(s+'1').tween('opacity', 0);
				
			$(s+n).set('tween', {duration: '500'});
			$(s+n).tween('opacity', 1);
			x=window['contador']=n;
		}else{
			if(window['contador'] == 2){
				
				$(s+'2').set('tween', {duration: '500'});
				$(s+'2').tween('opacity', 0);
		
				$(s+'1').set('tween', {duration: '500'});
				$(s+'1').tween('opacity', 1);
				x=window['contador']=1;
			}else{
				window['contador']=window['contador'] - 1;
				x=window['contador'];
				
				$(s+(x-1)).set('tween', {duration: '500'});
				$(s+(x-1)).tween('opacity', 0);
				
				$(s+(x)).set('tween', {duration: '500'});
				$(s+(x)).tween('opacity', 1);	
			}	

		//window['contador'] = window['contador'] +1 ;

		}
}
function limpiaInterval(){
	
	clearInterval(window['int']);
}
function fundidoBack(s,n){
	
		if(window['contador'] == 1){
			$(s+'1').set('tween', {duration: '500'});
			$(s+'1').tween('opacity', 0);
				
			$(s+n).set('tween', {duration: '500'});
			$(s+n).tween('opacity', 1);
			x=window['contador']=n;
		}else{
			if(window['contador'] == 2){
				
				$(s+'2').set('tween', {duration: '500'});
				$(s+'2').tween('opacity', 0);
				
				$(s+'1').set('tween', {duration: '500'});
				$(s+'1').tween('opacity', 1);
				x=window['contador']=1;
			}else{
				window['contador']=window['contador'] - 1;
				x=window['contador'];
				
				$(s+(x+1)).set('tween', {duration: '500'});
				$(s+(x+1)).tween('opacity', 0);
				
				$(s+(x)).set('tween', {duration: '500'});
				$(s+(x)).tween('opacity', 1);	
			}	

		//window['contador'] = window['contador'] +1 ;
			
		}
	
	
}

function rotaFundidoGeneral(nombre,n){
	limpiaInterval();
	window['contador']=1;
	window['int'] = setInterval("fundido('"+nombre+"',"+n+")", 4000);	
}



function rotaFundidoHome(n){
	limpiaInterval();
	window['contador']=1;
	window['int'] = setInterval("fundido('orderHome',"+n+")", 4000);	
}
function rotaFundidoEmpresa(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('Empresa',"+n+")", 4000);
	
}
function rotaFundidoProducto(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('orderProducto',"+n+")", 4000);
	
}
function rotaFundidoMedio(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('med_amb',"+n+")", 4000);
	
}
function rotaFundidoCaract(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('caract',"+n+")", 4000);
	
}



function rotaFundidoCocinas(n){
	
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('cocina',"+n+")", 4000);
	
}
function rotaFundidoBanos(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('banos',"+n+")", 4000);
	
}
function rotaFundidoPavimentos(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('pav',"+n+")", 4000);
	
}
function rotaFundidoRevestimientos(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('rev',"+n+")", 4000);
	
}
function rotaFundidoFachadas(n){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundido('fach',"+n+")", 4000);
	
}
function rotaFundidoProyecto(n,i){
	limpiaInterval()
	window['contador']=1;
	window['int'] = setInterval("fundidop("+n+","+i+")", 4000);
	
}

function muestra_oculta_pdf(){
	if($('div_docum_pdf').style.display=='none')	
		$('div_docum_pdf').style.display='inline';
	else
		$('div_docum_pdf').style.display='none';
}

function cargaVideo(video)
{
	$('player').href = video;
	flowplayer("player", "../flowplayer-3.2.7.swf");	
}

function cargaVideoYoutube(video)
{
	var flash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="948" height="434" align="middle">';
	flash += '<param name="allowScriptAccess" value="sameDomain" />';
	flash += '<param id="paramVideo" name="movie" value="' + video + '" />';
	flash += '<param name="quality" value="high" />';
	flash += '<param name="wmode" value="transparent" />';
	flash += '<param name="allowScriptAccess" value="sameDomain" />';
	flash += '<embed id="embedVideo" wmode="transparent" src="' + video + '" quality="high" width="948" height="434" align="middle" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />';
	flash += '</object>';
	document.getElementById('player').innerHTML = flash; 
	
}

function muestra_noticias(){
	document.getElementById("img_noticias_new").style.display="inline";
	document.getElementById("img_noticias_new").src="imagenes/imagen_prensa.jpg";
	cargaPagina('../includes/noticias.php','contenido_noticia');
	document.getElementById("show_prensa").style.display="inline";
	document.getElementById("show_noticias").style.display="none";
}
function muestra_noticia_individual(cod){
	document.getElementById("img_noticias_new").style.display="inline"
	cargaPagina('../includes/noticia_unica.php?cod='+cod,'contenido_noticia')
	
}
function muestra_prensa(){
	document.getElementById("img_noticias_new").style.display="inline"
	document.getElementById("img_noticias_new").src="imagenes/imagen_prensa.jpg";
	cargaPagina('../includes/prensa.php','contenido_noticia')
	document.getElementById("show_noticias").style.display="inline";
	document.getElementById("show_prensa").style.display="none";
}
function muestra_prensa_individual(cod){
	document.getElementById("img_noticias_new").style.display="none"
	document.getElementById("img_noticias_new").src="imagenes/imagen_prensa.jpg";
	cargaPagina('../includes/prensa_unica.php?cod='+cod,'contenido_noticia')
}
function despliega_descarga(n){
	if(document.getElementById("desplgable_descarga"+n).style.display=="inline"){
		document.getElementById("desplgable_descarga"+n).style.display="none"
	}else{
		document.getElementById("desplgable_descarga"+n).style.display="inline"
	}
	
	
}
function bajazIndex(){
		document.getElementById("absolute_cocinas").style.zIndex=1;
		document.getElementById("absolute_banos").style.zIndex=1;
		document.getElementById("absolute_oficinas").style.zIndex=1;
		document.getElementById("absolute_salones").style.zIndex=1;
		document.getElementById("absolute_edificios").style.zIndex=1;
		document.getElementById("absolute_colores").style.zIndex=1;
		document.getElementById("absolute_caracteristicas").style.zIndex=1;
}

function pagActual(pag){	
	$('pag').value=pag;
	document.paginacion.submit();
	//cargaPagina('videos.php','div_pagina','pag='+pagina);				
}

function pagActual2(pag,m,a){	
	cargaPagina('includes/cuadros_noticias.php','cargaContenidoNoticias','pag='+pag+'&m='+m+'&a='+a);				
}

var geocoder;
var map;
var marker;
function cargaMapa()
{
	if (GBrowserIsCompatible()) {		
		geocoder = new GClientGeocoder();		
		var posicion;			
		var address = $('direccion').value;	
		var lat = $('lat').value;
		var lon = $('lon').value;		
		if(lat != "" && lon != "")
		{			
			map = new GMap2($("mapa"));
			var LatLng = new GLatLng(lat, lon);
			map.setCenter(LatLng, 16);
			marker = new GMarker(LatLng);
			map.addOverlay(marker);
		}
		else
		{
			map = new GMap2($("mapa"));
			var LatLng = new GLatLng(geocoder.getLatLng(address, function(point) {
					posicion = point;
					map.setCenter(point, 16);
					marker = new GMarker(point);
					map.addOverlay(marker);
					posicion = posicion.toString();
					posicion = posicion.replace('(', '');
					posicion = posicion.replace(")", '');
					corte = posicion.split(", ");
					$('lat').value = corte[0];
					$('lon').value = corte[1];
				}
				)
			);
		}
		/*GEvent.addListener(map, "click", function (overlay,point){
			if (point){
				marker.setPoint(point); 
			}
			//marker.openInfoWindowHtml("Latitud: " + point.lat() + "<br>Longitud: " + point.lng());
			$('lat').value = point.lat();
			$('lon').value = point.lng();
		});*/
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		//map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10,20)));
		map.setCenter(LatLng);
	}
}

function cambiaMenu(mov, pagAct){
	var pag;
	if(mov == 1)
		pag = pagAct + 1;
	else
		pag = pagAct - 1;
	 
	cargaPagina('includes/submenu_proyectos.php','menu_front','pag='+pag);		
}

function muestraImagenes(id)
{
	/*for(i=0; i<= 200; i++)
	{
		if($('absolute_' + i))
		{
			if(i == id)
				$('absolute_'+i).className='absolute_visible';
			else
				$('absolute_'+i).className='absolute';
		}
	}*/
}
