// JavaScript Document
//MENU PORTADA/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function formatoIndex(celda,evento){ 
celda1="Menu"+celda+"_1"; celda2="Menu"+celda+"_2"; celda3="Menu"+celda+"_3"; celda4="Menu"+celda+"_4";
texto="txt"+celda;

		if (evento=="over"){			
			if (celda=="6"){
			color1='#CC99B2';
			color2='#804C66';
			color3='#C08274';			
			}
			else if(celda=="5"){
			color1='#FFB787';
			color2='#B36B3B';
			color3='#F7BF88';
			}
			else{
			color1='#D9D9D9';
			color2='#7C7C7C';
			color3='#F0E2B3';
			}		
		document.getElementById(texto).className = 'menuOver';
		document.getElementById(celda1).style.background=color1;
		document.getElementById(celda2).style.background=color2;
		document.getElementById(celda3).style.background=color2;
		document.getElementById(celda4).style.background=color3;		
		}
		
		else{		
			if (celda=="6"){
			color2='#735966';
			color3='#D3A87B';		
			}
			else{
			color2='#666666';
			color3='#E7D182';
			}
		document.getElementById(texto).className = 'menu';
		document.getElementById(celda1).style.background='#FFFFFF';
		document.getElementById(celda2).style.background=color2;
		document.getElementById(celda3).style.background=color2;
		document.getElementById(celda4).style.background=color3;		
		}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


//bolsa de TRABAJO/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var seleccion="0";

function formatoBolsaTrabajo(celda,evento){ 
fila="Oferta"+celda+"";


	//para reponer un color u otro si la fila es par o impar
	if (celda % 2){
	color="#EAEAEA";
	}
	else{
	color="";
	}
	
	//cambios
	if (evento=="over"){
	document.getElementById(fila).style.background="#F6EDF1";
	document.getElementById(fila).style.fontWeight='bold';
	}
	else if (evento=="click"){
		//por si hubiera alguno ya seleccionado, recorremos todos y los dejamos como inicialmente (menos el que pinchamos)
		//*********CAMBIAR EL BUCLE CUANDO HAYA MÁS OFERTAS
		for (i=1;i<=4;i++){
			if (i==celda){
			document.getElementById(fila).style.background="#F6EDF1";
			document.getElementById(fila).style.fontWeight='bold';
			seleccion=celda;
			}
			else{
				if (i % 2){
				document.getElementById("Oferta"+i+"").style.background="#EAEAEA";
				document.getElementById("Oferta"+i+"").style.fontWeight='normal';
				}
				else{
				document.getElementById("Oferta"+i+"").style.background="";
				document.getElementById("Oferta"+i+"").style.fontWeight='normal';
				}
			}
		}
	}
	else{//cuando es OUT
		if (seleccion==celda){
		}
		else{
		document.getElementById(fila).style.background=color;
		document.getElementById(fila).style.fontWeight='normal';
		}
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Visibilidad de Capas ///////////////////////////////////////////////////////////////////
var nc = (document.layers) ? true:false
var ie = (document.all) ? true:false
var n6 = (document.getElementById) ? true:false
  
function ApareceCapaIndex(capa){
	if(ie)
		//document.all[capa].style.visibility="visible";
		document.getElementById(capa).style.visibility="visible";
	else if(nc)
		document.layers[capa].visibility="show";
	else if(n6)
		document.getElementById(capa).style.visibility="visible";
}

function ApagaCapaIndex(capa){
	if(ie)
		//document.all[capa].style.visibility="hidden";
		document.getElementById(capa).style.visibility="hidden";
	else if(nc)
		document.layers[capa].visibility="hide";
	else if(n6)
		document.getElementById(capa).style.visibility="hidden";
}
//////////////////////////////////////////////////////////////////////////////////////////

//DREAMWEAVER/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


