var tbm=new Array('Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre');
var tbg=new Array("Lunedi", "Martedi", "Mercoledi", "Mercoledi", "Giovedi", "Venerdi", "Sabato", "Domenica");
var CurrDt=new String; var CurrTm=new String;var Hallo=new String;
var bookmarkurl="http://ilcottobello.altervista.org";
var bookmarktitle="Il Cotto Bello - di Marco Brunello";
var scrtxt="Il Cotto Bello - Trattamento, Pulizia, Rinnovo e Antichizzazione di Pavimentazioni in Cotto e Pietra"; 
var lentxt=scrtxt.length;
var width=106; var ctr=15;
var pos=1-width;
function addbookmark(){
if (document.all) window.external.AddFavorite(bookmarkurl, bookmarktitle)
}
function homepage() {  
if(document.all) 
	document.body.style.behavior='url(#default#homepage)';
	document.body.setHomePage(bookmarkurl);
}
function Delay() {
setTimeout('Delay()',100);
txtscroll();
if (ctr > 10) {
	ShowTime();
	ctr=0;
} else { ctr++; }
}
function txtscroll() {
pos++;
var scroller="";
if (pos==lentxt) {pos=1-width;}
if (pos<0) {
 for (var i=1; i<=Math.abs(pos); i++) {scroller=scroller+" ";}
 scroller=scroller+scrtxt.substring(0,width-i+1); 
} else {scroller=scroller+scrtxt.substring(pos,width+pos);}
window.status=scroller;
}
function ShowTime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var SysDay=now.getDate();
var SysYear=now.getYear();
if (hours < 10) { hours="0"+hours; }
if (hours < 6)  Hallo="Buona Notte" ;
		else if (hours < 12) Hallo="Buon Giorno"; 
			else if (hours <= 17) Hallo="Buon Pomeriggio"; 
				else if (hours < 22) Hallo="Buona Sera"; 
					else Hallo="Buona Notte";
Hallo="<B>" + Hallo + "</B>"
if (minutes < 10) { minutes="0"+minutes; }
if (seconds < 10) { seconds="0"+seconds; }
CurrTm=hours + ":" + minutes + ":" + seconds;
if (SysYear < 2000) SysYear=SysYear+1900;
if (SysDay < 10) { SysDay="0"+SysDay; }
CurrDt=SysDay+" "+tbm[now.getMonth()]+" "+SysYear;
if (document.all) {
   document.all["orario"].innerHTML=CurrTm+"<br>"+CurrDt; 
} else if (document.layers) {
	 document.orario.document.write(CurrTm+"<br>"+CurrDt);document.close();
	} else if (document.getElementById) {
     document.getElementById("orario").innerHTML=CurrTm+"<br>"+CurrDt;
  }
if (ctr==15 && document.all) {
	document.all["saluti"].innerHTML=Hallo;
} else if (ctr==15 && document.layers) {
   	document.saluti.document.write(Hallo); document.close();
	} else if (ctr==15 && document.getElementById) {
			document.getElementById("saluti").innerHTML=Hallo;
 	}
}
var good;
var url = "www.ilcottobello.altervista.org";
function checkEmailAddress(field) {
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,3}))$)\b/gi);
if (goodEmail){ good = true;} else { good = false; }
}
//u = window.location.href;// u = url;
StdMsg = "Ti segnalo questo interessante sito!";
function mailThisUrl(){
good = false;
checkEmailAddress(document.eMailer.address);
if (good){ window.location = "mailto:"+document.eMailer.address.value+"?subject="+StdMsg+"&body="+document.title+" "+url;
} else { alert('Inserire un indirizzo e-mail valido.'); document.eMailer.address.focus(); }
}
var StreMail = '';
var StrMail = '';
function SiteMail(){
var EmailSite ='yahoo.it@CottoBello';
var ChrPrima = '';
var ChrDopo = '';
var Start = 0;
var SimbolMail = EmailSite.indexOf ('@');
for (Ctr = 1; Ctr <= SimbolMail; Ctr ++){
ChrPrima += EmailSite.substring (Start, Ctr);
Start++;}
Start = SimbolMail; Start ++; SimbolMail +=2;
for (Ctr = SimbolMail; Ctr <=EmailSite.length; Ctr++){
ChrDopo +=EmailSite.substring (Start, Ctr);
Start++;}
StreMail = ChrDopo+'@'+ChrPrima;
}
function WrtMailTo(String){SiteMail(); parent.location = 'mailto:'+StreMail;}
