carregant_color=new Array();
carregant_color['1']='#fbf92a';
carregant_color['-1']='#cbc900';
carregant_color_cont=1;
function anim_logo_carregant()
{
    carregant_color_cont=carregant_color_cont*(-1);
    document.getElementById('p_carregant_logo').style.color=carregant_color[carregant_color_cont];
return;
}

function play_anim_foto()
{
    document.getElementById('im_foto_g').style.visibility='inherit';
    document.getElementById('im_foto_v').style.visibility='inherit';
    id_foto=setInterval('anim_foto()',100);
return;
}

foto_x_g_0=0;
foto_y_g_0=270*shp;
foto_x_g_d=615*swp;

alfa=180;
dalfa=0.2;

dxg=15*swp;
dyg=10*shp; //es modifica a enllaç productes
foto_x_g=0;

foto_x_v_0=0;
foto_y_v_0=270*shp;
foto_x_v_d=615*swp;

beta=0;
dbeta=0.2;

dxv=15*swp;
dyv=10*shp; //es modifica a enllaç productes
foto_x_v=0;

inversio=-1; //es modifica a enllaç presentacio;

function anim_foto()
{
    alfa=alfa+dalfa*inversio;
    //foto_x_g_d=foto_x_g_d+5;
    //if(foto_x_g>=sw-50){foto_x_g_d=0;}
    foto_x_g=foto_x_g_d+Math.cos(alfa)*dxg;
    a=1-Math.pow( ((Math.cos(alfa))/(dxg/2)),2)    ;
    foto_y_g=Math.sin(alfa)*dyg*Math.floor( Math.sqrt((dyg/2)*a))+foto_y_g_0;
    
    beta=beta+dbeta*inversio;
    //foto_x_v_d=foto_x_v_d+5;
    //if(foto_x_v>=sw-50){foto_x_v_d=0;}
    foto_x_v=foto_x_v_d+Math.cos(beta)*dxv;
    a=1-Math.pow( ((Math.cos(beta))/(dxv/2)),2)    ;
    foto_y_v=Math.sin(beta)*dyv*Math.floor( Math.sqrt((dyv/2)*a))+foto_y_v_0;


    document.getElementById('im_foto_g').style.left=foto_x_g;
    document.getElementById('im_foto_g').style.top=foto_y_g;
    document.getElementById('im_foto_v').style.left=foto_x_v;
    document.getElementById('im_foto_v').style.top=foto_y_v;
return;
}

function modificar_anim_foto(var_v, var_foto_x_g_d , var_foto_y_g_0 , var_dxg , var_dyg , var_foto_x_v_d , var_foto_y_v_0 , var_dxv , var_dyv)
{
    if(var_v!=0) //introduir valors
    {
        clearInterval(id_foto);

        foto_y_g_0=foto_y_g_0+var_foto_y_g_0*shp;
        foto_x_g_d=foto_x_g_d+var_foto_x_g_d*swp;
        dxg=dxg+var_dxg*swp;
        dyg=dyg+var_dyg*shp;
        foto_y_v_0=foto_y_v_0+var_foto_y_v_0*shp;
        foto_x_v_d=foto_x_v_d+var_foto_x_v_d*swp;
        dxv=dxv+var_dxv*swp;
        dyv=dyv+var_dyv*shp;

        id_foto=setInterval('anim_foto()',var_v);
    }
    else    // resetejar
    {
        clearInterval(id_foto);

        foto_y_g_0=270*shp;
        foto_x_g_d=615*swp;
        dxg=15*swp;
        dyg=10*shp;
        foto_y_v_0=270*shp;
        foto_x_v_d=615*swp;
        dxv=15*swp;
        dyv=10*shp;

        id_foto=setInterval('anim_foto()',100);
    }

return;
}
