/*  (C) 2005-2007 Pescetelli Impianti Snc - All rights reserved  */

function today () {
	var now = new Date();
	var year = now.getYear();
	var month = now.getMonth() + 1;
	var day = now.getDate();
	var hour = now.getHours();
	var minute = now.getMinutes();
	var second = now.getSeconds()
	var output = (year < 1900) ? (year + 1900) + "/" : year + "/";
	output += (month < 10) ? "0" + month + "/" : month + "/";
	output += (day < 10) ? "0" + day + " " : day + " ";
	output += (hour < 10) ? "0" + hour + ":" : hour + ":";
	output += (minute < 10) ? "0" + minute + ":" : minute + ":";
	output += (second < 10) ? "0" + second : second;
	return output;
}

function reference () {
	var now = new Date();
	var year = now.getYear(); 
	var month = now.getMonth() + 1;
	var day = now.getDate();
	var hour = now.getHours();
	var minute = now.getMinutes();
	var second = now.getSeconds()
	year = (year > 1900) ? year - 2000 : year;
	year = (year > 99) ? year - 100 : year;
	var output = (year <10) ? "0" + year : year;
	output += (month < 10) ? "0" + month : month;
	output += (day < 10) ? "0" + day  : day;
	output += (hour < 10) ? "0" + hour : hour;
	output += (minute < 10) ? "0" + minute : minute;
	output += (second < 10) ? "0" + second : second;
	return output;
}

function pageinfo () {
	document.getElementById ('pageinfo').style.display='block';
	document.getElementById ('pageinfo').style.visibility='visible';
	return false;
}

function mailto () {
	var email = 'info' + unescape ('%40') + 'pescetelliimpianti' + unescape ('%2E') + 'it';
	var mailbox = "info";
	var domain = "pescetelliimpianti.it";
	var subject = "Richiesta informazioni " + reference ();
	var at = unescape ('%40');
	document.write ('<A HREF=\"mailto:' + email + '?subject=' + subject + '\">'); 
	document.write (email + '</A>');
}

function randomnumber (start, total) {
	return Math.round (Math.random() * (total - 1) + start);
}

window.onload = function () {
//	window.location='http://www.pescetelliimpianti.it/';
}
