<!--
/**************************************************************
 *	Name:			nrso.js
 *	Date:			29 July 2002
 *	Author:			Daniel Toomey
 *
 *	Description:	Common javascript for NRSO web
 *
 **************************************************************
 *	MODIFICATION HISTORY
 **************************************************************
 *	DATE			CHANGES
 *-------------------------------------------------------------
 * 24/10/2002		Added writeEmail function
 * 30/01/2004		Added openWindow function
 *************************************************************/

cssRollCapable = (allobject || layerobject || dom) ? 1 : 0;
gCurrentYear = '-2005';

/* clipRegion object constructor */
function clipRegion(left,top,right,bottom)
{
	this.left = left;
	this.top = top;
	this.right = right;
	this.bottom = bottom;
}

if (cssRollCapable)
{
	/* create clipping regions */
	var cliparray = new Array();

/* Clip array with lines (shorter)*/
	cliparray[0] = new clipRegion(0,3,129,30);
	cliparray[1] = new clipRegion(0,34,129,64);
	cliparray[2] = new clipRegion(0,67,129,95);
	cliparray[3] = new clipRegion(0,100,129,128);
	cliparray[4] = new clipRegion(0,133,129,161);
	cliparray[5] = new clipRegion(0,164,129,192);
	cliparray[6] = new clipRegion(0,196,129,225);
	cliparray[7] = new clipRegion(0,230,129,257);
	cliparray[8] = new clipRegion(0,262,129,289);

}

function rollover(region,turnon,obj)
{
	/* bailout if not possible for level 2 rollovers */
	if ((!cssRollCapable) || (opera))
		return;

	if (!obj){ //{ obj == "menuon"; }

		if (turnon)
		{
			setClip("menuon", cliparray[region].top,
			cliparray[region].right, cliparray[region].bottom,
			cliparray[region].left)
			show("menuon");
		}
		else
			hide("menuon");

	}
	else {
		if (turnon)
		{
			setClip(obj, cliparray[region].top,
			cliparray[region].right, cliparray[region].bottom,
			cliparray[region].left)
			show(obj);
		}
		else
			hide(obj);

	}


}

function writeEmail(mailbox, display)
{
	if (display == "explicit")
		display = mailbox + "@nrso.com";

	/* write e-mail address as a broken string to foil spammers */
	document.write("<a href='mailto:" + mailbox +
			"@nrso.com'>" + display + "</a>");

}

function initialise(region) {

	if (cssRollCapable)
	{
		// Set the current page TOC button (0 - 8)
		setClip("menuactive", cliparray[region].top,
			cliparray[region].right, cliparray[region].bottom,
			cliparray[region].left);
		show("menuactive");
	}
}

function openWindow(url)
{
	var wWidth = 640;
	var wHeight = 480;
	var myWin = window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,'
				+ 'menubar=0,scrollbars=1,resizable=1,' + 
				'width=' + wWidth + ',height=' + wHeight + ',top=20,left=20');

}

//-->
