/****************************************

Writes the left navigation to the page
Make Changes only where indicated

****************************************/

function buildLeftNav() {
	var navPages = new Array();


	/****************************************
	
	List Pages in the order they will appear 
	when the menu is fully expanded.  Number
	pages sequentially (e.g. navPages[0],
	navPages[1], etc.)
	
	Array( A , B , C)
	A = href to link to
	B = page name - note that if page name is long and will wrap to multiple lines,
		each line following the first must be surrounded by DIV tags
	C = level of hierarchy - 0 is primary, 1 secondary, etc.
	
	Edit only the below:
	
	****************************************/

	navPages[0] = new Array('products.html','Products',0);
	navPages[1] = new Array('products_0.html','Readers',1);
	navPages[2] = new Array('products_0_0.html','Mobile',2);
	navPages[3] = new Array('products_0_0_0.html','Contact',3);
	navPages[4] = new Array('products_0_0_1.html','Contactless',3);
	navPages[5] = new Array('products_0_1.html','Desktop',2);
	navPages[6] = new Array('products_0_1_0.html','Contact',3);
	navPages[7] = new Array('products_0_1_1.html','Contactless',3);
	navPages[8] = new Array('products_0_1_2.html','Dual Contact/<div>Contactless</div>',3);
	navPages[9] = new Array('products_0_2.html','Access Control',2);
	navPages[10] = new Array('products_0_3.html','OEM Modules',2);
	navPages[11] = new Array('products_0_3_0.html','ISO 14443<div>Contactless</div>',3);
	navPages[12] = new Array('products_0_3_1.html','ISO 15693<div>RFID</div>',3);
	navPages[13] = new Array('products_0_3_2.html','125 kHz Prox',3);
	navPages[14] = new Array('products_0_4.html','Development<div>Kits</div>',2);
	navPages[15] = new Array('products_0_5.html','Long Range<div>Readers</div>',2);
	navPages[16] = new Array('products_0_5_0.html','LF – 125 kHZ',3);
	navPages[17] = new Array('products_0_5_1.html','HF – ISO 15693',3);
	navPages[18] = new Array('products_0_5_2.html','UHF',3);
	navPages[19] = new Array('products_1.html','Cards, Tags &amp; <div>Labels</div>',1);
	navPages[20] = new Array('products_1_0.html','Contact<div>SmartCards</div>',2);
	navPages[21] = new Array('products_1_1.html','Contactless<div>Cards</div>',2);
	navPages[22] = new Array('products_1_2.html','Tags &amp;<div>Transponders</div>',2);
	navPages[23] = new Array('products_1_2_0.html','Keyfobs',3);
	navPages[24] = new Array('products_1_2_1.html','Disctags',3);
	navPages[25] = new Array('products_1_2_2.html','Wristbands',3);
	navPages[26] = new Array('products_1_3.html','Smart Labels',2);
	navPages[27] = new Array('products_1_4.html','Special Tags',2);
	navPages[28] = new Array('products_2.html','Handheld Devices',1);
	navPages[29] = new Array('products_3.html','Biometrics',1);
	navPages[30] = new Array('services.html','Services',0);	
	navPages[31] = new Array('services_1_0.html','Card<div>Personalization</div>',1);
	navPages[32] = new Array('services_2_0.html','Software<div>Development</div>',1);
	navPages[33] = new Array('services_3_0.html','Marketing<div>Programs</div>',1);
	navPages[34] = new Array('consulting.html','Consulting',0);
	navPages[35] = new Array('infocenter.html','Info Center',0);
	navPages[36] = new Array('infocenter_0.html','White Papers',1);
	navPages[37] = new Array('infocenter_1.html','Industry Standards',1);
	navPages[38] = new Array('infocenter_2.html','FAQs',1);
	navPages[39] = new Array('infocenter_3.html','Glossary',1);
	navPages[40] = new Array('infocenter_4.html','Useful Links',1);
	navPages[41] = new Array('infocenter_5.html','NFC',1);

	/****************************************	
	
	Edit only the above
	
	****************************************/
	
	var txt = '';
	for(var i=0, lastL = -1, firstUL = true; i<navPages.length; i++) {
		var page = navPages[i];
		var nextL = 0;
		// if not last page
		if(i<navPages.length-1) {
			nextL = navPages[i + 1][2];
		} else {
			nextL = page[2];	
		}
		// moving down a level
		if(page[2]>lastL) {
			if(firstUL) {
				firstUL = false;
				txt += '<ul id="leftNavUL">\n';
			} else {
				txt += '<ul style="display: none;">\n';
			}
			txt += '<li>\n<a href="#" id="a_' + page[0].substr(0,page[0].length-5) + '" ';
			// if next is same level
			if(nextL<=page[2]) {
				txt += 'class="notArrow"><SPAN><SPAN>&#8226;';
			} else {
				txt += 'class="arrowRight"><SPAN><SPAN>&plusmn;';
			}
			txt += '</SPAN>&nbsp;&nbsp;</SPAN></a>\n<a href="' + page[0] + '" id="' + page[0].substr(0,page[0].length-5) + '" class="leftNavText">' + page[1]+ '</a>\n';
		} else {
			// moving up a level
			if(page[2]<lastL) {
				for(var j=0, k=lastL-page[2]; j<k; j++) {
					txt += '</li>\n</ul>\n';	
				}
			}
			// same level
			txt += '</li>\n<li>\n<a href="#" id="a_' + page[0].substr(0,page[0].length-5) + '" ';
			// if next is same level
			if(nextL<=page[2]) {
				txt += 'class="notArrow"><SPAN><SPAN>&#8226;';
			} else {
				txt += 'class="arrowRight"><SPAN><SPAN>&plusmn;';
			}
			txt += '</SPAN>&nbsp;&nbsp;</SPAN></a>\n<a href="' + page[0] + '" id="' + page[0].substr(0,page[0].length-5) + '" class="leftNavText">' + page[1]+ '</a>\n';
		}
		lastL = page[2];
	}
	document.write('<div id="leftNav">');
	document.write(txt);
	document.write('</div>');
}