if (servUTC.indexOf("?php") != -1) { servUTC = 'Unknown';}

Diff = 0;Diffm = 0;Timerr ="Unknown";
if (servUTC.indexOf(":") != -1) {
// REPLACE gmt with GMT
	servUTC = servUTC.replace(/-/g, " ") ;
	if ((servUTC.indexOf("GM") == -1) && (servUTC.indexOf("UT") == -1) && (servUTC.indexOf("gm") == -1) && (servUTC.indexOf("ut") == -1)) {
	 servUTC = servUTC + " GMT" ; }
	now = new Date();
//for old browser like nestscape 4
	if (document.layers) {now = now.toString() ;now = now.substr(0,20) + now.substr(-4,4);}
	Diff = (Date.parse(now)-Date.parse(servUTC))/1000;
	if (isNaN(Diff)) { Timerr ="Unknown";} else { Diffm = Math.floor(Diff/60); Diff = Diff - (Diffm * 60); Timerr = Diffm + " min, " + Diff + " seconds."}
} 


function bookmark() {
if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) {
window.external.AddFavorite("http://alpha2player.com/contact.php","ALPHA 2 Player / Contact")
}
}

var submitcount=0;

function check() {
if (submitcount != 0) {
alert("A message is already being sent !\nPlease wait for our confirmation.");
return (false);
}

var tstMess = document.mailform.Message.value.replace(anyWhiteSpace,"");
if ((tstMess == "") || (tstMess == "Yourmessagegoeshere...")) {
alert("You did not write anything yet...  :)");
return (false);
}

var tstMail = document.mailform.Email.value.replace(anyWhiteSpace,"");
var tstCtry = document.mailform.Country.value.replace(anyWhiteSpace,"");
if ((tstMail == "") || (tstCtry == "") || (tstMail == "Email") || (tstCtry == "Country")) {
alert("Please, fill in your Email AND Country.");
return (false);
}

if (/\d|\W/g.test(tstCtry) || tstCtry.length < 2) { 
alert("Your Country does not seems to exist yet");
return (false);
}

if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.mailform.Email.value))) {
alert("Your email adress does not seems to be correct");
return (false);
}

if ((tstMail.indexOf("hotmail") != -1) || (tstMail.indexOf("yahoo") != -1) || (tstMail.indexOf("gmail") != -1) || (tstMail.indexOf("mail.") != -1) || (tstMail.indexOf("@email.") != -1)) {
alert("Your email adress is not answerable");
return (false);
}

usernam = document.mailform.Name.value; if ((usernam == "Your Name")) usernam = "! NONAME !";	
txt = (usernam + " from " + document.mailform.Country.value + ",\n(" + document.mailform.Email.value + ")" + "\n\n Send this Message ?");

if (confirm(txt)) {
document.mailform.Sender.value = "   Sending...   " ;
if (document.getElementById) {
document.mailform.Sender.style.backgroundColor = "#ff0000"  ;
document.mailform.Sender.style.borderColor = "#ffFF00"  ;
}
submitcount++;
return (true);
}
return (false);
}

function upd() {
	if (document.mailform.Subject.selectedIndex == 6) {
		document.mailform.Subject2.style.visibility = 'visible' ;
		document.mailform.Subject2.focus();
		document.mailform.Subject2.size = '14' ;
		document.mailform.Subject[6].text = "(From user):" ;
	}
	else {
		document.mailform.Subject2.style.visibility = 'hidden' ;
		document.mailform.Subject2.size = '1' ;
		document.mailform.Subject[6].text = "Other" ;
	}
  }

function cleartext()
{
document.mailform.Message.value = "";
document.mailform.Message.focus();
}


function showInfo() {
var dbc="unknown";
if (document.body) {dbc = document.body.clientWidth};
un = "none"; if (HOST.indexOf("?php") != -1) {HOST=un;PROXY=un}
  alert("Host = " + HOST + "\n" + "Proxy = " + PROXY + "\n\n" + "GMT time = " + servUTC + "\n" + "Your time = " + comptime + "\n" + "Time error = " + Timerr + "\n" + "Timezone = " + tzo + "\n\n" + "Browser = " + navigator.appName + "\n" + "UserAgent = " + navigator.userAgent + "\n\n" + "Width = " + dbc + " pixels.")
}


function doInput()
{
document.write(" <INPUT NAME=\"Name\" SIZE=\"15\" TYPE=\"TEXT\" value=\"Your Name\" onblur=\"if(this.value==\'\')this.value=\'Your Name\';\" onfocus=\"if(this.value==\'Your Name\')this.value=\'\';\"> ");
document.write(" <INPUT NAME=\"Country\" SIZE=\"8\" TYPE=\"TEXT\" value=\"Country\" onblur=\"if(this.value==\'\')this.value=\'Country\';\" onfocus=\"if(this.value==\'Country\')this.value=\'\';\"> ");
document.write(" <INPUT NAME=\"Email\" SIZE=\"15\" TYPE=\"TEXT\" value=\"Email\" onblur=\"if(this.value==\'\')this.value=\'Email\';\" onfocus=\"if(this.value==\'Email\')this.value=\'\';\"> ");
document.write(" <INPUT NAME=\"Website\" SIZE=\"8\" TYPE=\"TEXT\" value=\"Website\" onblur=\"if(this.value==\'\')this.value=\'Website\';\" onfocus=\"if(this.value==\'Website\')this.value=\'\';\"> ");
}

function doMessbox()
{
document.write("<TEXTAREA NAME=\"Message\" ROWS=4 CLASS=backmess onblur=\"if(this.value=='')this.value='Your message goes here...';\" onfocus=\"if(this.value=='Your message goes here...')this.value='';\">Your message goes here...</TEXTAREA>");
//<!-- if no javascript, no need to put the button -->
document.write("<INPUT TYPE=\"button\" class=\"button\" value=\"Clear\" onClick=\"cleartext();\"><BR>");

document.mailform.Subject2.style.visibility = 'hidden';
document.mailform.Timezone.value = tzo ;
document.mailform.referrer.value = Dr ;
document.mailform.Browser.value = navigator.appName + " / " + navigator.appVersion;
document.mailform.SenderTime.value = tz ;
document.mailform.Message.cols = '32' ;
document.mailform.Message.rows = '6' ;
if (document.body.clientHeight > 320) {document.mailform.Message.rows = '8'};
document.mailform.Country.size = '15' ;
document.mailform.Website.size = '15' ;

document.write("<INPUT SIZE=28 TYPE=\"file\" Name=\"attachement\" class=\"attach\">")
}