// JavaScript Document
function activarImg(obj){
	name = (obj.src);
	pos =name.indexOf("/fotos");
	pos = pos + 9;
	if ((name.substring(pos-2,pos-1)) =="b"){
		name=name.substring(pos,name.length);
		obj.src = "../fotos/"+name;
		MM_showHideLayers('fotos_peq','','show','foto_dch_peq','','show');
	}
}

function cambiarImgGr(obj){	
	name = (obj.src);
	name = extraerNombreGr(name);
	obj = MM_findObj("foto_gr");
	obj.src = "../fotos/"+name;
}

function cargarImgGr(limite){
	imgs = ""
	for (i=1;i<limite;i++){
		obj = MM_findObj("foto_pq"+i);
		if (obj!=null)	imgs = imgs + "'../fotos/"+(extraerNombreGr(obj.src)) + "',";
	}
	MM_preloadImages(imgs);

}
	
function extraerNombreGr(name){
	if (name.indexOf("_p")>-1){
		pos  = name.indexOf("/fotos");
		pos  = pos+7;
		name = (name.substring(pos,name.length));
		pos  = name.indexOf("p.");
		name = name.substring(0,pos) + "g.jpg";
	 }
	return name;
	
}

function menuFlash(menuNum){
//	var movie=window.document.movie;
//	movie.SetVariable("menu",menuNum);
	if(window.movie) window.document["movie"].SetVariable("menu", menuNum);
	if(document.movie) document.movie.SetVariable("menu", menuNum);
}

function cambiarImgFlash(argObj,argSrc){
	//cambiarImg(name);
	
	if (argObj){
		arg = argObj.src;
		
	}else{
		arg  = argSrc;
	}
	arg = "../fotos/"+extraerNombreGr(arg);
	document.mosaico.SetVariable("imagen", arg);	
	document.mosaico.TGotoLabel( "/", "inicio" );
	document.mosaico.Play();
}