function menu(a){	
	document.getElementById("m"+a).style.color="#fff";
	document.getElementById("m"+a).style.background = "url(images/sb_"+a+".gif) no-repeat";
	document.getElementById("m"+a).href = "javascript:void(null)";
	document.getElementById("m"+a).style.cursor = "default";
}

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];}}
}
var ready = false;
function ini()
{
	a0 = new qd('a0','sm0');
	a1 = new qd('a1','sm1');
	a2 = new qd('a2','sm2');
	a3 = new qd('a3','sm3');
	a4 = new qd('a4','sm4');
	a5 = new qd('a5','sm5');
	a6 = new qd('a6','sm6');
	a7 = new qd('a7','sm7');
	a8 = new qd('a8','sm8');
	a9 = new qd('a9','sm9');
	a10 = new qd('a10','sm10');
	a11 = new qd('a11','sm11');
	a12 = new qd('a12','sm12');
	a13 = new qd('a13','sm13');
	a14 = new qd('a14','sm14');
	ready = true;
}

var posX = new Array();
posX[0] = 20;
posX[1] = 38;
posX[2] = 56;
posX[3] = 20;
posX[4] = 92;
posX[5] = 110;
posX[6] = 128;
posX[7] = 146;
posX[8] = 164;
posX[9] = 182;
posX[10] = 200;
posX[11] = 218;
posX[12] = 236;
posX[13] = 254;
posX[14] = 272;
var marcada;
var marcadaS;
var vieja;
var viejaS;
function marco(a){
	if(marcada!=undefined&&marcada!=a){
		vieja = marcada;	
		document.getElementById("mo"+vieja+"m").style.color = "#000"; 
		document.getElementById("mo"+vieja+"m").style.background = "url(images/puntos_hori.gif) bottom repeat-x";
	}
	marcada = a;
	document.getElementById("mo"+a+"m").style.color = "#fff"; 
	document.getElementById("mo"+a+"m").style.backgroundColor = "#fe4b4b";
	//	desliza(a);
	
	
}
function marcoS(b){
	if(marcadaS!=undefined){
		viejaS = marcadaS;
		document.getElementById("so"+vieja+viejaS).style.background = " url(images/bg_sub_ofertas.gif) 6px 4px no-repeat";
		document.getElementById("so"+vieja+viejaS).style.color = "#000";
	}
	marcadaS = b;
	document.getElementById("so"+marcada+b).style.background = "#fe4b4b url(images/bg_sub_ofertas_on2.gif) 6px 4px no-repeat";
	document.getElementById("so"+marcada+b).style.color = "#fff";	
}
function desliza(a){
	if(ready){		
		if(vieja!=undefined){	
			if(vieja!=a){
				eval('a'+vieja+'.slide(0,'+posX[vieja]+',-141,'+posX[vieja]+',10,15,-150,'+posX[vieja]+')');
				if(vieja!=marcada){
					document.getElementById("mo"+vieja+"m").style.color = "#000"; 
					document.getElementById("mo"+vieja+"m").style.background = "url(images/puntos_hori.gif) bottom repeat-x";
				}
			}
		}
		//if(a!=marcada){
		eval('a'+a+'.slide(-141,'+posX[a]+',0,'+posX[a]+',10,15,50,'+posX[a]+')');		
		document.getElementById("mo"+a+"m").style.color = "#fff"; 
		document.getElementById("mo"+a+"m").style.backgroundColor = "#fe4b4b";
		vieja = a;
		//}
	}
}
function pinta(a){
	//alert("a = "+a+", vieja = "+vieja);
	
		if(vieja!=undefined){	
			if(vieja!=a){
				document.getElementById("mo"+vieja+"m").style.color = "#000"; 
				document.getElementById("mo"+vieja+"m").style.background = "url(images/puntos_hori.gif) bottom repeat-x";
			}
		}
		document.getElementById("mo"+a+"m").style.color = "#fff"; 
		document.getElementById("mo"+a+"m").style.backgroundColor = "#fe4b4b";
		vieja = a;
	
}
function esconde(){	
	if(vieja!=undefined){
		
		eval('a'+vieja+'.slide(0,'+posX[vieja]+',-141,'+posX[vieja]+',10,15,-150,'+posX[vieja]+')');
		vieja = undefined;
	}
}
function llamarasincrono(url, id_contenedor){
	var pagina_requerida = false
	if (window.XMLHttpRequest) {// Si es Mozilla, Safari etc
		pagina_requerida = new XMLHttpRequest()
	} else if (window.ActiveXObject){ // pero si es IE
		try {
			pagina_requerida = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){ // en caso que sea una versión antigua
		try{
		pagina_requerida = new ActiveXObject("Microsoft.XMLHTTP")
	}
	catch (e){}
	}	
	}
	else
	return false
	pagina_requerida.onreadystatechange=function(){ // función de respuesta
	cargarpagina(pagina_requerida, id_contenedor)
	}
	pagina_requerida.open('GET', url, true) // asignamos los métodos open y send
	pagina_requerida.send(null);
}
// todo es correcto y ha llegado el momento de poner la información requerida
// en su sitio en la pagina xhtml
function cargarpagina(pagina_requerida, id_contenedor){
if (pagina_requerida.readyState == 4 && (pagina_requerida.status==200 || window.location.href.indexOf("http")==-1)){
	document.getElementById(id_contenedor).innerHTML=pagina_requerida.responseText;
	/*var cadena = pagina_requerida.responseText;
	var fix = unescape(cadena);
	alert(fix);
	//var final = fix.replace(/\+/gi," ");
	document.getElementById(id_contenedor).innerHTML=fix;*/
	}
	
	
}