// JavaScript Document
	var dominio="e-residence.info"
	var pausa=3500;
	var velocity=50;
	var timerId;	
	
function writemail(email,classe) {
	var myemail=email + "@" + dominio
	document.write("<a href=\"mailto:" + myemail + "\" class=\"" + classe + "\">" + myemail + "</a>");
}
function writesito(classe) {
	var mysito=dominio
	document.write("<a href=\"http://www." + mysito + "\" class=\"" + classe + "\">www." + mysito + "</a>");
}





function scrollv() {
	var contenitore,
		contenuto,
		hDist,
		box_width,
		max_width;
		
		contenuto=document.getElementById("testi_promo");
		contenitore=document.getElementById("contenitore_promo");
		box_width=contenitore.offsetHeight;
		
		max_Width=parseInt(contenuto.offsetHeight)+5;
		hDist=parseInt(contenuto.style.top)-1;
		//scrollo solo se la larghezza del contenuto è inferiore allo spostamento verso l'alto

		if (max_Width>Math.abs(parseInt(contenitore.offsetHeight))) {
				
			if (max_Width>Math.abs(parseInt(contenuto.style.top))) {
				contenuto.style.top=hDist.toString() + "px";
			} else {
				contenuto.style.top=box_width.toString() + "px";
			}
		}	
		timerId=setTimeout("scrollv()",velocity);
}

		function stop()
		{
		  clearTimeout(timerId);
		}
		
		function go()
		{
		  timerId=setTimeout("scrollh()",velocity);
		}
		
		
function vai(dove) {
document.location.href=dove;	
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
