
var activeImage = false;
	var total=4;
	
	function showImageP(obj,id){		
		if(activeImage){
			activeImage.style.filter = 'alpha(opacity=100)';	
			activeImage.style.opacity = 1;						
		}			
		obj.style.filter = 'alpha(opacity=100)';
		obj.style.opacity = 1;	
		activeImage = obj;			
		showTextImage(id);
	}
	
	function showTextImage(id){
		document.getElementById('divLeyenda').innerHTML=document.getElementById('divLeyenda'+id).innerHTML;
	}	
	
	function lightV(obj,condition){
	if(activeImage && activeImage.id==obj.id){
	   return;
	}
	if(condition==true){
		obj.style.filter = 'alpha(opacity=100)';
		obj.style.opacity = 1;	
	}
	else{
		obj.style.filter = 'alpha(opacity=100)';	
		obj.style.opacity = 1;						
	}
}
var activeImageF = false;
var firstImageF=true;
function showImageF(obj,srcImg,divLF){
		if(firstImageF){
					
			firstTimeF=false;
		}
		
			if(activeImageF){
			activeImageF.style.filter = 'alpha(opacity=100)';	
			activeImageF.style.opacity = 1;
			
		}			
		obj.style.filter = 'alpha(opacity=100)';
		obj.style.opacity = 1;	
		activeImageF = obj;			alert(document.getElementById('imgGde').src);alert(srcImg);
		document.getElementById('imgGde2').src=srcImg;	
		//document.getElementById('divLeyendaF').innerHTML=document.getElementById(divLF).innerHTML;	
	}
	
	
var activeImageM = false;
var firstImageM=true;
function showImageM(obj,srcImg,num){
		var nombre = 'BigThumb';
		document.getElementById(nombre).src=srcImg;	
		
	}
	





	
function light(obj,condition){
	if(activeImageF && activeImageF.id==obj.id){
	   return;
	}
	if(condition==true){
		obj.style.filter = 'alpha(opacity=100)';
		obj.style.opacity = 1;	
	}
	else{
		obj.style.filter = 'alpha(opacity=100)';	
		obj.style.opacity = 1;						
	}
}

var activeImageI = false;
var firstImageI=true;
function showImageI(obj,srcImg,divLF){		
		if(firstImageI){
			var imgCache = new Image();
			
			firstTimeI=false;
		}
		if(activeImageI){
			activeImageI.style.filter = 'alpha(opacity=100)';	
			activeImageI.style.opacity = 1;						
		}			
		obj.style.filter = 'alpha(opacity=100)';
		obj.style.opacity = 1;	
		activeImageF = obj;			
		document.getElementById('infoGde').src=srcImg;	
		document.getElementById('divLeyendaI').innerHTML=document.getElementById(divLF).innerHTML;	
	}
function lightI(obj,condition){
	if(activeImageI && activeImageI.id==obj.id){
	   return;
	}
	if(condition==true){
		obj.style.filter = 'alpha(opacity=100)';
		obj.style.opacity = 1;	
	}
	else{
		obj.style.filter = 'alpha(opacity=100)';	
		obj.style.opacity = 1;						
	}
}
function resizeIframe(the_iframe){

  //find the height of the internal page

  var the_height= document.getElementById(the_iframe).contentWindow.document.body.scrollHeight;

  //change the height of the iframe

  document.getElementById(the_iframe).height=  the_height - 20;

}

function seleccionar(id)
{
	document.getElementById(id).className="selectedtumb";
}

function verBordeInterno(id, letra){
	var pos = id.indexOf(letra);
	var longitud = id.lenght;
	var id2 = id.substring(0,pos+1);
	cont = 0;

	while(document.getElementById(id2+cont)!=null){
		
		document.getElementById(id2+cont).className='tumbimg';
		cont++;
		
	}

	if(document.getElementById(id))
		document.getElementById(id).className='selectedtumb';
	}

function verBorde(id, letra){
var pos = id.indexOf(letra);
var longitud = id.lenght;
var id2 = id.substring(0,pos+1);
cont = 0;

while(document.getElementById(id2+cont)!=null){
	
	document.getElementById(id2+cont).className='tumbimg';
	cont++;
	
}

if(document.getElementById(id))
	document.getElementById(id).className='selectedtumb';
}


function verTexto(id, letra){
var pos = id.indexOf(letra);
var longitud = id.lenght;
var id2 = id.substring(0,pos+1);
cont = 0;

while(document.getElementById(id2+cont)!=null){
document.getElementById(id2+cont).style.display='none';
cont++;
}

document.getElementById(id).style.display='inline';
}


function show_videoA(campo,texto) {
	document.getElementById(campo).innerHTML = document.getElementById(texto).innerHTML;
	if(document.getElementById('youtube')){
	document.getElementById('youtube').style.display='none';
	}
	if(document.getElementById('admotion')){
	document.getElementById('admotion').style.display='inline';
	}
}

function show_videoY(campo,texto) {
	document.getElementById(campo).innerHTML = '<object width="320" height="292">'+
										'<param name="movie" value="http://www.youtube.com/v/'+texto+'"></param>'+
										'<param name="wmode" value="transparent"></param>'+
										'<embed src="http://www.youtube.com/v/'+texto+'" type="application/x-shockwave-flash" wmode="transparent" width="320" height="292"></embed>'+
										'</object>';
	if(document.getElementById('youtube')){
	document.getElementById('youtube').style.display='inline';
	}
	if(document.getElementById('admotion')){
	document.getElementById('admotion').style.display='none';
	}
}


