//
//DateTime
//
weekdays=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
function DateTime() {
today=new Date();
thisyear=today.getFullYear();
thismonth=today.getMonth()+1;if (thismonth<10) {thismonth="0"+thismonth;}
thisday=today.getDate();if (thisday<10) {thisday="0"+thisday;}
thisdayname=today.getDay();
thishour=today.getHours();if (thishour<10) {thishour="0"+thishour;}
thisminute=today.getMinutes();if (thisminute<10) {thisminute="0"+thisminute;}
thissecond=today.getSeconds();if (thissecond<10) {thissecond="0"+thissecond;}
document.getElementById("DateTime").innerHTML=thisday+"-"+thismonth+"-"+thisyear+" "+weekdays[thisdayname]+" "+thishour+":"+thisminute+":"+thissecond;
setTimeout("DateTime()",1000);
}
//
//Banner1
//
word1=new Number;if (isNaN(word1)) {word1=0;}
words1=new Array("English-Italian","Italian-English","English-Spanish","Spanish-English","Translations");
function translations() {
document.getElementById("Translations").innerHTML=words1[word1];
if (word1<words1.length-1) {word1++;}
else {word1=0;}
document.getElementById("Translations").className="button"+Math.round(Math.random()*3);
setTimeout("translations()",1000);
}
//
//SearchSelect
//
function SearchSelect(Search1,Search2,Search3,Search4) {
document.SearchWeb.action=Search1;
document.SearchWeb.SearchHidden.name=Search2;
document.SearchWeb.SearchHidden.value=Search3;
document.SearchWeb.SearchInput.name=Search4;
}
//
//ValidMail
//
function ValidMail() {
NamePattern=/^([a-z]+)$/i;
if (!NamePattern.test(document.MailForm.YourName.value)) {
window.alert("ENTER YOUR NAME\nAccepted characters:\nLetters: A to Z or a to z");
document.MailForm.YourName.focus();
return;
}
EmailPattern=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (!EmailPattern.test(document.MailForm.YourEmail.value)) {
window.alert("ENTER A VALID EMAIL");
document.MailForm.YourEmail.focus();
return;
}
PhonePattern=/^([0-9|\s]*)$/;
if (!PhonePattern.test(document.MailForm.YourPhone.value)) {
window.alert("ENTER A VALID PHONE NUMBER\nAccepted characters:\nNumbers: 0 to 9");
document.MailForm.YourPhone.focus();
return;
}
if (document.MailForm.Message.value.length==0) {
window.alert("ENTER MESSAGE TEXT");
document.MailForm.Message.value="";document.MailForm.Message.focus();
return;
}
if (document.MailForm.Subject.value.length==0 && document.MailForm.Message.value.length>0) {
document.MailForm.Subject.value=document.MailForm.Message.value.substring(0,50);
window.alert("CLICK \"SEND\" AGAIN TO CONFIRM");
return;
}
SubjectPattern=/^([\w|\-|\:|\s]*)$/i;
if (!SubjectPattern.test(document.MailForm.Subject.value)) {
window.alert("ENTER A VALID SUBJECT\nAccepted characters:\nLetters: A to Z or a to z\nNumbers: 0 to 9\nDash: -\nColon");
document.MailForm.Subject.focus();
return;
}
else {
document.MailForm.submit();
}}