/*

This code loops to write the navigation file.

The main function of the script is to dynamically write either a <div> or <layer> as well as all the containing information.
In general, all the attributes for the tags are controled through the variables.js script.
The only attribute not accessible is the border attribute. However, it is unlikely that the border would be set to anything other than 0.

The script automatically loops until it exceeds the length of the navHref array (again in the variables.js script), so any additions or subtractions to the code will likely not mean touching this script.

*/

for (x = 0; x < navHref.length; x++) {

	document.write ('<' + layerTag + ' id="nav' + (x + 1) +'" ' + style + ' left' + tagSep + navxPos[x] + pixels + attributeSep + ' top' + tagSep + navyPos + pixels + attributeSep + ' height' + tagSep + navimgHeight + pixels + attributeSep + ' width' + tagSep + navimgWidth[x] + pixels + attributeSep +  ' z-index ' + tagSep + zIndex[0] + tagFinish + '>');
	
	// opens <a> tag and sets mouseover and mouseout states
	
	if (navHref[x] != fileName) {
		document.write ('<a href="' + navHref[x] + hrefExt + '" onmouseover="changeImages(\'' + navimgName[x] + '\', \'' + imgDir + navimgSrc[x] + '_over.gif\'); return true;" ');
		document.write ('onmouseout="changeImages(\'' + navimgName[x] + '\', \'' + imgDir + navimgSrc[x] + '.gif\'); return true;">');
	}

	// sets "over" variable for page focus

	if (navHref[x] == fileName) {
		over = "_over"
	} else {
		over = "";
	}

	// image source and attributes

	document.write ('<img src="' + imgDir + navimgSrc[x] + over + '.gif" name="' + navimgName[x] + '" alt="' + navimgAlt[x] + '" width="' + navimgWidth[x] + '" height="' + navimgHeight + '" border="0">');

	// closes <a> tag

	if (navHref[x] != fileName) {
		document.write ('</a>');
	}
		
	document.write ('</' + layerTag + '>');
}
