function onFilaOver( obj )
{
    obj.className = "filaover";
}

function onFilaOut( obj, clase )
{
    obj.className = clase;
}

function mostrardiv( id )
{
	var n4 = (document.layers)? true:false;
 	var ie = (document.all)? true:false;
 	var n6 = (document.getElementById)? true:false;
		
	 	if (n4)
		{
            document.ventana.document.layers[id].visibility = "visible";
		}
     	else if (ie)
		{
            document.all[id].style.visibility = "visible";
		}
        else if (n6)
		{
            document.getElementById(id).style.visibility = "visible";
		}
}

function ocultardiv( id )
{
	var n4 = (document.layers)? true:false;
 	var ie = (document.all)? true:false;
 	var n6 = (document.getElementById)? true:false;
		
	 	if (n4)
            document.ventana.document.layers[id].visibility = "hide";
     	else if (ie)
            document.all[id].style.visibility = "hidden";
        else if (n6)
            document.getElementById(id).style.visibility = "hidden";
}

function onReloadPage( )
{
    document.location.reload();
}

//LISTADO
var currentProducto = 0;

function onEditOferta( id )
{
    var idProd = 0;
    var sURL = "";

	//cargando();
	
    if( id == null )
    {
        if( currentProducto == 0 )
        {
            alert( "Tiene que seleccionar una oferta" );
            return;
        }
        else
        {
            idProd = currentProducto;
        }
    }
    else
    {
        idProd = id;
    }

    sURL = "oferta.php?id=" + idProd;
	
    document.location = sURL;
}

function onEditOfertaAdm( id )
{
    var idProd = 0;
    var sURL = "";

	//cargando();
	
    if( id == null )
    {
        if( currentProducto == 0 )
        {
            alert( "Tiene que seleccionar una oferta" );
            return;
        }
        else
        {
            idProd = currentProducto;
        }
    }
    else
    {
        idProd = id;
    }

    sURL = "admin.php?op=ofertas&id=" + idProd;
	
    document.location = sURL;
}

function onFilaOver( obj )
{
    obj.className = "filaover";
}

function onFilaOut( obj, clase )
{
    obj.className = clase;
}

function mostrardiv( id )
{
	var n4 = (document.layers)? true:false;
 	var ie = (document.all)? true:false;
 	var n6 = (document.getElementById)? true:false;
		
	 	if (n4)
		{
            document.ventana.document.layers[id].visibility = "visible";
		}
     	else if (ie)
		{
            document.all[id].style.visibility = "visible";
		}
        else if (n6)
		{
            document.getElementById(id).style.visibility = "visible";
		}
}

function ocultardiv( id )
{
	var n4 = (document.layers)? true:false;
 	var ie = (document.all)? true:false;
 	var n6 = (document.getElementById)? true:false;
		
	 	if (n4)
            document.ventana.document.layers[id].visibility = "hide";
     	else if (ie)
            document.all[id].style.visibility = "hidden";
        else if (n6)
            document.getElementById(id).style.visibility = "hidden";
}

function onReloadPage( )
{
    document.location.reload();
}

//LISTADO
var currentProducto = 0;

function onEditOferta( id )
{
    var idProd = 0;
    var sURL = "";

	//cargando();
	
    if( id == null )
    {
        if( currentProducto == 0 )
        {
            alert( "Tiene que seleccionar una oferta" );
            return;
        }
        else
        {
            idProd = currentProducto;
        }
    }
    else
    {
        idProd = id;
    }

    sURL = "oferta.php?id=" + idProd;
	
    document.location = sURL;
}

function onEditTrabajo( id )
{
    var idProd = 0;
    var sURL = "";

	//cargando();
	
    if( id == null )
    {
        if( currentProducto == 0 )
        {
            alert( "Tiene que seleccionar un trabajo" );
            return;
        }
        else
        {
            idProd = currentProducto;
        }
    }
    else
    {
        idProd = id;
    }

    sURL = "admin.php?op=trabajos&id=" + idProd;
	
    document.location = sURL;
}


function onEliminaOferta( idProducto, evt )
{
	evt.cancelBubble = true;
	
    var sURL = "";

    sURL = "dbofertas.php?delete=" + idProducto;
    document.location = sURL;
}

function onEliminaTrabajo( idProducto, evt )
{
	evt.cancelBubble = true;
	
    var sURL = "";

    sURL = "dbtrabajos.php?delete=" + idProducto;
    document.location = sURL;
}