//
//
//// Tema imatges       <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
var idImatgeEnCurs = 1;
var imatgesTotal = 0;
function posaImatgeProjecte(id)
{
    var imatgeObrir = eval('imatge' + id);
    idImatgeEnCurs = id;
    imatgeProjecte.src = 'http://www.east.cat/exposar.php?id_continguts_file=' + imatgeObrir + '&configurador=_c.east.cat.php';
}

function posaImatgeSeguent()
{
    if(idImatgeEnCurs >= imatgesTotal)
    {
        posaImatgeProjecte(1);
    } else
    {
        posaImatgeProjecte(idImatgeEnCurs + 1);
    }
}

//
//
//// Gestió de menú:         <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
var cronologicObert = 0;
function mmOver(obj)
{
    //obj.filters.alpha.opacity=40;
    obj.className='zLateralInvert';
}

function mmOut(obj)
{
    obj.className='zLateral';
}

function mmclick(url)
{
    document.location = url;
}
var tempo;
var element = '';
var opacitat = 0;
function mostrarInicia(elementMostrar)
{
    document.title = elementMostrar;
    if(element != '')
    {
        fesInvisible(element);
        document.title += "i" + element;
    }
    clearInterval(tempo);
    
    element = elementMostrar;
    // fem-lo visible però opac:
    obj = document.getElementById(element);
    obj.style.display = 'block';
    opacitat = 0;
    tempo=setInterval('mostrar()',50);
}
function fesInvisible(element)
{
    try
    {
        if(element == '') return;
        obj = document.getElementById(element);
        if (document.all)
            obj.style.filter = 'alpha(opacity=0)';
        else
            obj.style.MozOpacity = 0;
        obj.style.display = 'none';
        return;
    } catch(err)
    {   }
}
function mostrar() {
  if (opacitat >= 90)
  {
    clearInterval(tempo); 
    return;
  }
  opacitat+=5;
  obj = document.getElementById(element);
  if (document.all)
    obj.style.filter = 'alpha(opacity='+opacitat+')';
  else
    obj.style.MozOpacity = opacitat/100;
}
//
//
////// imatges previes:
function mostraPrevia(imatgeObrir)
{
    
    document.getElementById('projecteImatgePrevia').src = 'http://www.east.cat/exposar.php?id_continguts_file=' + imatgeObrir + '&res=170&configurador=_c.east.cat.php';
    document.getElementById('projecteImatgePrevia').style.display = 'block';
}
function treuPrevia()
{
    document.getElementById('projecteImatgePrevia').style.display = 'none';
}