var myWidth=769;

function clientSideInclude(id, url) {
	
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id +
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}


function calculateDisclaimerOffset(){
	// da migliorara con calcolo dell'altezza della finestra visibile.
	var offset=window.pageYOffset;
	if (offset<=100)
	{
		myOffset=200;
	}else{
		myOffset=offset+100;
	}
	return myOffset;

}


function showDisclaimer(){

var disclaimerLeft=(((document.width-myWidth)/2)-1);
document.getElementById( 'disclaimer' ).style.left=disclaimerLeft+"px";

document.getElementById('velo').style.height=document.height+"px";

var myOffset=calculateDisclaimerOffset();

document.getElementById('velo').style.visibility='visible';
document.getElementById('disclaimer').style.top=myOffset+"px";
document.getElementById('disclaimer').style.visibility='visible';


if (document.getElementById('homeImage'))
	document.getElementById('homeImage').style.visibility="hidden";
}


function hideDisclaimer(){


document.getElementById('disclaimer').style.visibility='hidden';

document.getElementById('velo').style.visibility='hidden';
if (document.getElementById('homeImage'))
	document.getElementById('homeImage').style.visibility="visible";

}

function showFlashAnimationLarge(){
if(window.innerHeight !==undefined)
	var flashLeft=(((document.width-800)/2)-1);// most browsers
else{ // IE varieties
 var flashLeft= (((document.body.clientWidth-800)/2)-1);
}

document.getElementById( 'flashAnimationLarge' ).style.left=flashLeft+"px";
document.getElementById('flashAnimationLarge').style.visibility='visible';
document.getElementById('flashAnimationSmall').style.visibility='hidden';

}

function showProductTour1(){
if(window.innerHeight !==undefined)
	var flashLeft=(((document.width-1024)/2)-1);// most browsers
else{ // IE varieties
 var flashLeft= (((document.body.clientWidth-1024)/2)-1);
}

document.getElementById('productTour1' ).style.left=flashLeft+"px";
document.getElementById('productTour1').style.visibility='visible';
document.getElementById('productTour2').style.visibility='hidden';
document.getElementById('productTour3').style.visibility='hidden';

}

function showProductTour2(){
if(window.innerHeight !==undefined)
	var flashLeft=(((document.width-1024)/2)-1);// most browsers
else{ // IE varieties
 var flashLeft= (((document.body.clientWidth-1024)/2)-1);
}

document.getElementById('productTour2' ).style.left=flashLeft+"px";
document.getElementById('productTour2').style.visibility='visible';
document.getElementById('productTour1').style.visibility='hidden';
document.getElementById('productTour3').style.visibility='hidden';

}

function showProductTour3(){
if(window.innerHeight !==undefined)
	var flashLeft=(((document.width-1024)/2)-1);// most browsers
else{ // IE varieties
 var flashLeft= (((document.body.clientWidth-1024)/2)-1);
}

document.getElementById('productTour3' ).style.left=flashLeft+"px";
document.getElementById('productTour3').style.visibility='visible';
document.getElementById('productTour1').style.visibility='hidden';
document.getElementById('productTour2').style.visibility='hidden';

}

function closeFlashAnimationLarge(){
document.getElementById('flashAnimationLarge').style.visibility='hidden';
document.getElementById('flashAnimationSmall').style.visibility='visible';
//alert("ciao!");

}

function closeProductTour1(){
document.getElementById('productTour1').style.visibility='hidden';
//alert("ciao!");

}

function closeProductTour2(){
document.getElementById('productTour2').style.visibility='hidden';
//alert("ciao!");

}

function closeProductTour3(){
document.getElementById('productTour3').style.visibility='hidden';
//alert("ciao!");

}


function hideDisclaimer(){


document.getElementById('disclaimer').style.visibility='hidden';

document.getElementById('velo').style.visibility='hidden';
if (document.getElementById('homeImage'))
	document.getElementById('homeImage').style.visibility="visible";

}

function showContentSection(){

 // da modularizzare
 
var browserName=navigator.appName; 
var browserVer=parseInt(navigator.appVersion); 
var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;

if(IE6)
{	
	var offset = document.documentElement.clientHeight;
}else{
	var offset=gethtmlHeight();
}
  
  
  
  var h=document.getElementById('centerContent').offsetHeight;
  //alert("Altezza attuale content h:"+h);
  var top1 = document.getElementById('mainContent').offsetTop;
  
  
 //alert("altezza Utile off:"+offset);

  var v = offset-top1-50;
 //alert("new size v:"+v);
  
  var footer=offset+1;
  if(h<=v){
	//alert('setto a '+v);
   document.getElementById('mainContent').style.height=v+"px";
  // document.getElementById('footer').style.top=footer+"px";
   //document.getElementById('footer').style.left=leftOffset-8+"px";
  }else{
	  	//alert('setto a '+h);
	  document.getElementById('mainContent').style.height=h+"px";
  
  }
 // alert(document.getElementById('mainContent').offsetHeight);
}

function windimension(){
if(window.innerHeight !==undefined)A= [window.innerWidth,window.innerHeight]; // most browsers
else{ // IE varieties
var D= (document.body.clientWidth)? document.body: document.documentElement;
A= [D.clientWidth,D.clientHeight];
}
return A;
} 

function gethtmlHeight(){
if(window.innerHeight !==undefined)
	A= window.innerHeight; // most browsers
else{ // IE varieties
//alert(document.body);
//alert(document.documentElement);
	//var D= (document.body.clientWidth)? document.body: document.documentElement;
	var D= (document.documentElement.clientWidth)? document.documentElement:document.body;
	//alert(document.documentElement.clientHeight+"_"+document.body.clientHeight);
	A= D.clientHeight;
}
return A;
} 

 function testField(){
    var agree=document.getElementById('Agree').checked;
    var FirstName=document.getElementById('FirstName').value;
    var LastName=document.getElementById('LastName').value;
    var Email=document.getElementById('Email').value;
    var PhoneNumber=document.getElementById('PhoneNumber').value;
    var Company=document.getElementById('Company').value;
	
    var cIndustry=document.getElementById('Industry');
	var Industry=cIndustry.options[cIndustry.selectedIndex].value;
    var cLead=document.getElementById('Lead');
	//var Lead=cLead.options[cLead.selectedIndex].value;
        if (!agree){
            alert("You must accept Exeura's statement on Privacy Policy and Terms of Use");
            
            return false;
        }
        if (FirstName.length==0){
            alert('First Name is a mandatory field');
            return false;
        }
        if (LastName.length==0){
            alert('Last Name is a mandatory field');
            return false;
        }
        if (Email.length==0){
            alert('Email is a mandatory field');
           return false;
        }
        if (PhoneNumber.length==0){
            alert('Phone Number is a mandatory field');
           return false;
        }
        if (Company.length==0){
            alert('Company/Institution is a mandatory field');
            return false;
        }
		if (Industry.length==0){
            alert('Industry is a mandatory field');
            return false;
        }
       /* if (Lead.length==0){
            alert('Lead is a mandatory field');
            return false;
        }*/
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('demoRequest');
        myForm.submit();
        
}

function testField_IT(){
    var agree=document.getElementById('Agree').checked;
    var FirstName=document.getElementById('FirstName').value;
    var LastName=document.getElementById('LastName').value;
    var Email=document.getElementById('Email').value;
    var PhoneNumber=document.getElementById('PhoneNumber').value;
    var Company=document.getElementById('Company').value;
	
    var cIndustry=document.getElementById('Industry');
	var Industry=cIndustry.options[cIndustry.selectedIndex].value;
    var cLead=document.getElementById('Lead');
	//var Lead=cLead.options[cLead.selectedIndex].value;
        if (!agree){
            alert("Per proseguire devi accettare le condizioni d'uso e la normativa a tutela della privacy");
            
            return false;
        }
        if (FirstName.length==0){
            alert('Nome è un campo obbligatorio');
            return false;
        }
        if (LastName.length==0){
            alert('Cognome è un campo obbligatorio');
            return false;
        }
        if (Email.length==0){
            alert('Email è un campo obbligatorio');
           return false;
        }
        if (PhoneNumber.length==0){
            alert('Telefono è un campo obbligatorio');
           return false;
        }
        if (Company.length==0){
            alert('Azienda è un campo obbligatorio');
            return false;
        }
		if (Industry.length==0){
            alert('Settore è un campo obbligatorio');
            return false;
        }
       /* if (Lead.length==0){
            alert('Lead is a mandatory field');
            return false;
        }*/
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('demoRequest');
        myForm.submit();
        
}

 function testFieldA(){
    var agree=document.getElementById('Agree').checked;
    var FirstName=document.getElementById('FirstName').value;
    var LastName=document.getElementById('LastName').value;
    var Email=document.getElementById('Email').value;
    var PhoneNumber=document.getElementById('PhoneNumber').value;
    var Affiliation=document.getElementById('Affiliation').value;

	var AffiliationType=document.getElementById('AffiliationType').value;
	var AffiliationTypeOther=document.getElementById('AffiliationTypeOther').value;
	var AffiliationTypeOther=document.getElementById('AffiliationTypeOther').value;

	var AffiliationURL=document.getElementById('AffiliationURL').value;

	//var typeOfRialto=document.getElementById('typeOfRialto').value;
	
	var useOfRialto=document.getElementById('useOfRialto').value;
    var useOfRialtoOther=document.getElementById('useOfRialtoOther').value;
	var useOfRialtoClassroomInstructionName=document.getElementById('useOfRialtoClassroom/InstructionName').value;
	var useOfRialtoClassroomInstructionDuration=document.getElementById('useOfRialtoClassroom/InstructionDuration').value;
	var useOfRialtoClassroomInstructionLicense=document.getElementById('useOfRialtoClassroom/InstructionLicense').value;
	var useOfRialtoResearchActivity=document.getElementById('useOfRialtoResearchActivity').value;
	var useOfRialtoResearchDuration=document.getElementById('useOfRialtoResearchDuration').value;
	var useOfRialtoLabDuration=document.getElementById('useOfRialtoLabDuration').value;
	var useOfRialtoLabLicense=document.getElementById('useOfRialtoLabLicense').value;



  

    //var cIndustry=document.getElementById('Industry');
	//var Industry=cIndustry.options[cIndustry.selectedIndex].value;
    var cLead=document.getElementById('Lead');
	var Lead=cLead.options[cLead.selectedIndex].value;

	  
         if (!agree){
            alert("You must accept Exeura's statement on Privacy Policy and Terms of Use");
            
            return false;
        }
        if (FirstName.length==0){
            alert('First Name is a mandatory field');
            return false;
        }
        if (LastName.length==0){
            alert('Last Name is a mandatory field');
            return false;
        }
        if (Email.length==0){
            alert('Email is a mandatory field');
           return false;
        }
        if (PhoneNumber.length==0){
            alert('Phone Number is a mandatory field');
           return false;
        }
        if (Affiliation.length==0){
            alert('Institution/Affiliation is a mandatory field');
            return false;
        }
		/*if (AffiliationType.length==0){
            alert('Institution/Affiliation Type is a mandatory field');
            return false;
        }

		if (AffiliationType.length>0 && AffiliationType=="Other" && AffiliationTypeOther.length==0){
            alert('Institution/Affiliation is a mandatory field: if "Other" is selected is mandatory to add a description');
            return false;
        }

		
		
		
		if (Industry.length==0){
            alert('Industry is a mandatory field');
            return false;
        }
		
        if (Lead.length==0){
            alert('Lead is a mandatory field');
            return false;
        }
		
		if (typeOfRialto.length==0){
            alert('"What do you want download?;" is a mandatory field');
            return false;
        }*/

		if (useOfRialto.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field');
            return false;
        }
		
		if (useOfRialto.length>0 && useOfRialto=="Other" && useOfRialtoOther.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Other" is selected is mandatory to add a description');
            return false;
        }

		if (useOfRialto.length>0 && useOfRialto=="Classroom/Instruction" && useOfRialtoClassroomInstructionName.length==0){
			alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Classroom/Instruction" is selected is mandatory to add Course ID');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Classroom/Instruction" && useOfRialtoClassroomInstructionDuration.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Classroom/Instruction" is selected is mandatory to add Course Duration');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Classroom/Instruction" && useOfRialtoClassroomInstructionLicense.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Classroom/Instruction" is selected is mandatory to add how many licenses you need');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Research" && useOfRialtoResearchActivity.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Research" is selected is mandatory to add research activity description');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Research" && useOfRialtoResearchDuration.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Research" is selected is mandatory to add research activity duration');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Lab" && useOfRialtoLabDuration.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Lab" is selected is mandatory to add licenses duration');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Lab" && useOfRialtoLabLicense.length==0){
            alert('"How do you intend to use Riato&trade;" is a mandatory field: if "Lab" is selected is mandatory to add how many licenses you need');
            return false;
        }
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('demoRequest');	 
        myForm.submit();
        
}

function testFieldA1(){
    var agree=document.getElementById('Agree').checked;
	var StudentID=document.getElementById('StudentID').value;
    var FirstName=document.getElementById('FirstName').value;
    var LastName=document.getElementById('LastName').value;
    var Email=document.getElementById('Email').value;
	var CourseID=document.getElementById('CourseID').value;
	var ProfessorName=document.getElementById('ProfessorName').value;
    var Affiliation=document.getElementById('Affiliation').value;
		        
	if (!agree){
            alert("You must accept Exeura's statement on Privacy Policy and Terms of Use");
            
            return false;
        }
		if (StudentID.length==0){
            alert('StudentID is a mandatory field');
            return false;
        }
        if (FirstName.length==0){
            alert('First Name is a mandatory field');
            return false;
        }
        if (LastName.length==0){
            alert('Last Name is a mandatory field');
            return false;
        }
        if (Email.length==0){
            alert('Email is a mandatory field');
           return false;
        }
		if (CourseID.length==0){
            alert('Course ID is a mandatory field');
            return false;
        }
		if (ProfessorName.length==0){
            alert('Professor Name is a mandatory field');
            return false;
        }
        if (Affiliation.length==0){
            alert('Institution/Affiliation is a mandatory field');
            return false;
        }

			
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('demoRequest');
        myForm.submit();
        
}

function testFieldA_IT(){
    var agree=document.getElementById('Agree').checked;
    var FirstName=document.getElementById('FirstName').value;
    var LastName=document.getElementById('LastName').value;
    var Email=document.getElementById('Email').value;
    var PhoneNumber=document.getElementById('PhoneNumber').value;
    var Affiliation=document.getElementById('Affiliation').value;

	var AffiliationType=document.getElementById('AffiliationType').value;
	var AffiliationTypeOther=document.getElementById('AffiliationTypeOther').value;

	//var typeOfRialto=document.getElementById('typeOfRialto').value;

	var useOfRialto=document.getElementById('useOfRialto').value;
    var useOfRialtoOther=document.getElementById('useOfRialtoOther').value;
	var useOfRialtoClassroomInstructionName=document.getElementById('useOfRialtoClassroom/InstructionName').value;
	var useOfRialtoClassroomInstructionDuration=document.getElementById('useOfRialtoClassroom/InstructionDuration').value;
	var useOfRialtoClassroomInstructionLicense=document.getElementById('useOfRialtoClassroom/InstructionLicense').value;
	var useOfRialtoResearchActivity=document.getElementById('useOfRialtoResearchActivity').value;
	var useOfRialtoResearchDuration=document.getElementById('useOfRialtoResearchDuration').value;
	var useOfRialtoLabDuration=document.getElementById('useOfRialtoLabDuration').value;
	var useOfRialtoLabLicense=document.getElementById('useOfRialtoLabLicense').value;



  

    //var cIndustry=document.getElementById('Industry');
	//var Industry=cIndustry.options[cIndustry.selectedIndex].value;
    var cLead=document.getElementById('Lead');
	var Lead=cLead.options[cLead.selectedIndex].value;
        if (!agree){
            alert("Per proseguire devi accettare le condizioni d'uso e la normativa a tutela della privacy");
            
            return false;
        }
        if (FirstName.length==0){
            alert('Nome è un campo obbligatorio');
            return false;
        }
        if (LastName.length==0){
            alert('Cognome è un campo obbligatorio');
            return false;
        }
        if (Email.length==0){
            alert('Email è un campo obbligatorio');
           return false;
        }
        if (PhoneNumber.length==0){
            alert('Numero di Telefono è un campo obbligatorio');
           return false;
        }
        if (Affiliation.length==0){
            alert('Università/Centro di Ricerca è un campo obbligatorio');
            return false;
        }
		if (AffiliationType.length==0){
            alert('Tipo Università/Centro di Ricerca è un campo obbligatorio');
            return false;
        }
		
		if (AffiliationType.length>0 && AffiliationType=="Other" && AffiliationTypeOther.length==0){
            alert('Tipo Università/Centro di Ricerca è un campo obbligatorio: se hai selezionato "Altro" è necessario fornire una descrizione ');
            return false;
        }
		/*if (Industry.length==0){
            alert('Industry is a mandatory field');
            return false;
        }
		
        if (Lead.length==0){
            alert('Lead is a mandatory field');
            return false;
        }
		if (typeOfRialto.length==0){
            alert('"Cosa vuoi scaricare" è un campo obbligatorio');
            return false;
        }*/
		if (useOfRialto.length==0){
            alert('"Come intendi utilizzare Rialto" è un campo obbligatorio');
            return false;
        }
		
		if (useOfRialto.length>0 && useOfRialto=="Other" && useOfRialtoOther.length==0){
            alert('Come intendi utilizzare Rialto" è un campo obbligatorio: se hai selezionato "Altro" è necessario inserire una descrizione');
            return false;
        }

		if (useOfRialto.length>0 && useOfRialto=="Classroom/Instruction" && useOfRialtoClassroomInstructionName.length==0){
			alert('Come intendi utilizzare Rialto" è un campo obbligatorio: se hai selezionato "Scopi Didattici" è necessario inserire "Codice Corso"');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Classroom/Instruction" && useOfRialtoClassroomInstructionDuration.length==0){
            alert('Come intendi utilizzare Rialto" è un campo obbligatorio: se hai selezionato "Scopi Didattici" è necessario inserire "Durata (da-a)"');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Classroom/Instruction" && useOfRialtoClassroomInstructionLicense.length==0){
            alert('Come intendi utilizzare Rialto" è un campo obbligatorio: se hai selezionato "Scopi Didattici" è necessario inserire "Numero Licenze"');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Research" && useOfRialtoResearchActivity.length==0){
            alert('Come intendi utilizzare Rialto" è un campo obbligatorio: se hai selezionato "Ricerca" è necessario inserire "Descrizione Attività"');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Research" && useOfRialtoResearchDuration.length==0){
            alert('Come intendi utilizzare Rialto;" è un campo obbligatorio: se hai selezionato "Ricerca" è necessario inserire "Durata (da-a)"');
            return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Lab" && useOfRialtoLabDuration.length==0){
            alert('Come intendi utilizzare Rialto" è un campo obbligatorio: se hai selezionato "Laboratorio" è necessario inserire "Durata (da-a)"');
			return false;
        }
		if (useOfRialto.length>0 && useOfRialto=="Lab" && useOfRialtoLabLicense.length==0){
            alert('Come intendi utilizzare Rialto" è un campo obbligatorio: se hai selezionato "Laboratorio" è necessario inserire "Numero Licenze"');
            return false;
        }
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('demoRequest');
        myForm.submit();
        
}

function testDowload_IT(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	rialtoDiv= document.getElementById('rialtoDownload');
		
        if (!agree){
            alert("Per proseguire devi accettare le condizioni d'uso e la normativa a tutela della privacy");
            return false;
        }
		
        if (Email.length==0){
            alert('Email è un campo obbligatorio');
			document.getElementById('Agree').checked=false;
           return false;
        }
				
        if (!emailCheck(Email)){
			 document.getElementById('Agree').checked=false;
            return false;
        }
			
		
		rialtoDiv.style.display="block";        
          
}

function testDowload_EN(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	rialtoDiv= document.getElementById('rialtoDownload');
		
        if (!agree){
            alert("You must accept Exeura's statement on Privacy Policy and Terms of Use");
            return false;
        }
		
        if (Email.length==0){
            alert('Email is a mandatory field');
			document.getElementById('Agree').checked=false;
           return false;
        }
				
        if (!emailCheck(Email)){
			 document.getElementById('Agree').checked=false;
            return false;
        }
			
		
		rialtoDiv.style.display="block";        
          
}

function testDownloadSendWin_IT(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	document.getElementById('win').value="Windows";
	document.getElementById('mac').value="";
	document.getElementById('lin').value="";
	
		if (!agree){
            alert("Per proseguire devi accettare le condizioni d'uso e la normativa a tutela della privacy");
           	return false;
        }
		
       if (Email.length==0){
            alert('Email è un campo obbligatorio');
			document.getElementById('Agree').checked=false;
           return false;
        }
				
        if (!emailCheck(Email)){
			document.getElementById('Agree').checked=false;
            return false;
        }
			
		
        var myForm=document.getElementById('demoRequest');
        myForm.submit();
                                  
}

function testDownloadSendWin_EN(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	document.getElementById('win').value="Windows";
	document.getElementById('mac').value="";
	document.getElementById('lin').value="";
	
		if (!agree){
            alert("You must accept Exeura's statement on Privacy Policy and Terms of Use");
           	return false;
        }
		
       if (Email.length==0){
            alert('Email is a mandatory field');
			document.getElementById('Agree').checked=false;
           return false;
        }
				
        if (!emailCheck(Email)){
			document.getElementById('Agree').checked=false;
            return false;
        }
			
		
        var myForm=document.getElementById('demoRequest');
        myForm.submit();
                                  
}


function testDownloadSendMac_IT(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	document.getElementById('mac').value="Mac";
	document.getElementById('lin').value="";
	document.getElementById('win').value="";
	
		if (!agree){
            alert("Per proseguire devi accettare le condizioni d'uso e la normativa a tutela della privacy");
            
            return false;
        }
		
        if (Email.length==0){
            alert('Email è un campo obbligatorio');
			document.getElementById('Agree').checked=false;
            return false;
        }
				
        if (!emailCheck(Email)){
			document.getElementById('Agree').checked=false;
            return false;
        }
			
		
		var myForm=document.getElementById('demoRequest');
		myForm.submit(); 
	
        
          
}

function testDownloadSendMac_EN(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	document.getElementById('mac').value="Mac";
	document.getElementById('lin').value="";
	document.getElementById('win').value="";
	
		if (!agree){
            alert("You must accept Exeura's statement on Privacy Policy and Terms of Use");
            
            return false;
        }
		
        if (Email.length==0){
            alert('Email is a mandatory field');
			document.getElementById('Agree').checked=false;
            return false;
        }
				
        if (!emailCheck(Email)){
			document.getElementById('Agree').checked=false;
            return false;
        }
			
		
		var myForm=document.getElementById('demoRequest');
		myForm.submit(); 
	
        
          
}

function testDownloadSendLin_IT(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	document.getElementById('lin').value="Linux";
	document.getElementById('win').value="";
	document.getElementById('mac').value="";
	
		if (!agree){
            alert("Per proseguire devi accettare le condizioni d'uso e la normativa a tutela della privacy");
            
            return false;
        }
		
        if (Email.length==0){
            alert('Email è un campo obbligatorio');
			document.getElementById('Agree').checked=false;
            return false;
        }
				
        if (!emailCheck(Email)){
			document.getElementById('Agree').checked=false;
            return false;
        }
			
		
       	var myForm=document.getElementById('demoRequest');
        myForm.submit();                 
        
          
}

function testDownloadSendLin_EN(){
	var agree=document.getElementById('Agree').checked;
	var Email=document.getElementById('Email').value;
	document.getElementById('lin').value="Linux";
	document.getElementById('win').value="";
	document.getElementById('mac').value="";
	
		if (!agree){
            alert("You must accept Exeura's statement on Privacy Policy and Terms of Use");
            
            return false;
        }
		
        if (Email.length==0){
            alert('Email is a mandatory field');
			document.getElementById('Agree').checked=false;
            return false;
        }
				
        if (!emailCheck(Email)){
			document.getElementById('Agree').checked=false;
            return false;
        }
			
		
       	var myForm=document.getElementById('demoRequest');
        myForm.submit();                 
        
          
}

function softwareDownloadWin(){

	window.setTimeout("location.href='http://www.exeura.com/download/products/Rialto/Rialto2009/standard/windows/Rialto2009Installer.exe'",3000);
}

function softwareDownloadMac(){

	window.setTimeout("location.href='http://www.exeura.com/download/products/Rialto/Rialto2009/standard/mac/Rialto2009Installer.tar.gz'",3000);
}

function softwareDownloadLin(){

	window.setTimeout("location.href='http://www.exeura.com/download/products/Rialto/Rialto2009/standard/linux/Rialto2009Installer.bin'",3000);
}

function testFieldA1_IT(){
    var agree=document.getElementById('Agree').checked;
	var StudentID=document.getElementById('StudentID').value;
    var FirstName=document.getElementById('FirstName').value;
    var LastName=document.getElementById('LastName').value;
    var Email=document.getElementById('Email').value;
	var CourseID=document.getElementById('CourseID').value;
	var ProfessorName=document.getElementById('ProfessorName').value;
    var Affiliation=document.getElementById('Affiliation').value;

	
        if (!agree){
            alert("Per proseguire devi accettare le condizioni d'uso e la normativa a tutela della privacy");
            
            return false;
        }
		if (StudentID.length==0){
            alert('Matricola è un campo obbligatorio');
            return false;
        }
        if (FirstName.length==0){
            alert('Nome è un campo obbligatorio');
            return false;
        }
        if (LastName.length==0){
            alert('Cognome è un campo obbligatorio');
            return false;
        }
        if (Email.length==0){
            alert('Email è un campo obbligatorio');
           return false;
        }
		if (CourseID.length==0){
            alert('Nome/Codice Corso è un campo obbligatorio');
            return false;
        }
		if (ProfessorName.length==0){
            alert('Docente/Corso è un campo obbligatorio');
            return false;
        }
        if (Affiliation.length==0){
            alert('Università/Centro di Ricerca è un campo obbligatorio');
            return false;
        }
		
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('demoRequest');
        myForm.submit();
        
}


function testFieldB(){
    var Email=document.getElementById('entry_3').value;
   
        if (Email.length==0){
            alert('Email is a mandatory field');
           return false;
        }
       
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('feedbackRequest');
        myForm.submit();
        
}

function testFieldB_it(){
    var Email=document.getElementById('entry_2').value;
   
        if (Email.length==0){
            alert('Inserire il proprio indirizzo email');
           return false;
        }
       
        if (!emailCheck(Email)){
            return false;
        }
		
		
        var myForm=document.getElementById('feedbackRequest');
        myForm.submit();
        
}


function toggleState(combo){

oStateProvinceText=document.getElementById('StateProvinceText');
oStateProvinceTextCombo=document.getElementById('StateProvinceTextCombo');
	
if ((combo.value=='CANADA') || (combo.value=='UNITED STATES'))
{
oStateProvinceText.style.display="none";

}else{
oStateProvinceText.style.display="block";
oStateProvinceTextCombo.selectedIndex=0;
oStateProvinceTextCombo.style.display="none";
}
showContentSection();
}

function checkThisCombo(combo){
divName_other=combo.name+"OtherDiv";
divName_instruction=combo.name+"Classroom/InstructionDiv";
divName_research=combo.name+"ResearchDiv";
divName_lab=combo.name+"LabDiv";


divElement_other=document.getElementById(divName_other);
divElement_instruction=document.getElementById(divName_instruction);
divElement_research=document.getElementById(divName_research);
divElement_lab=document.getElementById(divName_lab);


if (combo.value=="Other"){
	divElement_other.style.display="block";
	divElement_lab.style.display="none";
	divElement_instruction.style.display="none";
	divElement_research.style.display="none";			
}
else{
	if(combo.value=="Classroom/Instruction"){
		divElement_instruction.style.display="block";
		divElement_other.style.display="none";
		divElement_research.style.display="none";
		divElement_lab.style.display="none";
		}

	else{
		if(combo.value=="Research"){
			divElement_research.style.display="block";
			divElement_instruction.style.display="none";
			divElement_other.style.display="none";
			divElement_lab.style.display="none";
		}

		else{
			if(combo.value=="Lab"){
			divElement_lab.style.display="block";
			divElement_instruction.style.display="none";
			divElement_other.style.display="none";
			divElement_research.style.display="none";
			}

			else{
				divElement_other.style.display="none";
				divElement_research.style.display="none";
				divElement_instruction.style.display="none";
				divElement_lab.style.display="none";

		   }
	   }
   }
	
}

showContentSection();

/*divName=combo.name+"OtherDiv";
divElement=document.getElementById(divName);

if (combo.value=="Other")
	divElement.style.display="block";
else
	divElement.style.display="none";

showContentSection();*/
}

function toggleUrlExample(){
oAffiliationURLExample_p1=document.getElementById('AffiliationURLExample_p1');
oAffiliationURLExample_p2=document.getElementById('AffiliationURLExample_p2');

if (oAffiliationURLExample_p1.style.display=="block")
{
	oAffiliationURLExample_p1.style.display="none"
	oAffiliationURLExample_p2.style.display="none"
}else{
	oAffiliationURLExample_p1.style.display="block"
	oAffiliationURLExample_p2.style.display="block"
}
showContentSection();
}

function toggleURLinput(valore){
	

oAffiliationURL=document.getElementById('AffiliationURL');


	oAffiliationURL.disabled=valore;
}

/*
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- V1.1.3: Sandeep V. Tamhankar (stamhankar@hotmail.com) -->
<!-- Original:  Sandeep V. Tamhankar (stamhankar@hotmail.com) -->
<!-- Changes:
 1.1.4: Fixed a bug where upper ASCII characters (i.e. accented letters
international characters) were allowed.

1.1.3: Added the restriction to only accept addresses ending in two
letters (interpreted to be a country code) or one of the known
TLDs (com, net, org, edu, int, mil, gov, arpa), including the
new ones (biz, aero, name, coop, info, pro, museum).  One can
easily update the list (if ICANN adds even more TLDs in the
future) by updating the knownDomsPat variable near the
top of the function.  Also, I added a variable at the top
of the function that determines whether or not TLDs should be
checked at all.  This is good if you are using this function
internally (i.e. intranet site) where hostnames don't have to 
conform to W3C standards and thus internal organization e-mail
addresses don't have to either.
Changed some of the logic so that the function will work properly
with Netscape 6.

1.1.2: Fixed a bug where trailing . in e-mail address was passing
(the bug is actually in the weak regexp engine of the browser; I
simplified the regexps to make it work).

1.1.1: Removed restriction that countries must be preceded by a domain,
so abc@host.uk is now legal.  However, there's still the 
restriction that an address must end in a two or three letter
word.

1.1: Rewrote most of the function to conform more closely to RFC 822.

1.0: Original  */



function emailCheck (emailStr) {

/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

/* The following string represents the range of characters allowed in a 
username or domainname.  It really states which chars aren't allowed.*/

var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Finally, let's start trying to figure out if the supplied address is valid. */

/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
   }
}

// See if "user" is valid 

if (user.match(userPat)==null) {

// user is not valid

alert("The username doesn't seem to be valid.");
return false;
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */

var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

// this is an IP address

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
   }
}
return true;
}

// Domain is symbolic name.  Check if it's valid.
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}

// Make sure there's a host name preceding the domain.

if (len<2) {
alert("This address is missing a hostname!");
return false;
}

// If we've gotten this far, everything's valid!
return true;
}

//  End -->



