//<!--

// --------------------------------------------------
// >> Dynamic Menu Code - DynaMenu.js
// >> V1.08
// >> 18/03/2003
//
// This script is intellectual property of:
// >> Rezolutions Global Limited
//
// Reproduction by authorised permission only. 
// --------------------------------------------------



	//------------------------------
	// Menu Type 
	// --> CUSTOMIZE: Set the menu type to use.
	// BH = Bordered Horizontal
	// BV = Bordered Vertical
	// H  = Horizontal
	// V  = Vertical
	//------------------------------
	var MENU_TYPE = 'H';


	//------------------------------
	// Button Spacing 
	// --> CUSTOMIZE: Set to zero for H or V Menu Types.
	//------------------------------
	var BUTTON_SPACING = 0;


	//------------------------------
	// Relative Image Path
	// --> CUSTOMIZE: Set to relative image path.
	//------------------------------
	var RELATIVE_IMAGE_PATH = 'images';


	//------------------------------
	// Menu Image File Name Array
	// --> CUSTOMIZE: Configure image files.
	//------------------------------
	var MenuImgArray = new Array();


	if ((MENU_TYPE == 'BH') || (MENU_TYPE == 'BV')) {
	  // Bordered Horiz/Vert Menu Image Array
	  //------------------------------
	  MenuImgArray[0] = 'BtnBordered';
	  MenuImgArray[1] = 'BtnBordered';
	  MenuImgArray[2] = 'BtnBordered';
	  MenuImgArray[3] = 'BtnBordered';
	}

	else if (MENU_TYPE == 'H') {
	  // Horizontal Menu Image Array
  	  //------------------------------
	  MenuImgArray[0] = 'nav-Home1';
	  MenuImgArray[1] = 'nav-Designs1';
	  MenuImgArray[2] = 'nav-Products1';
	  MenuImgArray[3] = 'nav-Contact1';
	}

	else {
	  // Vertical Menu Image Array
	  //------------------------------
	  MenuImgArray[0] = 'VertBtnStart';
	  MenuImgArray[1] = 'VertBtnMid';
	  MenuImgArray[2] = 'VertBtnMid';
	  MenuImgArray[3] = 'VertBtnMid';
	}

	//------------------------------
	// Menu Hyperlink File Array
	// --> CUSTOMIZE: Configure a link for each button (empty string means no link)
	//------------------------------
	var MenuLinkArray = new Array();
	MenuLinkArray[0] = 'index.htm';
	MenuLinkArray[1] = 'OurDesigns.htm';
	MenuLinkArray[2] = 'OurProducts.htm';
	MenuLinkArray[3] = 'ContactUs.htm';


	//------------------------------
	// Menu Alt Text Array
	// --> CUSTOMIZE: Configure alt text for each button
	//------------------------------
	var MenuAltTextArray = new Array();
	MenuAltTextArray[0] = 'Home';
	MenuAltTextArray[1] = 'Our Designs';
	MenuAltTextArray[2] = 'Our Products';
	MenuAltTextArray[3] = 'Contact Us';



	// Selected menu item
	var defaultSelectedMenuItemName = -1;
	var defaultSelectedMenuImageArrayIndex = -1;


	// Returns a reference to the specified object.
	function CrossBrowserReturnObj(objId) {
		// IE4
		if (document.all && !document.getElementById) {
			obj = eval('document.all.' + objId);
		}
		// NS4
		// else if (document.layers) {
		// 	obj = eval('document.layers["' + objId + '"]');
		// }
		// IE5 and NS6
		else if (document.getElementById) {
			obj = document.getElementById(objId);
		}
		// other
		else {
			obj = eval(document[objId]); 
		}		
		
		// return object reference
		return obj;
	}


	// Handles the image shown when the mouse rolls over a menu item.
	function RollOver(objId,arrIndex) {
		var obj = CrossBrowserReturnObj(objId);
		obj.src = RELATIVE_IMAGE_PATH + '/' + MenuImgArray[arrIndex] + 'B.jpg';
	}


	// Handles the image shown when the mouse rolls out (off) a menu item.
	function RollOut(objId,arrIndex) {
		// Always keep the default selected menu item highlighted.
		if (objId != defaultSelectedMenuItemName) {
			var obj = CrossBrowserReturnObj(objId);
			obj.src = RELATIVE_IMAGE_PATH + '/' + MenuImgArray[arrIndex] + 'A.jpg';
		}
	}


	// Build HTML pertaining to a menu item and write it to the page.
	function BuildMenuItem(idValue,arrIndex) {
		var sTemp = '<td><a href="' + MenuLinkArray[arrIndex] + '"><img alt="' + MenuAltTextArray[arrIndex] + '" border="0" id="' + idValue + '" name="' + idValue + '" src="' + RELATIVE_IMAGE_PATH + '/' + MenuImgArray[arrIndex] + 'A.jpg"';
		if ((MenuLinkArray[arrIndex]).length > 0) {
			sTemp = sTemp + ' onmouseover="JavaScript:RollOver(' + idValue + ',' + arrIndex + ');" onmouseout="JavaScript:RollOut(' + idValue + ',' + arrIndex + ');"';
		}
		sTemp = sTemp + ' /></a></td>';
		document.write(sTemp);
	}


	// Build the menu based on the delimited string of array indices passed in.
	function BuildMenu(arrIndices) {

		var MenuIndexArray = arrIndices.split(",");

		// If there are menu items to display then build menu.
		if (MenuIndexArray.length > 0) {

			document.write('<table border="0" cellpadding="' + BUTTON_SPACING + '" cellspacing="0">');

			if ((MENU_TYPE == 'BH') || (MENU_TYPE == 'H')) {
				document.write('<tr>');
			}


			for (i=0;i<MenuIndexArray.length;i++) {
				var sIndex = MenuIndexArray[i];
				if (sIndex.charAt(sIndex.length-1) == "*") {
					sIndex = sIndex.substr(0,sIndex.length-1);
					defaultSelectedMenuItemName= i;
					defaultSelectedMenuImageArrayIndex  = sIndex;
				}

			
				if ((MENU_TYPE == 'BV') || (MENU_TYPE == 'V')) {
					document.write('<tr>');		
				}

				BuildMenuItem(i,sIndex);

				if ((MENU_TYPE == 'BV') || (MENU_TYPE == 'V')) {
					document.write('</tr>');	
				}

			}

			if ((MENU_TYPE == 'BH') || (MENU_TYPE == 'H')) {
				document.write('</tr>');
			}


			if (defaultSelectedMenuItemName> -1) {
				if ((MenuLinkArray[defaultSelectedMenuImageArrayIndex]).length > 0) {
				RollOver(defaultSelectedMenuItemName,defaultSelectedMenuImageArrayIndex);
				}
			}

			document.write('</table>');

		}
	}
//-->