//adpolicy.js
function adpolicy() {
	text = '<html>';
	text += '<head>';
	text += '<title>Advertising Policy</title>';
	text += '<link rel="stylesheet" type="text/css" href="http://www.acahf.org.au/acahf.css">';
	text += '</head>';
	text += '<body>';
	text += '<p>\&nbsp\;</p>';
	text += 'The advertisements appearing on this site are produced by Google\'s AdSense system and any ';
	text += 'payment for allowing them to be displayed is used by ';
	text += 'the Australian Council Against Health Fraud ';
	text += 'to assist in the fight against quackery. ACAHF has no control over the ';
	text += 'content of the advertisements, which are generated by Google based on words appearing in the ';
	text += 'surrounding page. This can produce the anomalous situation of advertisements which contradict ';
	text += 'the sentiments expressed on the site. If you see an example of this, please ';
	text += '<a href=\"mailto:peter\@acahf.org.au\">email ACAHF</a> ';
	text += 'with the details.';
	text += '<p align="center"><input type="button" value="Close Window" onclick="window.close()"></p>';
	text += '</form>';
	text += '</body>';
	text += '</html>';

	var winl = (screen.width - 400) / 2;
	var wint = (screen.height - 300) / 2;

	newWindow = window.open('','newWin','width=400,height=300,top='+wint+',left='+winl);
	newWindow.document.write(text);
}

//daysto.js
function daysto(thedate) {
	var now = new Date();
	var then= new Date(thedate);
	var days = (then - now) / 1000 / 60 / 60 / 24;
	var daysRound = Math.floor(days) + 1;
	if (daysRound > 2) {
		document.write("in " + daysRound + " days");
	} else {
		if (daysRound == 1) {
			document.write(" in one day");
		} else {
			if (daysRound == 0) {
				document.write("today");
			}
		}
	}
}

//dayssince.js
function dayssince(thedate) {
	var now = new Date();
	var then= new Date(thedate);
	var days = (now - then) / 1000 / 60 / 60 / 24;
	var daysRound = Math.floor(days) + 1;
	document.write(daysRound);
}

//newwindow.js
function NewWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//quickbook.js
function quickbook(asin,title) {
	document.open();
	document.write("<a target=\"_blank\" href=\"http://www.amazon.com/gp/product/" + asin);
	document.write("?ie=UTF8&tag=gebessecomputerc&linkCode=as2&camp=1789&creative=9325&creativeASIN=" + asin + "\">");
	document.write(title);
	document.write("</a><img src=\"http://www.assoc-amazon.com/e/ir?t=gebessecomputerc&l=as2&o=1&a=" + asin);
	document.write("\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\" /> ");
	document.close();
}

//quickbookpic.js
function quickbookpic(asin,title,image,width,height,align) {
	if (align == 'r') {
		alignit=' align=right';
	} else {
		if (align == 'l') {
			alignit=' align=left'
		} else {
			alignit = '';
		}
	}
	document.open();
	document.write("<a target=\"_blank\" href=\"http://www.amazon.com/gp/product/" + asin);
	document.write("?ie=UTF8&tag=gebessecomputerc&linkCode=as2&camp=1789&creative=9325&creativeASIN=" + asin + "\">");
	document.write('<img src=\"' + image + '\" alt=\"' + title + '\"' + alignit + ' width=' + width + ' height=' + height + ' border=0>');
//document.write(title);
	document.write("</a><img src=\"http://www.assoc-amazon.com/e/ir?t=gebessecomputerc&l=as2&o=1&a=" + asin);
	document.write("\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\" />");
	document.close();
}

//toacahf.js
function writeto(name,text) {
	if (name == '') { name = 'info1'; }
	domain = 'acahf.org.au';
	document.write('<a href=\"mailto:' + name + '@' + domain + '\">');
	if (text == '') {
		document.write(name + '@' + domain + '</a>');
	} else {
		document.write(text + '</a>');
	}
}

//cryear.js
function cryear() {
	today=new Date();
	y0=today.getFullYear();
	document.write(y0);
}

