// JavaScript Document

function vedi(_w,_h) {
    if (_h=='s') {
	eval("document.getElementById('corpo"+_w+"').style.visibility='visible';");
	eval("document.getElementById('corpo"+_w+"').style.position='relative';");
	eval("document.getElementById('corpo"+_w+"').style.display='inline';");

	eval("document.getElementById('soluzioni"+_w+"').style.backgroundColor='#8995ab';");
	eval("document.getElementById('soluzioni"+_w+"').style.color='#FFFFFF';");
	eval("document.getElementById('idselezionato').value='"+_w+"';");
	
	}
    if (_h=='h') {
	eval("document.getElementById('corpo"+_w+"').style.visibility='hidden';");
	eval("document.getElementById('corpo"+_w+"').position='absolute';");
	eval("document.getElementById('corpo"+_w+"').style.display='none';");
	}
}

function vedi2(_w,_h) {
    if (_h=='h') {
	eval("document.getElementById('corpo2"+_w+"').style.visibility='hidden';");
	eval("document.getElementById('corpo2"+_w+"').style.position='absolute';");
	eval("document.getElementById('corpo2"+_w+"').style.display='none';");
	}
    if (_h=='s') {
	eval("document.getElementById('corpo2"+_w+"').style.visibility='visible';");
	eval("document.getElementById('corpo2"+_w+"').style.position='relative';");
	eval("document.getElementById('corpo2"+_w+"').style.display='block';");
	}
}

function nasconditutti() {
_x=0;
while (_x<1000) {
	var corpo="corpo"+_x;
 	
	var oggetto=document.getElementById(corpo); 
    if (oggetto!=null) { 
	eval("document.getElementById('corpo"+_x+"').style.visibility='hidden';");
	eval("document.getElementById('corpo"+_x+"').position='absolute';");
	eval("document.getElementById('corpo"+_x+"').style.display='none';");
	}
	_x++;
}	

_x=0;
while (_x<1000) {
	var corpo="soluzioni"+_x;
 	var oggetto=document.getElementById(corpo); 
    if (oggetto!=null) { 
	eval("document.getElementById('soluzioni"+_x+"').style.backgroundColor='#FFFFFF';");
	eval("document.getElementById('soluzioni"+_x+"').style.color='#666666';");
	}
	_x++;
}	

}

function chiamatacrm(url) {
//Inizia l'url con http?
if (url.substring(0, 4) != 'http') {
url = base_url + url;
}
// Crea un nuovo elemento JS
var jsel = document.createElement('SCRIPT');
jsel.type = 'text/javascript';
jsel.src = url;
//Appende l'elemento JS e quindi esegue la 'chiamata AJAX'
document.body.appendChild(jsel);
}

function scrivisessioneGetLicensesInfo(stampa) {

var stampa=stampa;

var testodascrivere=document.getElementById("licensesinfo").innerHTML;

htmlRequest = ajax();
  // controllo nel caso in cui non possa richiamato l'oggetto Xmlhttp
  if (htmlRequest==null){ 
    alert ("Il browser non supporta richieste HTTP");
    return;
  }
  
htmlRequest.onreadystatechange = function(){
   // Restituisce lo stato della richiesta
   if(htmlRequest.readyState == 4){
     // Restituice il corpo della risposta come stringa
      document.getElementById("vedilicenze").innerHTML = htmlRequest.responseText;
   }
 }

// chiamata della pagina PHP che estrae i records 
htmlRequest.open("GET", 'scrivisessioneGetLicensesInfo.php?testodascrivere='+testodascrivere+'&stampa='+stampa, true);

htmlRequest.send(null);


}

function scrivisessioneCustomerCode() {

var customercode=document.getElementById("customercode").innerHTML;

if (customercode=='' || customercode=='Attesa...') { customercode=''; }

htmlRequest = ajax();
  // controllo nel caso in cui non possa richiamato l'oggetto Xmlhttp
  if (htmlRequest==null){ 
    alert ("Il browser non supporta richieste HTTP");
    return;
  }
  
htmlRequest.onreadystatechange = function(){
   // Restituisce lo stato della richiesta
   if(htmlRequest.readyState == 4){
     // Restituice il corpo della risposta come stringa
      document.getElementById("vedilicenze").innerHTML = htmlRequest.responseText;
   }
 }

// chiamata della pagina PHP che estrae i records 
htmlRequest.open("GET", 'scrivisessioneCustomerCode.php?customercode='+customercode, true);

htmlRequest.send(null);


}



