function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("images/home-over.gif");
		participants_over = newImage("images/participants-over.gif");
		strategies_over = newImage("images/strategies-over.gif");
		resources_over = newImage("images/resources-over.gif");
		events_over = newImage("images/resources-over.gif");
		summer_over = newImage("images/summer-over.gif");
		ods_over = newImage("images/ods-over.gif");
		preloadFlag = true;
	}
}

function createPage(arg) {
	var headerHTML = "";
headerHTML += '		<table width="96%" border="0" cellpadding="8" cellspacing="0" align="center">';
headerHTML += '		<tr>';
headerHTML += '';
headerHTML += '<!--Page Header Cell--> ';
headerHTML += '	      <td width="125" class="redback" valign="middle" align="center"> ';
headerHTML += '	  		<a href="http://www.stcc.edu" target="_blank"><img src="images/stcc_home.gif" width="110" height="68" alt="STCC Homepage" border="0"></a>';
headerHTML += '	      </td>';
  	
headerHTML += '  		  <td valign="center" class="redback" align="center"> ';
headerHTML += '	        <a href="index.htm"><img src="images/udl_title.gif" width="515" height="60" alt="Universal Design for Learning @ STCC" border="0"></a>';
headerHTML += '    	  </td>';
headerHTML += '		</tr>';
headerHTML += '';
headerHTML += '	    <tr>';

headerHTML += '<!--Main Navigation Cell-->';
headerHTML += '<!-- To use the template for a particular button (i.e. and Events web page)';
headerHTML += '     you must change the <a href> of that link to REMOVE the ';
headerHTML += '     onmouseover and onmouseout events by commenting them out. --> ';
headerHTML += '<!-- Then, change the <img src=""> code to the ...-over.gif image name  -->';
headerHTML += '    	  <td valign="top"  class="blackback" align="center">';
headerHTML += '      		<p>&nbsp;</p>';


headerHTML += createNavbar1(arg);
headerHTML += '<p><img src="images/approved_508.gif" width="88" height="31" border="0" alt="Bobby Approved 508" ></p>';
headerHTML += '';
headerHTML += '      </td><!--End Navigation Cell-->';
headerHTML += '';
headerHTML += '<!--Main Page Content Cell-->';
headerHTML += '	<td class="beigeback">';
headerHTML += CONTENTS.innerHTML;
headerHTML += '<span id=SPANfooter> </span>';

SPANheader.innerHTML = headerHTML;
CONTENTS.innerHTML = '';
}

function createNavbar1(pageName)	{

//'<!-- To use the template for a particular button (i.e. and Events web page)';
//'     you must change the <a href> of that link to REMOVE the ';
//'     onmouseover and onmouseout events by commenting them out. --> ';
//'<!-- Then, change the <img src=""> code to the ...-over.gif image name  -->';

aNames = new Array( "index",
					"../index",
					"participants",
					"resources",
					"strategies",
					"events",
					"links",
					"summer",
					"success");

aAlts = new Array(  "Universal Design for Learning Project Home",
					"STCC Office of Disability Services Home", 
					"UDL Project Participants", 
					"Project Resources", 
					"Universal Design Strategies", 
					"Project Events",
					"Links to Universal Design Information",
					"UDL Annual Summer Institute",
					"Student Success Stories");

toReturn = new String("");
holdName = new String("");

aLinks = new Array( "index",
					"http://depts.stcc.edu/ods/index",
					"participants",
					"resources",
					"strategies",
					"events",
					"links",
					"summer",
					"success");

for (i=0; i < aNames.length; i++)	{
	buttonHTML = new String("");
	holdName = aNames[i];
	if (aNames[i] == "../index"){holdName = "ods";}

	if (aNames[i] == pageName)	{
// IF IS ODS HOMEPAGE, NEED TO REDO THE BUTTON NAMES: ODS.GIF & ODS-OVER.GIF 

		buttonHTML = '      <p><a href="' + aLinks[i] + '.htm">';
		buttonHTML += '	<img name="' + holdName + '" src="images/' + holdName + '-over.gif" width=125 height=29 border=0 alt="' + aAlts[i] + '"></a></p>';
		}  // END IF

	else	{	
		buttonHTML = '      <p><a href="' + aLinks[i] + '.htm"';
		buttonHTML += '	onmouseover="changeImages(\'' + holdName + '\', \'images/' + holdName + '-over.gif\'); return true;"';
		buttonHTML += '	 onmouseout="changeImages(\'' + holdName + '\', \'images/' + holdName + '.gif\'); return true;">';
		buttonHTML += '	<img name="' + holdName + '" src="images/' + holdName + '.gif" width=125 height=29 border=0 alt="' + aAlts[i] + '"></a></p>';
} // END ELSE		

	toReturn += buttonHTML;
	} // END FOR LOOP

return toReturn;
} // END FUNCTION