function getEquiThumbs( marca )
{
    //$( 'equiMarcaDiv' ).setHTML("<img src='img/marcas/equi_marca_" + marca + ".jpg' />");
    /*
    generalProcess(
        {   'action'    :   'equi_thumbs',
            'update'    :   'equiThumbsDiv',
            'marca'     :   marca
        }
    );
    */
}
function filtraEquipos( el, idDiv, idUpdate, func )
{
    generalProcess(
        {   'action'    :   'filtra_equipos',
            'like'      :   el.value,
            'update'    :   idDiv,
            'idUpdate'  :   idUpdate,
            'func'      :   func
        }
    );
}
function get360( obj )
{
    obj.action      =   'equi_carrusel_swf';
    obj.update      =   'divCarrusel';
    generalProcess( obj );
}
function carrusel( obj )
{
    obj.update = 'divCarrusel';
    obj.action  =   'equi_carrusel';
    generalProcess( obj );
}
function closeFicha()
{
    if( $( 'divFicha' ) ) $( 'divFicha' ).remove();
    if( $( 'divBg' ) ) $( 'divBg' ).remove();
}
function equiDesc( equi_id )
{
    if( $( 'divFicha' ) ) $( 'divFicha' ).remove();
    if( $( 'divBg' ) ) $( 'divBg' ).remove();
    new Element( 'div',
        {   'id'    :   'divBg',
            'styles'    :   {   'position'  :   'absolute',
                                'top'       :   '0px',
                                'left'      :   '0px',
                                'width'     :   '100%',
                                'height'    :   '100%',
                                'background-image'  :   'url(img/bg1.png)'
                            }
        }
    ).inject( document.body );
    new Element( 'div',
        {   'id'    :   'divFicha',
            'styles'    :   {   'position'  :   'absolute',
                                'width'     :   '637px',
                                'height'    :   '377px'
                            }
        }
    ).inject( document.body );
    moveToCenter( 'divFicha', {} );
    generalProcess(
        {   'action'    :   'equi_ficha',
            'equi_id'   :   equi_id,
            'update'    :   'divFicha'
        }
    );
}
function login()
{   
    new Ajax( urlProcesos,
        {   'method' : 'get',
            'data'      :   {   'action' : 'login',
                                'user'  :   $( 'user' ).value,
                                'pass'  :   $( 'password' ).value
                            },
            'evalScripts' : true
        }
    ).request();
}
function logout()
{
    new Ajax( urlProcesos,
        {   'method'    :   'get',
            'data'      :   {   'action'    :   'logout' },
            'evalScripts' : true
        }
    ).request();
}
function generalProcess( obj )
{
    var ajaxObj = {     'method'        :   'get', 
                        'data'          :   obj,
                        'evalScripts'   :   true 
                  };
    if( obj.update )
    {
        ajaxObj.update = $( obj.update );
    }
    new Ajax( urlProcesos, ajaxObj).request();
}
/**
 *  REGISTROS
 */
function regiFormDiv()
{
    if( $( 'div_regi_form' ) ) $( 'div_regi_form' ).remove();

    new Element( 'div', { 'id' : 'div_regi_form' } ).inject( document.body );
    $( 'div_regi_form' ).setStyles(
        {   'position'  :   'absolute',
            'width'     :   '300px',
            'height'    :   '150px',
            'background-color' : '#ffffff',
            'border'    :   'solid 2px #cdcdcd'
        }
    );
    moveToCenter( 'div_regi_form', {} );
}
function editRegiParam( obj )
{
    regiFormDiv();
    obj.action = 'edit_regi_params';
    obj.update = 'div_regi_form';
    obj.W = 300;
    obj.H = 150;

    generalProcess( obj );
}
function newRegiParam( obj )
{
    regiFormDiv();
    obj.action = 'new_regi_params';
    obj.update = 'div_regi_form';
    obj.W = 300;
    obj.H = 150;
    generalProcess( obj );
}
function saveRegiData( obj )
{
    obj.action      =   'save_' + $( 'regi_action' ).value;
    obj.regi_clave  =   $( 'regi_clave' ).value;
    obj.regi_valor  =   $( 'regi_valor' ).value;
    obj.next_val    =   $( 'next_val' ).value;
    obj.regi_desc   =   $( 'regi_desc' ).value;
    generalProcess( obj );
}
function deleteRegiData( obj )
{
    obj.action      =   'delete_regi_data',
    generalProcess( obj );
}
