var qMenu='';

function menuActivo(qMenuAct) { //alert(qMenuActivo);
	qMenu=document.getElementById(qMenuAct);
	if (qMenuAct=='opcion30' || qMenuAct=='opcion31' || qMenuAct=='opcion32' || qMenuAct=='opcion33' || qMenuAct=='opcion34' ) {
		qMenu.style.color='red';
	}else{
		if (qMenuAct=='opcion1' || qMenuAct=='opcion2' || qMenuAct=='opcion6') {
			qMenu.style.height='28px'; 
		}else{ 
			qMenu.style.height='22px';
		}
		qMenu.style.color='#333';
		qMenu.style.backgroundColor='#fff';	
	}
}

function subMenuActivo(qSubMenuAct) {
	qSub=document.getElementById(qSubMenuAct);
		qSub.style.color='#333';
		qSub.style.backgroundColor='#fff';	
}

function verLados(qLados) {
	document.getElementById(qLados).className='opcionOver';
	document.getElementsByTagName(div).style.visibility='visible';
}

function ocultarLados(qLados) {
	document.getElementById(qLados).className='opcionOut';
}

function coloca_Ul(qOp,qUl) {
	qO=document.getElementById(qOp);
	qU=document.getElementById(qUl);
	dist=qO.offsetLeft+2;
	
	
	qU.style.left=dist+'px';
	/*
	qU.style.left=(qU.offsetLeft)+'px';
	alert(qU.offsetLeft+2); */
}

function mostrarOpcion(qOpcion){
	switch (qOpcion){
		case 'descargasResidencia':
			document.getElementById('descargasResidencia').style.display='block';
			document.getElementById('mapaResidencia').style.display='none';
			document.getElementById('fotosResidencia').style.display='none';
			document.getElementById('contactaResidencia').style.display='none';
			break;
		case 'mapaResidencia':
			document.getElementById('descargasResidencia').style.display='none';
			document.getElementById('mapaResidencia').style.display='block';
			document.getElementById('fotosResidencia').style.display='none';
			document.getElementById('contactaResidencia').style.display='none';
			break;	
		case 'fotosResidencia':
			document.getElementById('descargasResidencia').style.display='none';
			document.getElementById('mapaResidencia').style.display='none';
			document.getElementById('fotosResidencia').style.display='block';
			document.getElementById('contactaResidencia').style.display='none';
			break;
		case 'contactaResidencia':
			document.getElementById('descargasResidencia').style.display='none';
			document.getElementById('mapaResidencia').style.display='none';
			document.getElementById('fotosResidencia').style.display='none';
			document.getElementById('contactaResidencia').style.display='block';
			break;
	}/*
	if(qO=='descargasResidencia'){
		
	}else if (qO=='descargasResidencia'){
		
	}else{
		
	}*/
}


function abreFoto(qFoto,qFoto2,qFoto3,modal) { //alert();
	var alto=window.screen.availHeight;
	var mitadAlto=alto/2-100;
	var ancho=window.screen.availWidth;
	var mitadAncho=(ancho/2)-10;
	for (var i=0;i<30;i++){
		document.getElementById('grande'+i).style.visibility='hidden';
		document.getElementById('grande'+i).style.position='absolute';
		document.getElementById('grande'+i).style.left='0';
		document.getElementById('grande'+i).style.width='0';
		document.getElementById('grande'+i).style.height='0';
	}
	document.getElementById(qFoto2).style.visibility='visible';	
	document.getElementById(qFoto2).style.width='940px';
	document.getElementById(qFoto2).style.height='644px';
	document.getElementById(qFoto2).style.zindex='500';

	//alert(ancho/2);
	//alert(document.getElementById(qFoto2).offsetWidth/2);
	
	document.getElementById(qFoto2).style.left=mitadAncho-470+'px'; //'0';	
	document.getElementById(qFoto2).style.top=mitadAlto-322+'px';	/* ( document.getElementById(qFoto3).offsetTop - 460 )+'px'; */
	document.getElementById(qFoto2).style.position='fixed';
	
	document.getElementById(modal).style.top='0px';
	document.getElementById(modal).style.left='0px';
	document.getElementById(modal).style.position='fixed';
	document.getElementById(modal).style.background='grey';
	document.getElementById(modal).style.width='2000px';
	document.getElementById(modal).style.height='1000px';
	document.getElementById(modal).style.zindex='1';
	
}

function cierraFoto(qFoto,qFoto2,modal) { //alert(modal);
	document.getElementById(qFoto2).style.visibility='hidden';
	document.getElementById(qFoto2).style.position='absolute';
	document.getElementById(qFoto2).style.left='0';
	document.getElementById(qFoto2).style.width='0';
	document.getElementById(qFoto2).style.height='0';
	document.getElementById(qFoto2).style.top='0';
	
	document.getElementById(modal).style.width='0px';
	document.getElementById(modal).style.height='0px';
}




/*aguanta()
*/
/*function cambiaclick(opcion) {
	aguanta(opcion)
	document.getElementById(opcion).style.backgroundColor='#333333';
}
*/
function cambiaActivo(opcion) { 
	/*if (opcion=='opcion30'){ // || opcion=='opcion31' || opcion=='opcion32' || opcion=='opcion33' || opcion=='opcion34') {
		document.getElementById(opcion).style.backgroundColor='#444444';
		document.getElementById(opcion).style.color='#999966';
	} else {*/
		document.getElementById(opcion).style.backgroundColor='#333333';
		document.getElementById(opcion).style.color='#FFFFFF';
		/*document.getElementById(opcion).style.color='#FFFFFF';*/
	//}
	//miraQuien(opcion)
}
function cambiaActivo2(opcion2) { 
	/*if (opcion=='opcion30'){ // || opcion=='opcion31' || opcion=='opcion32' || opcion=='opcion33' || opcion=='opcion34') {
		document.getElementById(opcion).style.backgroundColor='#444444';
		document.getElementById(opcion).style.color='#999966';
	} else {*/
		document.getElementById(opcion2).style.backgroundColor='#333333';
		document.getElementById(opcion2).style.color='#FFFFFF';
		/*document.getElementById(opcion).style.color='#FFFFFF';*/
	//}
	//miraQuien(opcion)
}
function miraQuien(opcion) {
	if (opcion=='opcion1' || opcion=='opcion2' || opcion=='opcion5' ) { 
		
	}	
}


function cambiaover(quienOver) {
	var objeto=document.getElementById(quienOver);
	if (objeto.style.backgroundColor=='#333333') {
		objeto.style.backgroundColor=='#333333';
	} else {
		objeto.style.backgroundColor='#FFFFFF'; 
		objeto.style.color='#999966'; 
	}
}

function cambiaout(quienOut) {
	var objeto=document.getElementById(quienOut);
	if (objeto.style.backgroundColor=='#333333') {
		objeto.style.backgroundColor=='#333333';
	} else {
		objeto.style.backgroundColor='#999966'; 
		objeto.style.color='#FFFFFF'; 
	}
}
function cambiaover2(quienOver2) {
	var objeto=document.getElementById(quienOver2);
	if (objeto.style.backgroundColor=='#333333') {
		objeto.style.backgroundColor=='#333333';
	} else {
		objeto.style.backgroundColor='#FFFFFF'; 
		objeto.style.color='#999966'; 
	}
}

function cambiaout2(quienOut2) {
	var objeto=document.getElementById(quienOut2);
	if (objeto.style.backgroundColor=='#333333') {
		objeto.style.backgroundColor=='#333333';
	} else {
		objeto.style.backgroundColor='#999966'; 
		objeto.style.color='#FFFFFF'; 
	}
}

