


	/* these tools are loaded in every content page */
	
	var PageTools =  {
		onload			: PAGOnload,
		print			: PAGPrint,
		xsdate			: PAGXsdate,
		validate 		: PAGValidate
		
	}
	function PAGOnload() {
		var adate = document.getElementById('annotationdate');
		if (adate) adate.value = this.xsdate(new Date());
		if (self==top) {
			var btag = document.getElementsByTagName("body")[0];
			if (btag) btag.className="noframes";
		}
	}
	function PAGPrint() {
		if (self.print) self.print();
	}
	
	function PAGXsdate(now) {
		var YYYY 	= now.getFullYear();
		var MM 		= now.getMonth()+1;
		var DD		= now.getDate();
		var HH 		= now.getHours();
		var II 		= now.getMinutes();
		var SS 		= now.getSeconds();
		
		if (MM<10) MM = "0"+MM;
		if (DD<10) DD = "0"+DD;
		if (HH<10) HH = "0"+HH;
		if (II<10) II = "0"+II;
		if (SS<10) SS = "0"+SS;
		
		return (YYYY+"-"+MM+"-"+DD+"T"+HH+":"+II+":"+SS);
	}
	
	
	function PAGValidate(theform) {
	
		if (theform.name=="annotations") {
			if (!theform.user.value) {
				alert("A (nick)name is required. \nBut you can use any name.");
				return false;
			}
			if (theform.comment.value.length<16) {
				alert("Sorry, comments of less than 16 characters are \nnot accepted.");
				return false;
			}
		}
		return true;
		
	}
	
	




