


function Section(img, obj)
{
	this.img = img;
	this.obj = obj;
}

function File(section, file)
{
	this.section = section;
	this.file = file;
}


/*** list of sections **/
var section = new Array();
section[0] = new Section('images/credenciales_profesionales_on.jpg', 'credenciales_profesionales1');
section[1] = new Section('images/intervenciones_quirurgicas_on.jpg', 'intervenciones_quirurgicas1');
section[2] = new Section('images/visita_virtual_on.jpg', 'visita_virtual1');
section[3] = new Section('images/procedimientos_no_quirurgic_on.jpg', 'procedimientos_no_quirurgicos1');
section[4] = new Section('images/seminarios_on.jpg', 'seminarios1');
section[5] = new Section('images/actualidad_medica_on.jpg', 'actualidad_medica1');
section[6] = new Section('images/contacte_nos_on.jpg', 'contacte_nos1');

/*** list of files 	**/
var file = new Array();
file[ 0] = new File(5, 'actualidad.cfm');
file[ 1] = new File(1, 'cara_blefaroplastia.cfm');
file[ 2] = new File(1, 'cara_lobulo_oreja.cfm');
file[ 3] = new File(1, 'cara_mentoplastia.cfm');
file[ 4] = new File(1, 'cara_otoplastia.cfm');
file[ 5] = new File(1, 'cara_rinoplastia.cfm');
file[ 6] = new File(1, 'cara_ritidectomia.cfm');
file[ 7] = new File(6, 'contacte.cfm');
file[ 8] = new File(0, 'credenciales.cfm');
file[ 9] = new File(1, 'cuerpo_lipectomia.cfm');
file[10] = new File(1, 'cuerpo_liposuccion.cfm');
file[11] = new File(-1, 'index.cfm');
file[12] = new File(1, 'intervenciones.cfm');
file[13] = new File(1, 'mamas_ginecomastia.cfm');
file[14] = new File(1, 'mamas_mamoplastia_aumento.cfm');
file[15] = new File(1, 'mamas_mamoplastia_reduccuon.cfm');
file[16] = new File(1, 'mamas_mastopexia.cfm');
file[17] = new File(1, 'mamas_reconstruccion_mamaria.cfm');
file[18] = new File(3, 'procedimientos.cfm');
file[19] = new File(4, 'seminarios.cfm');
file[20] = new File(2, 'visita_virtual.cfm');

 

/*** gets the current filename from url **/
function getFileName()
{
	if (location.href.lastIndexOf('/') !=-1)
    {
	    firstpos = location.href.lastIndexOf('/')+1;
	    lastpos = location.href.length;
        Name=location.href.substring(firstpos,lastpos);
		return Name;
	}
	return 0;
}

function syncMenu()
{
	var name = getFileName();
	if (!name) return;
	
	/*** finding the name in file array **/
	var sect = -1;	
	for (i = 0; i < file.length; i++)
	{
		if (file[i].file == name)
		{
			sect = file[i].section;
			if (sect < 0) return;
			
			break;
		}
	}
	
	if (!section[sect])
		return;
		
	/*** taking the section details **/
	var img = MM_findObj(section[sect].obj);
	img.src = section[sect].img;
}



