function windowOnload()
{
	document.cbe.addEventListener("mousemove", menuHideListener, false);
}
function xPaste(source, target)
{
	alert("xPaste")
	document.getElementById(target).innerHTML = document.getElementById(source).innerHTML
}
function EmailPage(event_id)
{
	var emailWindow = window.open(CGIpath +'/email.cgi?id=' + event_id +'&action=friend', '', 'dependent=1,resizable,width=500,height=600,scrollbars,menubar=0')
}

function PrintPage()
{
	/* Which elements are we going to show? */
	var ids = new Array(
		"body",
		"sponsorLogos",
		"customContent",
		"eventLogo",
		"eventName",
		"banners"
	)
	
	/* Gather the contents of those elements. */
	var data = new Array()
	for ( var i in ids )
	{
		/* Private labels can omit parts of the page, so
		 * it is important to use "try/catch".
		 */
		try
		{
			data[ids[i]] = document.getElementById(ids[i]).innerHTML
			// eg, contents['body'] = "blah blah blah"
		}
		catch (e) 
		{
			data[ids[i]] = "&nbsp;"
		}
	}

	/* Add some default stylesheets.
	 * (These are functions in cem.js.)
	 */	
	AddStyleSheet(HTMLpath+"/css/pc.css");
	AddStyleSheet(HTMLpath+"/css/public.css");
	
	/* Assemble and show the printable page. */
	var printableWindow = window.open('', '','dependent=1,resizable,width=650,height=600,scrollbars,menubar=0')
	var page = 
		"<html><head>"
		+ PrintStyleSheets()
		+"</head><body>"
		+"<div style='width:100%; text-align:right;'>"
		+ PrintIcon() +"&nbsp; | &nbsp;"+ CloseWindowIcon()
		+"</div>"
		+"<!-- BANNERS -->"
		+"<div style='text-align:left; margin-bottom:5px;'>"
		+"<div class='sponsorHeading'>"
		+"Our main event sponsors:"
		+"</div>"
		+ data['banners']
		+"</div>"
		+"<!-- MAIN TABLE  -->"
		+"<table id='public_main_table' class='public_layout'>"
		+"<!-- HEADING -->"
		+"<tr><td>"
		+"<table class='public_layout' style='border-bottom:1px solid slateGray;'><tr>"
		+"<td>"+ data['eventLogo'] +"</td>"
		+"<td style='vertical-align:middle;'>"
		+"<h1>"+ data['eventName'] +"</h1>"
		+"</td>"
		+"</tr></table>"
		+"<!-- CENTRAL -->"
		+"<tr><td>"
		+ data['body']
		+ data['customContent']
		+"</td></tr>"
		+"<!-- BOTTOM -->"
		+"<tr><td>"
		+"<table class='public_layout' id='public_bottom_table'>"
		+"<tr>"
		+"<td><div class='sponsorHeading'>Our Sponsors</div></td>"
		+"</tr><tr>"
		+"<td>" + data['sponsorLogos'] +"</td>"
		+"</tr></table>"
		+"</td></tr></table></body></html>"
		
	printableWindow.document.write(page)
	printableWindow.document.close()
	printableWindow.print()
}
	
function LoginForm(show_id, hide_id)
{
	var show = document.getElementById(show_id);
	var hide = document.getElementById(hide_id);
	ShowObject(show)
	HideObject(hide)
}

/* 4618
 * Changes the background of the given object 
 * to the image at the given URL.  Useful for
 * link rollovers. See Public::View::Function() and
 * Public::Wrapper::Show() for an example.
 */
function ChangeBackground(obj, url)
{
	if (! url ) return true
	//var obj = document.getElementById(id)
	//alert(obj)
	if ( obj.style )
	{
		obj.style.backgroundImage = "url("+url+")"
	}
}

