// JavaScript Document
//#### Funzione per caricare diversi stati pagine interne.
function display_block(b) {
	document.getElementById('tab'+b).style.display = "block";
	document.getElementById('giu'+b).style.display = "none";
	document.getElementById('su'+b).style.display = "block";
}
function hide_block(b) {
	document.getElementById('tab'+b).style.display = "none";
	document.getElementById('su'+b).style.display = "none";
	document.getElementById('giu'+b).style.display = "block";
}

function trasporto() {
	document.getElementById('Trasporto').options[2].selected=true;
	document.getElementById('trasp').style.display = "none";
}
function trasporto_show() {
	document.getElementById('Trasporto').options[0].selected=true;
	document.getElementById('trasp').style.display = "block";
}

function richiesta_ok()
{
	document.location=('preventivo_ok.asp');
}


function GetE( elementId )
{
	return document.getElementById( elementId )  ;
}

function OnChangeistopato()
{
document.getElementById('istocito').style.display = "block";
var OK = window.confirm("Devi compilare i campi Dati Clinici ISTO-CITO!");
if (OK) {
	return true;
	} else {
	return false;
	}}

function OnChangespecie()
{
	cliente=GetE('cliente').value;
	paziente=GetE('paziente').value;
	specie= GetE('Specie').value;
	
	document.location=('preventivo.asp?specie='+specie+'&cliente='+cliente+'&paziente='+paziente);
}

function OnChangestandard()
{
	cliente=GetE('cliente').value;
	paziente=GetE('paziente').value;
	specie= GetE('Specie').value;
	razza=GetE('Razza').value;
	if (GetE('Sesso1').checked == true){
	sesso=GetE('Sesso1').value;
	}
	else {
	sesso=GetE('Sesso2').value;
	}
	if (GetE('inviato1').checked == true){
	inviato=GetE('inviato1').value;
	}
	else {
	inviato=GetE('inviato2').value;
	}
	etaa=GetE('etaa').value;
	etam=GetE('etam').value;
	anamnesi=GetE('Anamnesi').value;
	esamefisico=GetE('Esamefisico').value;
	if (GetE('esames').value>0)
	{
	esames=GetE('esames').value;
	}
	else
	{
	esames=0;
	}
	//esames=GetE('esames').value;
	Esameistocito=GetE('Esameistocito').value;
	document.location=('preventivo.asp?inviato='+inviato+'&specie='+specie+'&cliente='+cliente+'&paziente='+paziente+'&razza='+razza+'&sesso='+sesso+'&etaa='+etaa+'&etam='+etam+'&anamnesi='+anamnesi+'&esamefisico='+esamefisico+'&esames='+esames+'&Esameistocito='+Esameistocito);
}

function OnChangecampioni(cont)
{
	cliente=GetE('cliente').value;
	paziente=GetE('paziente').value;
	specie= GetE('Specie').value;
	razza=GetE('Razza').value;
	if (GetE('Sesso1').checked == true){
	sesso=GetE('Sesso1').value;
	}
	else {
	sesso=GetE('Sesso2').value;
	}
	Colturale=0;	
	for (j=1; j<=cont; j++) {
		if (GetE('Colturale'+j).checked == true){
		Colturale=GetE('Colturale'+j).value;
		}
    }
	//window.confirm("contatore= "+Colturale);
	etaa=GetE('etaa').value;
	etam=GetE('etam').value;
	anamnesi=GetE('Anamnesi').value;
	esamefisico=GetE('Esamefisico').value;
	if (GetE('esames').value>0)
	{
	esames=GetE('esames').value;
	}
	else
	{
	esames=0;
	}
	campione9=GetE('campione9').value;
	campione26=GetE('campione26').value;
	Esameistocito=GetE('Esameistocito').value;
	stringa=('preventivo.asp?specie='+specie+'&cliente='+cliente+'&paziente='+paziente+'&razza='+razza+'&sesso='+sesso+'&etaa='+etaa+'&etam='+etam+'&anamnesi='+anamnesi+'&esamefisico='+esamefisico+'&esames='+esames+'&Esameistocito='+Esameistocito);
	document.location=stringa +'&campione9='+campione9 +'&campione26='+campione26+'&Colturale='+Colturale
}
function OnChangepcr()
{
if (GetE('vaccinale').value == '') {
var OK1 = window.confirm("Devi compilare il campo Storia vaccinale!");
if (OK1) {
	return true;
	} else {
	return false;
}	
}
}

function iFrameHeight(cosa) {
if(document.getElementById && !(document.all)) {//Netscape e altri 
//h = document.getElementById(cosa).contentDocument.body.parentNode.scrollHeight;
h = document.getElementById(cosa).contentDocument.body.parentNode.offsetHeight;
//h = document.getElementById(cosa).contentDocument.body.offsetHeight;
//alert(h)
document.getElementById(cosa).height = h;
}
else if(document.all) {//IE
h = document.frames(cosa).document.body.scrollHeight;
document.all[cosa].style.height = h;
}
};


function cambia_classe(cosa,classe) {
if(document.getElementById && !(document.all)) {//Netscape e altri

document.getElementById(cosa).className = classe;
}
else if(document.all) {//IE	
document.all[cosa].className = classe;
}
};

function MM_openBrWindow(theURL,winName,features) { //v2.0
//window.open(theURL,winName,features);
window.open(theURL,winName,features);
}

function check(){
var OK = window.confirm("Sicuro di voler cancellare ?");
if (OK) {
	return true;
	} else {
	return false;
	}
}

function check1(){
var OK = window.confirm("Sicuro di voler Spostare ?");
if (OK) {
	return true;
	} else {
	return false;
	}
}

function check2(){
var OK = window.confirm("Sicuro di voler cambiare visualizzazione in HomePage ?");
if (OK) {
	return true;
	} else {
	return false;
	}
}

function vai_indietro(){
	if(document.getElementById && !(document.all)) {//Netscape e altri 
history.go(-1);
}
else if(document.all) {//IE
history.back();
}
}



	