// JavaScript Document
/* The following function creates an XMLHttpRequest object... */

function createRequestObject()
{
        var request_o; //declare the variable to hold the object.
        var browser = navigator.appName; //find the browser name
        if(browser == "Microsoft Internet Explorer")
        {
                /* Create the object using MSIE's method */
                request_o = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else
        {
                /* Create the object using other browser's method */
                request_o = new XMLHttpRequest();
        }
        return request_o; //return the object
}
/* You could get more specific with version information by using
        parseInt(navigator.appVersion)
        Which will extract an integer value containing the version
        of the browser being used.
*/


/* The variable http will hold our new XMLHttpRequest object. */
var http = createRequestObject();

/* Function called to get the product categories list */

function ValorID(contenedor){
        http.open('get', 'imagen.php?id_adjunto=' + contenedor );
        http.onreadystatechange = handleProducts;
        http.send(null);
}
/* Function called to handle the list that was returned from the internal_request.php file.. */
/*function handleProducts_subsector(){
        //alert(http.readyState);
        if(http.readyState == 1){
                document.getElementById('div_subsector').innerHTML = "<table width=302 border=0 cellspacing=0 cellpadding=0 height=30><tr><td bgcolor=#000000><table width=300 border=0 cellspacing=1 cellpadding=0 height=28 align=center><tr><td bgcolor=#00FF00>&nbsp;</td><td bgcolor=#FFFFFF>&nbsp;</td><td bgcolor=#FFFFFF>&nbsp;</td></tr></table></td></tr></table>";
        }
        if(http.readyState == 3){
                document.getElementById('div_subsector').innerHTML = "<table width=302 border=0 cellspacing=0 cellpadding=0 height=30><tr><td bgcolor=#000000><table width=300 border=0 cellspacing=1 cellpadding=0 height=28 align=center><tr><td bgcolor=#00FF00>&nbsp;</td><td bgcolor=#00FF00>&nbsp;</td><td bgcolor=#00FF00>&nbsp;</td></tr></table></td></tr></table>";
        }
        if(http.readyState == 2){
                document.getElementById('div_subsector').innerHTML = "<table width=302 border=0 cellspacing=0 cellpadding=0 height=30><tr><td bgcolor=#000000><table width=300 border=0 cellspacing=1 cellpadding=0 height=28 align=center><tr><td bgcolor=#00FF00>&nbsp;</td><td bgcolor=#00FF00>&nbsp;</td><td bgcolor=#FFFFFF>&nbsp;</td></tr></table></td></tr></table>"; // '<table width="300" border="0" cellspacing="0" cellpadding="0"><tr> <td bgcolor="#00FF00">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table>';
        }
        if(http.readyState == 4){
                var response = http.responseText;
                document.getElementById('div_subsector').innerHTML = response;
        }
}*/
/* Function called to handle the list that was returned from the internal_request.php file.. */
function handleProducts(){
        if(http.readyState == 4){ //Finished loading the response
                var response = http.responseText;
                document.getElementById('div_subsector').innerHTML = response;
        }
}
