<!--

ids = new Array("empresa","producto","coleccion","franquicia","tiendas","servicios")
ficheros_act = new Array("b_empresa_act.gif", "b_producto_act.gif", "b_colec_act.gif","b_franq_act.gif","b_tiendas_act.gif","b_servicios_act.gif")
ficheros_off = new Array("b_empresa_off.gif", "b_producto_off.gif", "b_colec_off.gif","b_franq_off.gif","b_tiendas_off.gif","b_servicios_off.gif")


function restaura(id, idioma) 
{ 
 	for (i=0;i<=6;i++)
	{
		if (ids[i]==id) 
		{
			elemento = document.getElementById(ids[i]).src
			if (elemento.indexOf("act")!=-1) 
			{
				a=0;
			}
			else
			{
				document.getElementById(ids[i]).src="/imagenes/" + idioma + "/" + ficheros_off[i] 
			}
		}
	}
}

function cambiaImagen(id,idioma)
{
	for (i=0;i<=6;i++)
	{
		if (ids[i]!=id) 
		{				
			document.getElementById(ids[i]).src="/imagenes/" + idioma + "/" + ficheros_off[i] 
		}
		else 
		{
			document.getElementById(ids[i]).src="/imagenes/" + idioma + "/" + ficheros_act[i]
		}
	}
}

function cambiaImagen2(id, fichero, idioma)
{
	elemento = document.getElementById(id).src
	if (elemento.indexOf("act")!=-1) 
	{
		a=0
	}
	else
	{
		MM_swapImage(id,'','imagenes/' + idioma + "/" + fichero,1)
		//document.getElementById(ids[i]).src="/imagenes/" + ficheros_off[i] 
	}
	
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




var READY_STATE_COMPLETE=4;
var peticion_http = null;
 
function inicializa_xhr() {
  if (window.XMLHttpRequest) {
    return new XMLHttpRequest(); 
  } else if (window.ActiveXObject) {
    return new ActiveXObject("Microsoft.XMLHTTP"); 
  } 
}

function crea_query_string3(id) {

  return "id=" + id + "&nocache=" + Math.random();
}

function procesaRespuesta3() {
  if(peticion_http.readyState == READY_STATE_COMPLETE) {
    if (peticion_http.status == 200) {

		document.getElementById("colecciones").innerHTML	= peticion_http.responseText;
    }
  }
}
 
function buscaColeccion(id) {

  peticion_http = inicializa_xhr();
  if(peticion_http) {
    peticion_http.onreadystatechange = procesaRespuesta3;

    peticion_http.open("POST", "http://www.october.es/listadocolec.asp", true);
    var query_string = crea_query_string3(id);
    peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    peticion_http.send(query_string);
  }
}



function crea_query_string2(id) {

  return "id=" + id + "&nocache=" + Math.random();
}

function procesaRespuesta2() {
  if(peticion_http.readyState == READY_STATE_COMPLETE) {
    if (peticion_http.status == 200) {

		document.getElementById("sbmnu").innerHTML	= peticion_http.responseText;
		//MM_showHideLayers('sbmnu','','show');
    }
  }
}
 
function cambiarMenu(id) {

  peticion_http = inicializa_xhr();
  if(peticion_http) {
    peticion_http.onreadystatechange = procesaRespuesta2;

    peticion_http.open("POST", "http://www.october.es/submenu.asp", true);
    //peticion_http.open("POST", "http://localhost/anyadir.asp", true);
    var query_string = crea_query_string2(id);
    peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    peticion_http.send(query_string);
  }
}





function crea_query_string(id) {

  return "id=" + id + "&nocache=" + Math.random();
}


function procesaRespuesta() {
  if(peticion_http.readyState == READY_STATE_COMPLETE) {
    if (peticion_http.status == 200) {

		document.getElementById("contenidos").innerHTML	= peticion_http.responseText;
		//MM_showHideLayers('sbmnu','','show');
    }
  }
}
 


function cambiarContenido(id) {

  peticion_http = inicializa_xhr();
  if(peticion_http) {
    peticion_http.onreadystatechange = procesaRespuesta;

    peticion_http.open("POST", "http://www.october.es/conten.asp", true);
    //peticion_http.open("POST", "http://localhost/anyadir.asp", true);
    var query_string = crea_query_string(id);
    peticion_http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    peticion_http.send(query_string);
  }
}




function blanco()
{
	for(b=0;b<=21;b++)
	{
		//alert(eval("document.getElementById('imag" + b + "')"))
		if (eval("document.getElementById('imag" + b + "')")+""=="null") 
		{
			a=0 
		}
		else 
		{
			eval("document.getElementById('imag" + b + "').style.color='#ffffff'");
		}
	}
}

//-->

