function control() {
	window.location.hash = 'control-failed';
	alert('Control event fired');
}
function test1(e) {
	window.location.hash = 'test-1-passed';
	e.preventDefault();
}
function test2() {
	window.location.hash = 'test-2-passed';
	window.event.returnValue = false;
}
function test3(e) {
	window.location.hash = 'test-3-passed';
	e.returnValue = false;
}
function test4(e) {
	window.location.hash = 'test-4-passed';
	return false;
}
function test5(e) {
	window.location.hash = 'test-5-passed';
	e.preventDefault();
}
function test6() {
	window.location.hash = 'test-6-passed';
	window.event.returnValue = false;
}
function test7(e) {
	window.location.hash = 'test-7-passed';
	e.returnValue = false;
}
function test8(e) {
	window.location.hash = 'test-8-passed';
	return false;
}
function test9(e) {
	window.location.hash = 'test-9-passed';
	e.preventDefault();
}
function test10() {
	window.location.hash = 'test-10-passed';
	window.event.returnValue = false;
}
function test11(e) {
	window.location.hash = 'test-11-passed';
	e.returnValue = false;
}
function test12(e) {
	window.location.hash = 'test-12-passed';
	return false;
}

function startEventTests() {
	document.getElementById('control').onclick=control;
	document.getElementById('test1').onclick=test1;
	document.getElementById('test2').onclick=test2;
	document.getElementById('test3').onclick=test3;
	document.getElementById('test4').onclick=test4;
	if (typeof document.addEventListener == 'function') {
		document.getElementById('control2').addEventListener('click',control,false);
		document.getElementById('test5').addEventListener('click',test5,false);
		document.getElementById('test6').addEventListener('click',test6,false);
		document.getElementById('test7').addEventListener('click',test7,false);
		document.getElementById('test8').addEventListener('click',test8,false);
	}
	if (typeof document.getElementById('control3').attachEvent != 'undefined') {
		document.getElementById('control3').attachEvent('onclick',control);
		document.getElementById('test9').attachEvent('onclick',test9,false);
		document.getElementById('test10').attachEvent('onclick',test10,false);
		document.getElementById('test11').attachEvent('onclick',test11,false);
		document.getElementById('test12').attachEvent('onclick',test12,false);
	}
}
if (YAHOO) { YAHOO.util.Event.addListener(window,'load',startEventTests); }
else {
	if (typeof window.onload == 'function') {
		oldOnload = window.onload;
		window.onload=function() {
			oldOnload();
			startEventTests();
		}
	}
	else { window.onload=startEventTests; }
}