function blank(a) { if(a.value == a.defaultValue) a.value = ""; }
function unblank(a) { if(a.value == "") a.value = a.defaultValue; }


if (document.images)
{
  pic1= new Image(100,25); 
  pic1.src="/images/marketing_roll.jpg"; 

  pic2= new Image(240,55); 
  pic2.src="/images/technology_roll.jpg"; 

  pic3= new Image(88,31); 
  pic3.src="/images/design_roll.jpg"; 
  
  pic4= new Image(88,31); 
  pic4.src="/images/events_roll.jpg";   
  
  pic5= new Image(88,31); 
  pic5.src="/images/richiedi_roll.jpg";   
  
  pic6= new Image(88,31); 
  pic6.src="/images/tasti/home_roll.png";  
  pic7= new Image(88,31); 
  pic7.src="/images/tasti/profilo_roll.png";  
  pic8= new Image(88,31); 
  pic8.src="/images/tasti/divisioni_roll.png";  
  pic9= new Image(88,31); 
  pic9.src="/images/tasti/prodotti_roll.png";  
  pic10= new Image(88,31); 
  pic10.src="/images/tasti/soluzioni_roll.png";  
  pic11= new Image(88,31); 
  pic11.src="/images/tasti/gruppo_roll.png";  
  pic12= new Image(88,31); 
  pic12.src="/images/tasti/portfolio_roll.png";                
  pic13= new Image(88,31); 
  pic13.src="/images/tasti/contatti_roll.png";    
  
}







/*
	DOMnews 1.0 
	homepage: http://www.onlinetools.org/tools/domnews/
	released 11.07.05
*/

/* Variabili che è possibile cambiare */
	// posizione iniziale 
	var dn_startpos=90; 			
	// posizione finale
	var dn_endpos=-280;
  
   			
	// Velocità dello scroller: un numero più alto indica una velocità inferiore 
	var dn_speed=20;				
	// ID da assegnare al box delle news nel codice HTML
	var dn_newsID='news';			
	// classe che lo script aggiunge quando Javascript è dsisponibile
	var dn_classAdd='hasJS';		
	// Messaggio del link che stoppa lo scroller
	var dn_stopMessage='';	
	// ID del paragrafo generato
	var dn_paraID='DOMnewsstopper';

	/* Initialise scroller when window loads */
	window.onload=function()
	{
		// check for DOM
		if(!document.getElementById || !document.createTextNode){return;}
		initDOMnews();
		// add more functions as needed
	}
	/* stop scroller when window is closed */
	window.onunload=function()
	{
		clearInterval(dn_interval);
	}

/*
	This is the functional bit, do not press any buttons or flick any switches
	without knowing what you are doing!
*/

	var dn_scrollpos=dn_startpos;
	/* Initialise scroller */
	function initDOMnews()
	{
		var n=document.getElementById(dn_newsID);
		if(!n){return;}
		n.className=dn_classAdd;
		dn_interval=setInterval('scrollDOMnews()',dn_speed);
		var newa=document.createElement('a');
		//var newp=document.createElement('p');
		//newp.setAttribute('id',dn_paraID);
		newa.href='#';
		//newa.appendChild(document.createTextNode(dn_stopMessage));
		newa.onclick=stopDOMnews;
		//newp.appendChild(newa);
		//n.parentNode.insertBefore(newp,n.nextSibling);
		n.onmouseover=function()
		{		
			clearInterval(dn_interval);
		}
		n.onmouseout=function()
		{
			dn_interval=setInterval('scrollDOMnews()',dn_speed);
		}
	}

	function stopDOMnews()
	{
		clearInterval(dn_interval);
		var n=document.getElementById('news');
		n.className='';
		n.parentNode.removeChild(n.nextSibling);
		return false;
	}
	function scrollDOMnews()
	{
		var n=document.getElementById(dn_newsID).getElementsByTagName('ul')[0];
		n.style.top=dn_scrollpos+'px';	
		if(dn_scrollpos==dn_endpos){dn_scrollpos=dn_startpos;}
		dn_scrollpos--;	
	}

























// inizio invio newsletter 

var xmlHttp;
var gid;



function send_message()
{

if (document.getElementById("newsletter").value.length==0) {alert("Campo email non valido!");return false;}

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Browser senza supporto AJAX! Impossibile continuare.");
  return;
  } 
  
var url="send_mail_newsletter.php";
url=url+"?e="+document.getElementById("newsletter").value;
url=url+"&r="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
r=xmlHttp.responseText;
    if (r == 1){
    
    //document.getElementById("emailSuccess").style.display='block';
    document.getElementById("newsletter").value="email@domain.com";
    alert ("iminds group\nRegistrazione riuscita!")
    //setTimeout("document.getElementById('emailSuccess').style.display='none';",8000);
    
    }else{
    alert ("Errore in fase di invio!")
    //document.getElementById("emailFail").style.display='block';
    //document.getElementById("emailFail").innerHTML="Errore in invio. Messaggio non trasmesso.<br>Errore: "+r;
    
    } 

}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
