<!--
// ========================================= Setup global constants and variables ========================================
// Setup browser version check
var bIS_NETSCAPE = (navigator.appName == "Netscape") ? true : false;
var bIS_IE		 = (navigator.appName == "Microsoft Internet Explorer") ? true : false;

var bWINDOWOPEN = false;				// Global flag to alert if image viewing popup is open
var oWindow = new Object();				// Create a globally accessible window object reference
// =======================================================================================================================



// ================================================== DHTML ==============================================================
// Function to attach events to dynamically created elements
// obj		is the object to attach event to
// strEvent	is the event without the prefix "on"
// fn		is the event-handler function
function attachEvent(obj, strEvent, fn)
{
    if(obj.addEventListener)
    {
        obj.addEventListener(strEvent,fn,false);
    }
    else if(obj.attachEvent)
    {
        obj.attachEvent("on"+strEvent,fn);
    }
}

// Function to remove all child nodes of an object
function removeChildren(oObject)
{
	for (var count = oObject.childNodes.length - 1; count != -1; --count)
	{
		if (oObject.childNodes[count].childNodes.length != 0)
		{
			removeChildren(oObject.childNodes[count]);
		}
		oObject.removeChild(oObject.childNodes[count]);
	}
}

// Function to dynamically create a table
function createTable(iCellspacing, iCellpadding, sWidth, iBorder, sClass, sAlign, sBgColor)
{
	var oTable = document.createElement("table");
	oTable.cellSpacing = iCellspacing?iCellspacing:0;
	oTable.cellPadding = iCellpadding?iCellpadding:0;
	oTable.width = sWidth?sWidth:"100%";
	oTable.border = iBorder?iBorder:0;
	oTable.className = sClass?sClass:"";
	oTable.align = sAlign?sAlign:"";
	oTable.bgColor = sBgColor?sBgColor:"";
	return oTable;
}

// Function to dynamically create a table cell
function createCell(sAlign, sVAlign, sWidth, sClass, sBgColor)
{
	var oCell = document.createElement("td");
	oCell.align = sAlign?sAlign:"left";
	oCell.vAlign = sVAlign?sVAlign:"top";
	oCell.width = sWidth?sWidth:"";
	oCell.className = sClass?sClass:"";
	oCell.bgColor = sBgColor?sBgColor:"";
	return oCell;
}
// =======================================================================================================================



// ======================================= Function for popup windows - for images =======================================
// THE createWindow FUNCTION REPLACES THIS ONE.  DELETE THIS FUNCTION AFTER WEBSITE HAS BEEN COMPLETELY REVAMPED.
// This function opens a new window to display images
// strURL		is the URL of the webpage to load within the pop-up
// iWidth		is the width of the window
// iHeight		is the height of the window
function openwinsize(strURL, iWidth, iHeight)
{
	window.open(strURL,"image","toolbar=no,resize=yes,scrollbars=yes,location=no,directories=no,status=no,menubar=no,width=" + iWidth + ",height=" + iHeight);
}
// =======================================================================================================================



// =================================== New Function for popup windows - for images =======================================
// This function opens a new window to display images
// iWidth				is the width of the window
// iHeight				is the height of the window
// strWindowTitle		is the title of the Window to be appended to school name
// strTitle				is the title to display in window
// strImageURL			is the URL of the image to load.
// imgWidth             is the width of the image
// imgHeight            is the height of the image
function createWindow(iWidth, iHeight, strWindowTitle, strTitle, strImageURL, imgWidth, imgHeight)
{
	// First check if popup is previously open...
	if (bWINDOWOPEN)
	{
		// Popup window is already open
		if (oWindow)
		{
			// Close window
			oWindow.close();
		}

		// Reset flag
		bWINDOWOPEN = false;
	}

	oWindow = window.open("","image","channelmode=no,directories=no,fullscreen=no,toolbar=no,scrollbars=no,location=no,status=no,menubar=no,top=0,left=0,width=" + iWidth + ",height=" + iHeight);

	// Begin building window content
	var strDocument = "<html>";
	strDocument += "<head>";
	strDocument += "<title>" + strWindowTitle + "</title>";
	strDocument += "</head><body>";
	strDocument += "<div align='center'><table cellpadding='0' cellspacing='0' border='0'><tr>";
	strDocument += "<td align='center' valign='bottom'><table width='100%' cellpadding='2' cellspacing='1' border='0' bgcolor='#cccccc' style='margin-bottom:10px;'><tr>";
	strDocument += "<td align='left' valign='bottom' bgcolor='#ffffff' style='padding-left:5px; color:#336699; font-family:Arial; font-size:12;'><b>" + strTitle + "</b></td>";
	strDocument += "<td align='right' valign='bottom' bgcolor='#ffffff' style='padding-right:5px; color:#336699; font-family:Arial; font-size:12;'><nobr><a href='javascript: window.close();'> <b>Close</b> <img src='images/elements/10x10_X.gif' width='10' height='10' border='0' alt=''></a></nobr></td>";
	strDocument += "</tr></table></td>";
	strDocument += "</tr><tr>";
	strDocument += "<td align='center' valign='top'><img src='" + strImageURL + "' width = '" + imgWidth + "' height='" + imgHeight + "'" + "' alt='" + strWindowTitle + "' border='0' style='border-style:solid;border-width:1px;border-color:#ffffff'></td>";
	strDocument += "</tr></table></div>";
	strDocument += "</body></html>";

	// Write content in window
	oWindow.document.write(strDocument);

	// Activate window flag
	bWINDOWOPEN = true;
}
// =======================================================================================================================
//-->