// JavaScript Document
function global__bioOnclick() {
	var w = window.open(this.href,"_blank","resizable=yes,scrollbars=yes,width=500,height=300");
	if (w.focus) w.focus();
	return false;
}

function global__windowOnload() {
	// add popup links
	for (var l=0; l < document.links.length; l++) {
		if (document.links[l].className == "bio") {
			document.links[l].onclick = global__bioOnclick;
		}
	}
//	alert("Loaded!");
}
Event.observe(window, 'load', global__windowOnload);

function insertAudioPlayer(audioFile) {
	// if audio file is not root relative make it so
	if (!audioFile.startsWith("/")) {
		audioFile = document.location.pathname.substring(0,document.location.pathname.lastIndexOf("/")) + "/" + audioFile;
	}

	var w = 740;
	var h = 20;

	var so = new SWFObject('/common/media/mediaplayer/mediaplayer.swf','mpl',w,h,'8','#000000');
	so.addParam('allowscriptaccess','always');
	so.addParam('allowfullscreen','true');
	so.addVariable('width',740);
	so.addVariable('height',h);
	so.addVariable('file',audioFile);
	so.addVariable('backcolor','0x333333');
	so.addVariable('frontcolor','0xAAAAAA');
	so.addVariable('lightcolor','0xDDDDDD');
	so.addVariable('screencolor','0x000000');
	so.addVariable('showstop','true');
	so.write('player');
}

function insertImageRotator(imagePlayList,delay) {
	// if image play list is not root relative make it so
	if (!imagePlayList.startsWith("/")) {
		imagePlayList = document.location.pathname.substring(0,document.location.pathname.lastIndexOf("/")) + "/" + imagePlayList;
	}

	var w = 280;
	var h = 400;

	var so = new SWFObject('/common/media/imagerotator/imagerotator.swf','mpl',w,h,'8','#000000');
	so.addParam('allowscriptaccess','always');
	so.addParam('allowfullscreen','true');
	so.addVariable('width',w);
	so.addVariable('height',h);
	so.addVariable('file',imagePlayList);
	so.addVariable('rotatetime',delay); // number of seconds to display each image
 	so.addVariable('frontcolor','0xFFFFFF');
	so.addVariable('lightcolor','0xFFFFFF');
	so.addVariable('screencolor','0x000000');
	so.addVariable('overstretch','none'); // true, false, fit, none
	so.write('rotator');
}

/*******************************************************************/
function its_popupWindow(url,target,width,height,opts)
/*
	Returns: (nothing)

	Required parameters:
	·	url: address of page to load in popup window, usually: this.href
	·	target: the name to give to the new window (for reusing windows)

	Optional parameters:
	·	width: (integer) only used if height is also specified
	·	height: (integer)
	·	opts: (string) specify which elements to display in the window:
			l - location (or address) bar
			m - menu bar (useful for access to the file menu for printing)
			r - resizable (usually this should be specified)
			s - scroll bars (usually this should be specified)
			t - tool bar (back, forward, reload, stop, etc)
			x - status bar

			e.g. 'mrs' means display menu bar, allow window to be resized
			and display scrollbars if content is too big for window
********************************************************************/
{
	var p = null;
	if (width == null || height == null) {
		p = null
	}
	else if (opts == null) {
		p = "width="+width+",height="+height
	}
	else
	{
		p = "width="+width+",height="+height

		opts = opts.toString().toLowerCase();

		if (opts.indexOf("l") >= 0) p += ",location=1"
		if (opts.indexOf("m") >= 0) p += ",menubar=1"
		if (opts.indexOf("r") >= 0) p += ",resizable=1"
		if (opts.indexOf("s") >= 0) p += ",scrollbars=1"
		if (opts.indexOf("t") >= 0) p += ",toolbar=1"
		if (opts.indexOf("x") >= 0) p += ",statusbar=1"
	}

	var x = window.open(url,target,p)
	if (x.focus) x.focus();
}//function its_popupWindow
/*******************************************************************/

