function cambiar_contenidos(url, id_contenedor, id_seccion, id_subSeccion){
	var pagina = false
	
	/*
	var dir = document.location.href.toString();
	dir = dir.split("#");
	alert(url);
	if (dir[1] == undefined){
	} else {
	}
	*/

	//alert(url);
	/*
	if (url=="secciones/clientes/clientes.php" || url=="secciones/productos/cap_sat_oca.php" || url=="secciones/productos/viop.php") {
		est=1;	
	} else {
		est=0;
	}
	*/
	if (window.XMLHttpRequest) {// Firefox y otros
		pagina = new XMLHttpRequest()
	} else if (window.ActiveXObject){ // IE
		try {
			pagina = new ActiveXObject("Msxml2.XMLHTTP")
		}
		catch (e){ 
			try{
				pagina = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){
			}
		}
	} else {
		return false
	}
	
	pagina.onreadystatechange=function(){ 
		load_pagina(pagina, id_contenedor, id_seccion, id_subSeccion);
	}
	
	pagina.open('GET', url, true);
	pagina.send(null);
	
	//alert(id_seccion+"\n"+id_subSeccion);
	
	// MUESTRO U OCULTO EL WEBCOMM DE LA HOME
	if (id_seccion == 0){
		document.getElementById("webcomm").style.display="block";
	} else {
		document.getElementById("webcomm").style.display="none";
	}

	// MUESTRO U OCULTO LA SUBBOTONERA DE LA SECCION "LA EMPRESA"
	if (id_seccion == 1){
		document.getElementById("subBotEmpresa").style.display="block";
	} else {
		document.getElementById("subBotEmpresa").style.display="none";
	}
	
	// MUESTRO U OCULTO LA SUBBOTONERA DE LA SECCION "RECORRIDOS"
	if (id_seccion == 3){
		document.getElementById("subBotRecorridos").style.display="block";
	} else {
		document.getElementById("subBotRecorridos").style.display="none";
	}
}

/*
function load_pagina(pagina, id_contenedor, est){
	if (pagina.readyState == 4 && (pagina.status==200 || window.location.href.indexOf("http")==-1)) {
		document.getElementById(id_contenedor).innerHTML=pagina.responseText;
		if (est==1) {
			iniciar ();
		}
	}
}
*/
/// NOMBRE DE LOS HEAD DE LASE SUBSECCIONES DE LA SECCION "LA EMPRESA"
head_Nombres = new Array("Perfil Corporativo","Carta del Presidente y Vicepresidente","Historia","Accionistas","Directorio","Staff","Politica de Calidad","Marco Legal","Filosofía");
///
function load_pagina(pagina, id_contenedor, id_seccion, id_subSeccion){
		//alert(id_seccion);	
	if (pagina.readyState == 4 && (pagina.status==200 || window.location.href.indexOf("http")==-1)) {
		document.getElementById(id_contenedor).innerHTML=pagina.responseText;
		/// CARGO EL HEADER DE LA SECCION SELECCIONADA		
		if (id_seccion == 2){
			var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
			fo.addVariable("nombre", "Flota");
			fo.write("head_secciones");
		} else if (id_seccion == 3){
			//alert(id_subSeccion);
			if (id_subSeccion == 1){
				var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
				fo.addVariable("nombre", "Horarios y Paradas");
				fo.write("head_secciones");
			} else if (id_subSeccion == 2){
				var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
				fo.addVariable("nombre", "Tarifas");
				fo.write("head_secciones");
			} else if (id_subSeccion == 3){
				var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
				fo.addVariable("nombre", "Normas Reglamentarias");
				fo.write("head_secciones");
			} else {
				var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
				fo.addVariable("nombre", "Lineas");
				fo.write("head_secciones");
			}
		} else if (id_seccion == 4){
				var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
				fo.addVariable("nombre", "Novedades");
				fo.addParam("wmode", "transparent");
				fo.write("head_secciones");
		} else if (id_seccion == 5){
				var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
				fo.addVariable("nombre", "Contacto");
				fo.write("head_secciones");
				///
				var fo = new FlashObject("swf/formulario.swf", "formContacto", "322", "255", "8");
				/*fo.addVariable("nombre", "Contacto");*/
				fo.write("formContacto");
		} else {
			var fo = new FlashObject("swf/head_secciones.swf", "head_secciones", "337", "35", "8");
			fo.addVariable("nombre", head_Nombres[id_subSeccion]);
			fo.write("head_secciones");
		}

		//alert(id_subSeccion);
		if (id_seccion == 2){
			/// CARGO LA GALERIA DE FOTOS DE LA SECCION SELECCIONADA
			var fo = new FlashObject("swf/galeriaFotos.swf", "galeriaFotos", "230", "254", "8");
			fo.addVariable("xml_var", "xml_galeriaFotosFlota.xml");
			fo.write("galeriaFotos");
		} else {
			/// CARGO LA GALERIA DE FOTOS DE LA SECCION SELECCIONADA
			if (id_subSeccion == 8){
				id_subSeccion = 0;
			}
			///
			var fo = new FlashObject("swf/galeriaFotos.swf", "galeriaFotos", "230", "254", "8");
			fo.addVariable("xml_var", "xml_galeriaFotos"+id_subSeccion+".xml");
			fo.write("galeriaFotos");
		}
	} else {
		document.getElementById(id_contenedor).innerHTML="<br><br><br><br><div align='center'><img src='images/loading.gif' width='16' height='16'></div><br><br><br><br>";
	}
}

function obtenerFlash(movieName){
	if (window.document[movieName]) {
		return window.document[movieName];
	}
	
	if (navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName]){
			return document.embeds[movieName];
		}
	} else {
		return document.getElementById(movieName);
	}
}

//---------------------------------------------------------//
function closeWin() {
	var transp  = document.getElementById('transparency');
	transp.style.display = 'none';
}
function openmap(mapaImg, mapaTitle, mapaLinea, mapaLineaColor, mapaText, mapaLinea2, ficon) {
	/*
	alert(mapaImg);
	alert(mapaTitle);
	alert(mapaLinea);
	alert(mapaLineaColor);
	alert(mapaText);
	alert(mapaLinea2);
	alert(ficon);
	*/
	
	var transp = document.getElementById('transparency');
	var swfDiv = document.getElementById('flashMapa');
	/*var titles = document.getElementById('winTitle');*/
	/*titles.innerHTML = title;*/
	transp.style.display = 'block';
	swfDiv.innerHTML = "";
	///
	var fo = new FlashObject("swf/zoomMap.swf", "mapa", "486", "650", "7");
	fo.addVariable("mapaImg", mapaImg);
	fo.addVariable("mapaTitle", mapaTitle);
	fo.addVariable("mapaText", mapaText);
	fo.addVariable("mapaLinea", mapaLinea);
	fo.addVariable("mapaLinea2", mapaLinea2);
	fo.addVariable("ficon", ficon);
	fo.addVariable("mapaLineaColor", mapaLineaColor);
	
	/*fo.addParam("wmode", "transparent");*/
	fo.write("flashMapa");
}

function closeImg(){
	var transpImg  = document.getElementById('transparencyImg');
	var transpImgBg  = document.getElementById('transparencyImgBg');
	///
	var img = document.getElementById('img');
	img.src = "";
	///
	transpImg.style.display = 'none';
	transpImgBg.style.display = 'none';
}
function openImg(imgPath) {
	var recWin = getBodyBounds();
	var transpImg = document.getElementById('transparencyImg');
	var transpImgBg = document.getElementById('transparencyImgBg');
	///
	var img = document.getElementById('img');
	///
	img.src = imgPath;
	///
	transpImg.style.top = recWin.top+"px";
	transpImg.style.left = recWin.left+"px";
	transpImg.style.width = recWin.width+"px";
	transpImg.style.heigth = recWin.heigth+"px";
	///
	transpImgBg.style.top = "0px";
	transpImgBg.style.left = recWin.left+"px";
	transpImgBg.style.width = recWin.width+"px";
	/*transpImgBg.style.height = (recWin.top+recWin.height)+"px";*/
	transpImgBg.style.height = recWin.height+"px";
	///
	transpImg.style.display = 'block';
	transpImgBg.style.display = 'block';
	
	/*alert(recWin.height);*/
}

/****************************************************************************************/
function getBodyBounds() {
	var t = l = 100;
	var h = w = 500;
	if (window.innerHeight) {
		t = window.pageYOffset;
		l = window.pageXOffset;
		w = window.innerWidth;
		h = window.innerHeight;
	} else
	if (document.documentElement && document.documentElement.scrollTop) {
		t = document.documentElement.scrollTop;
		l = document.documentElement.scrollLeft;
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	} else
	if (document.body) {
		t = document.body.scrollTop;
		l = document.body.scrollLeft;
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	}

	if (document.documentElement && document.documentElement.clientWidth) {
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
	}
	return {top:t, left:l, width:w, height:h};
}