xmlUrl = "http://www.hexeitalia.com/Xml/";
txtUrl = "http://www.hexeitalia.com/Testi/";
//xmlUrl = "http://cortesip/hexe/xml/";
//txtUrl = "http://cortesip/hexe/Testi/";


// Sezioni di Menu
menu=new Array('La Societa','Prodotti','Competenze','Consulenza');
items= new Array();
contatore=-1;


// Item Di Menu  // MenuPade, ItemDiMenu, pagina( nome file xml, chiave per valori xml )
items[contatore=contatore+1] = new Array( 'La Societa', 'Missione', 'index.html?id=Missione&src=LaSocieta' );
items[contatore=contatore+1] = new Array( 'La Societa', 'Contatti', 'index.html?id=Contatti&src=LaSocieta' );
items[contatore=contatore+1] = new Array( 'La Societa', 'Lavorare con noi', 'index.html?id=Lavoro&src=LaSocieta' );

items[contatore=contatore+1] = new Array( 'Prodotti', 'Ideas', 'prodotti.html?id=IdeasObbiettivo&src=Prodotti' );
items[contatore=contatore+1] = new Array( 'Prodotti', 'Arithmos', 'prodotti.html?id=Arithmos&src=Prodotti');
items[contatore=contatore+1] = new Array( 'Prodotti', 'Antarex', 'prodotti.html?id=Antarex&src=Prodotti' );

items[contatore=contatore+1] = new Array( 'Competenze', 'Aree di Competenza', 'index.html?id=AreeCompetenza&src=AreeCompetenza' );
items[contatore=contatore+1] = new Array( 'Competenze', 'Business Intelligence', 'index.html?id=BI&src=AreeCompetenza' );
items[contatore=contatore+1] = new Array( 'Competenze', 'Assicurazioni', 'index.html?id=Assicurazioni&src=AreeCompetenza' );
items[contatore=contatore+1] = new Array( 'Competenze', 'Banche', 'index.html?id=Banche&src=AreeCompetenza' );
items[contatore=contatore+1] = new Array( 'Competenze', 'Farmaceutiche', 'index.html?id=Pharma&src=AreeCompetenza' );
items[contatore=contatore+1] = new Array( 'Competenze', 'Finanziarie', 'index.html?id=Finanziaria&src=AreeCompetenza' );

items[contatore=contatore+1] = new Array( 'Consulenza', 'Consulenza', 'index.html?id=ConsulenzaHexe&src=Consulenza' );

// Query String Object 
function QueryString( ) 
{
    var qString = '';
    if ( window.location.search == 'undefined' || window.location.search == '' || window.location.search == null ) 
    {
        qString = defaultZone;
    }
    else
        qString = window.location.search;
        
    this.KeyXml = qString.substring( 4, qString.indexOf( "&") );
    this.SrcXml = qString.substring( qString.indexOf( "&") + 5, qString.length );
}
    
function AddSpace( ) 
{
   document.write( "<TABLE cellSpacing=0 cellPadding=0 border=0>" );
   document.write( "<TR><TD height=8></TD></TR></TBODY></TABLE>" );
}

function BuildIntestazione()
{
     document.write( Xml.Titolo );
   
}

function BuildTextDocument( heightDiv )
{
   document.write( "<DIV" );
   document.write( " class=divTextpage style='height:" + heightDiv +"px;'" );  
   document.write( ">" );
   document.write( "<table cellSpacing=0 cellPadding=0 border=0> ");
   document.write( "<tr>");
   document.write( "<td>");
   document.write( Xml.Testo );
   document.write( "</td>");
   document.write( "<td>");
   document.write( "&nbsp;&nbsp;&nbsp;" );
   document.write( "</td>");
   
   document.write( "</tr>");
   document.write( "</table>");
   document.write( "</DIV>" );   
}

function BuildObjectRight( )
{


}



function XML( ) 
{

    XMLFile = xmlUrl + queryString.SrcXml +".xml";
    if (window.ActiveXObject)
    {
      fullDoc = new ActiveXObject("Microsoft.XMLDOM");
      fullDoc.async="false";
      fullDoc.load(XMLFile);       
    }
    else if (document.implementation && document.implementation.createDocument)
    {
       fullDoc= document.implementation.createDocument("","doc",null);
       fullDoc.load(XMLFile);
    }
    master = fullDoc.getElementsByTagName( "xml" )[0];
    detail = master.getElementsByTagName( queryString.KeyXml )[0];
        
    this.Sezione = detail.getElementsByTagName( "Sezione" )[0].firstChild.nodeValue;
    this.Titolo = detail.getElementsByTagName( "Titolo" )[0].firstChild.nodeValue;
    
    try
    {
       this.Destra = detail.getElementsByTagName( "Destra" )[0].firstChild.nodeValue;
    } catch (e) 
    {
      this.Destra = null;
    }
       
    fileTesto = detail.getElementsByTagName( "Testo" )[0].firstChild.nodeValue;
    url = txtUrl + fileTesto;
    var xmlhttp=new HTTP();
    
    xmlhttp.open("GET",url,false);
    xmlhttp.setRequestHeader('Server','Apache/13.26 (Unix) PHP/4.2.3');
    xmlhttp.setRequestHeader('Content-Type','text/html; charset=SO-8859-1');
    xmlhttp.setRequestHeader('Connection','Keep-Alive');
    xmlhttp.setRequestHeader('Accept','text/html');
    xmlhttp.setRequestHeader('Accept','message/x-jl-formresult')
    xmlhttp.send();

    if (xmlhttp.readyState==4) 
    {
       this.Testo = xmlhttp.responseText;
    }
    
    //alert( this.Testo );
    //alert( xmlhttp.getAllResponseHeaders() );
}



/////////////////////////////
function HTTP() {
 var xmlhttp;

   try 
   {
     xmlhttp=new ActiveXObject("Msxml2.XMLHTTP.4.0");
   } catch (e) 
   {
     try 
     {
      xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
     } catch (E) 
     {
       xmlhttp=false;
     }
   }

 if (!xmlhttp) 
 {
   try 
   {
      xmlhttp = new XMLHttpRequest();
   } catch (e) 
   {
     xmlhttp=false;
    }
  }
 return xmlhttp;
}


function CercaPagina( itemParent ) 
{
   retVal = 'index.html';

   for( cMenuChild=0;cMenuChild<items.length;cMenuChild++)
   {
       itemMenu = items[cMenuChild];
       itemUrl = itemMenu[2];
       if ( itemParent == itemMenu[0] )
       {
        return itemUrl;
        //return itemUrl.substring( 0, itemUrl.indexOf( "?"));
       }
   }
   return retVal;
}

function MakeBig( image ) 
{
   window.open( "images.html?" + image, "Imm", "menubar=0,status=0,toolbar=0,scrollbars,resizable" );
}