/*
	Writes out Left Navigation tree based on current page determined automatically
		
	did not really want the hastle of moving one item to another section and updating 10-20 pages!
	
	Notes:
		If you find you have what appears to be an entire site map displayed in your file, make sure that an entry exists for it in the leftnavarray. If not bind it.
		This script and all file names refrenced are CASESENSITIVE!
		No getSiteRoot ("../" style relativity) function has been exists yet, so keep all htm files in root folder until it does
		
	Features:
		Navigation written from one function will write page specific link group and highlight selected url
		Ensures consitiancy between all pages displaying the left nav
		Supports three levels
		Supports binding to another link so that more than one page may use the same link/link tree
		Will allow different CSS Selectors to be used depending on browser type i.e "styleclassa = (NS4) ? stylens : stylenonns" etc
		Will only open level two if level one item's prefix is in its URL
		Will synch to current url. No inpage configuration outside function call is required. Completly ready for dreamweaver include file
		
		Added fetchTopLevelLeftNavItems() and writeLeftNavDropDown() functions, these will use the items from the leftnavarray and create a dropdown/array of level 0 elements
		Added writeLeftNavTopLevel() for use to display links from level 0 on homepage
		Improved and tested page binding
		Improved rendering speed through more 'doINeedToDoThis' function logic
		Classes may now be taken from the page the script is on (must be in page)
		Sitemap example was created "_rbsitemapexample.htm"
	
		Now background colors can be set for elemets by group or by state. see: backgroundcoloronactiveonly & backgroundcolors array.
		pageTitles multi-dim array contains all active page links... can be written to document using options in writePageTitle();
		
	Limitations:
		Currently only 3 levels, a forth level would slow things down a little, will add if needed.
	
	Tested:
		PC:		IE IE 4, 5; NS 4.01*, 6.1
		MAC:	IE 4.5*, 5; NS 4.08*, 6.0
		LIN:	NA
		
		*(font was smaller than it should be, completly css related)

	Latest:
		Page binding repurposed as only needed for items that ARE NOT present on the left nav but highlight a link on the left nav.
		
	Reuben Bell
	Reuben.Bell@RufusLeonard.co.uk
*/


var fixhsurl = true; //will "pretend" hs~ (homesite) isnt there.
function getPage(url){ //determine current page from url provided or location.href by default
	if (!url) url = location.href;
	
	if (fixhsurl) url = url.replace("hs~","")
	
	var pageName = ""
	if (url.indexOf("://") != -1){ //browsing on server
		pageName = url.substring(url.lastIndexOf('/')+1,url.length) //http://www.sdas.com/sd OR https://xx
	}else{
		pageName = url.substring(url.lastIndexOf('\\')+1,url.length) //viewed locally c:\ OR \\mynetserv\myshare\etc
	}
	
	return pageName;
}

//NOTE: to self. notuseda could become style as optional.
function writePageTitle(writetype,notuseda,notusedb){ //NOTE: writetype; if = 2 then will write link not title (1), generic style = 0. each argument (from 3+) represents a level, every argument will be seperated by a predefined str eg. argument3 : argument 4
/*	var temparray = new Array();
	for (var i=3;i<arguments.length;i++){
		temparray[temparray.length] = arguments[i];
	}
*/	
/*	if (writetype == 0){ //title only
		for (var i=0;i<temparray.length;i++){
*/
	//if (typeof pageTitles[2][0] != "undefined"){


/*
			if (typeof pageTitles[0] != "undefined"){
				document.write('<span class="newArialMedBoldLightBlue">'+pageTitles[0][0]+'</span>')
			}			
			if (typeof pageTitles[1] != "undefined"){
				document.write('<span class="newArialMedBoldLightBlue"> : '+pageTitles[1][0]+'</span>')
			}
			if (typeof pageTitles[2] != "undefined"){
				document.write('<span class="newArialMedBoldLightBlue"> : '+pageTitles[2][0]+'</span><br><br>')
			}else{
				document.write('<br><br>')
			}
*/

			if (typeof pageTitles[0] != "undefined"){
				document.write('<a class="newArialMedBoldLightBlue" href="'+pageTitles[0][1]+'">'+pageTitles[0][0]+'</a>')
			}			
			if (typeof pageTitles[1] != "undefined"){
				document.write('<span class="newArialMedBoldLightBlue"> : </span><a class="newArialMedBoldLightBlue" href="'+pageTitles[1][1]+'">'+pageTitles[1][0]+'</a>')
			}
			if (typeof pageTitles[2] != "undefined"){
				document.write('<span class="newArialMedBoldLightBlue"> : </span><a class="newArialMedBoldLightBlue" href="'+pageTitles[2][1]+'">'+pageTitles[2][0]+'</a><br><br><br>')
			}else{
				document.write('<br><br><br>')
			}







	//}else{
			//document.write('<span class="newArialMedBoldDarkRed">'+pageTitles[1][0]+'</span><br><br>')
	//}
/*		}
	}
*/
}

//new for enitre sitemap render
if (typeof isLeftNavSitemap == "undefined"){
	isLeftNavSitemap = false;
}
//new for enitre sitemap render
/*
	Settings for links - can be overidden from within page [put any overides in before writeleftnav] (all or nothing)
*/
if (typeof LeftNavLinkClassMainOff == "undefined"){

	var LeftNavLinkClassMainOff = "newArialSmallerBoldWhite"
	var LeftNavLinkClassMainOn = "newArialSmallerBoldWhiteU"

	var LeftNavLinkClassLvOneOff = "newArialSmallerNormWhite"
	var LeftNavLinkClassLvOneOn = "newArialSmallerNormWhiteU"

	var LeftNavLinkClassLvTwoOff = "newArialSmallerNormWhite"
	var LeftNavLinkClassLvTwoOn = "newArialSmallerNormWhiteU"

}

var linkVspacing = new Array(); //level 0 (usually section name), level 1, level 2 - use -1 or 0 to specify no shimming. - should be even number otherwise is likley to be rounded up anyway.
	linkVspacing[0] = 4;
	linkVspacing[1] = linkVspacing[0]; //same as between section name and first lv1 item
	linkVspacing[2] = 2;
	
var linkHspacing = new Array(); //level 0 (usually section name), level 1, level 2 - use -1 or 0 to specify no shimming. - should be even number otherwise is likley to be rounded up anyway.
	linkHspacing[0] = 3;
	linkHspacing[1] = linkHspacing[0]; //same as between section name and first lv1 item
	linkHspacing[2] = (linkHspacing[0]+15);

var backgroundcoloronactiveonly = true; //used only on active elements on that level.
var backgroundcolors = new Array(); //same style as above, specified in hex/std html i.e #000000 / black are both valid - none to void!!!
	backgroundcolors[0] = '#604479';
	backgroundcolors[1] = '#604479';
	backgroundcolors[2] = '#604479';

var widthofnavtable = 148; //used when needed
	
/*
	Creating Menu Items [argument breakdown]
		level [int - (0-2)] - though all links are visible this defines the indentation/class used and lv0's are written in bold (css specified) [no code based relationship after generation]
		link title [string] - text of link
		link title [string (relative url)] - URL of link
		link binding [string (relative url)] - If this link should highlight another use this... i.e if contact form had two pages contact1.htm and contact2.htm in the binding argument for contact2.htm use contact1.htm to highlight the contact link. - make sense? binding to "" should prevent highlight alltogether

*/
var leftNavArray = new Array();
	leftNavArray[leftNavArray.length] = new Array(0,"Home","index.htm")

	leftNavArray[leftNavArray.length] = new Array(0,"Our Business","ourbusiness.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Ideas scheme","ideasscheme.htm") //new from trans...
	leftNavArray[leftNavArray.length] = new Array(1,"Executive committee","execcommitee.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Adastral Hub","adastral.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Management system","managementsystem.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Business Continuity Management","continuitymanagement.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Performance contract scorecard","scorecard.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Brand","brand.htm")

	leftNavArray[leftNavArray.length] = new Array(0,"Sales","sales.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Sales news","salesnews.htm") 
	leftNavArray[leftNavArray.length] = new Array(2,"Business Bulletin","salesnews_businessbulletin.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Selling through BT partners","btp.htm") 
	leftNavArray[leftNavArray.length] = new Array(2,"BT Retail","btp_btretail.htm")
	leftNavArray[leftNavArray.length] = new Array(2,"BT Wholesale","btp_btwholesale.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Managing our customers","moc.htm") 
	leftNavArray[leftNavArray.length] = new Array(2,"Account directors","moc_accountdirectors.htm") 
	leftNavArray[leftNavArray.length] = new Array(2,"Sectors","moc_sectors.htm") 
	leftNavArray[leftNavArray.length] = new Array(2,"Commercial and Bid management","moc_com&bidmanagement.htm") 
	leftNavArray[leftNavArray.length] = new Array(1,"Sales leads","salesleads.htm") 
	leftNavArray[leftNavArray.length] = new Array(1,"Sales tools","salestools.htm") 
	
	leftNavArray[leftNavArray.length] = new Array(0,"Marketing","marketing.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Marketing news","marketingnews.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Brand information","brandinformation.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Downloads","downloads.htm")
	leftNavArray[leftNavArray.length] = new Array(2,"Interim datasheets","downloads_interimds.htm") 
	leftNavArray[leftNavArray.length] = new Array(2,"Standard slide","downloads_standardslides.htm") 
	leftNavArray[leftNavArray.length] = new Array(1,"Marketing tools","marketingtools.htm")
	

	leftNavArray[leftNavArray.length] = new Array(0,"Transformation","transformation.htm")
	//leftNavArray[leftNavArray.length] = new Array(1,"Ideas scheme","ideasscheme.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Commercial skills acquisition programme","skillsaquisition.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Communications","communications.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Proposition marketing and lifecycle management","pm&lmanagement.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Pricing implementation programme","pricingimp.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"BT Group transformation","btgtransformation.htm")

	leftNavArray[leftNavArray.length] = new Array(0,"News","news.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"What's happening","whatshappening.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Business bulletin","bulletin.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Newslog","newslog.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Executive briefing","execbriefing.htm")
	leftNavArray[leftNavArray.length] = new Array(1,"Events calendar","events.htm")



	
	
	
	
	
//process to turn backgroundcolors array into bgcolhtml equiv. - processing time down!
	var bgcolhtml = new Array();
	for (var i=0;i<backgroundcolors.length;i++){
		if ((backgroundcolors[i] == '')||(backgroundcolors[i] == 'none')){
			//do nout
			//setM(000,000,000);
			bgcolhtml[i] = '';
		}else{
			bgcolhtml[i] = ' bgcolor="' + backgroundcolors[i] + '" ';
		}		
	}

//end process


var leftNavArrayZerOnly = new Array(); //fills with item label, item url.
function fetchTopLevelLeftNavItems(force){ //does exactly what it says on the box - populates array with items at level 0. With force switch set to true will refresh from array even if the array has allreaddy been populated
	if ((leftNavArrayZerOnly.length == 0)||(force == true)){ //do we have top level items yet?
		for (var i=0;i<leftNavArray.length;i++){
			if (leftNavArray[i][0] == 0){
				leftNavArrayZerOnly[leftNavArrayZerOnly.length] = new Array(leftNavArray[i][1],leftNavArray[i][2])
			}
		}
	}
}

function writeLeftNavTopLevel(){ //used to write homepage links
	var HTMLStr = '';
	var curpage = getPage();
	curpage = getPageBinding(curpage); //will locate which (if any) link this page is bound to
	var isactivepage;
	
	fetchTopLevelLeftNavItems(false); //[false] = were happy if the array is allready filled
	
	HTMLStr += '<table cellpadding="0" cellspacing="0" border="0" width="'+widthofnavtable+'">';
	for (var i=0;i<leftNavArrayZerOnly.length;i++){
		isactivepage = 0;
		if (curpage == leftNavArrayZerOnly[i][1]) isactivepage = 1;
		HTMLStr += '<tr><td'+getBackgroundColor(leftNavArray[i][0],isactivepage)+'><img src="gfx/spacer.gif" width="'+linkHspacing[0]+'" height="1" alt="" border="0"></td><td'+getBackgroundColor(leftNavArray[i][0],isactivepage)+'><a href="'+leftNavArrayZerOnly[i][1]+'" class="'+eval(getClassbit(0,isactivepage,curpage))+'">'+leftNavArrayZerOnly[i][0]+'</a></td></tr>';
		HTMLStr += '<tr><td'+getBackgroundColor(leftNavArray[i][0],isactivepage)+'><img src="gfx/spacer.gif" width="'+linkHspacing[0]+'" height="1" alt="" border="0"></td><td'+getBackgroundColor(leftNavArray[i][0],isactivepage)+'><img src="gfx/spacer.gif" width="1" height="4" alt="" border="0"></td></tr>';
	}
	HTMLStr += '</table>';
	
	document.write(HTMLStr);

}

function writeLeftNavDropDown(){
	var HTMLStr = '';

	fetchTopLevelLeftNavItems(false); //[false] = were happy if the array is allready filled
	
	HTMLStr += '<select name="goto" size="1" class="specialdd" onChange="if (this.options[this.options.selectedIndex].value!=\'no_jump\') {top.location=this.options[this.selectedIndex].value;} else {return false;}">'
	HTMLStr += '	<option value="#">Quick Menu</option>'
	//- add any items that need to be in the dropdown but not in the left nav here!
	//- end add
	for (var i=0;i<leftNavArrayZerOnly.length;i++){
		HTMLStr += '<option value="'+leftNavArrayZerOnly[i][1]+'">- '+leftNavArrayZerOnly[i][0]+'</option>'
	}
	HTMLStr += '</select>'
	
	document.write(HTMLStr);
}

/*
	functions used by WriteLeftNav() only
*/
function LeftNavIsolateSection(curpage){ //scrubs sections not needed for page from main array
	//var bindingPriorty = false; //does a bound decliration take precedence over std? - currently always the case.
	
	var curSectionArray = new Array();
	var curpagefound = false;
	var tmpbind
	
	for (var i=0;i<leftNavArray.length;i++){
		if (((leftNavArray[i][0] == 0)&&(i!=0))||(i == leftNavArray.length-1)){ //if we are starting a new group
			if (i == leftNavArray.length-1){ //special workarround for last item
				//ALWAYS TAKE MOST RECENT FROM AREA INDICATED BELOW THIS BLOCK
				if (curpage.indexOf(leftNavArray[i][2])!=-1){ //somtimes in dev had hs~ which diddnt help
					curpagefound = true;
				}
				if (typeof leftNavArray[i][3] != "undefined"){
					curSectionArray[curSectionArray.length] = new Array(leftNavArray[i][0],leftNavArray[i][1],leftNavArray[i][2],leftNavArray[i][3])
				}else{
					curSectionArray[curSectionArray.length] = new Array(leftNavArray[i][0],leftNavArray[i][1],leftNavArray[i][2])
				}
				//ALWAYS TAKE MOST RECENT FROM AREA INDICATED BELOW THIS BLOCK ENDS
			}
		
			if (curpagefound == false){
				curSectionArray = new Array(); //restart group
			}else{
				leftNavArray = new Array()
				leftNavArray = curSectionArray;
				return;
			}
			curpagefound = false;
		}
		//AREA INDICATED
		if (curpage.indexOf(leftNavArray[i][2])!=-1){ //somtimes in dev had hs~ which diddnt help (reason for indexOf())
			curpagefound = true;
		}
		
		if (typeof leftNavArray[i][3] != "undefined"){
			if ((leftNavArray[i][3].substring(0,PagePrefix[0].length) == PagePrefix[0])||leftNavArray[i][0]!=2){ //if we are in level 2 with prefix match OR in anyother level
				curSectionArray[curSectionArray.length] = new Array(leftNavArray[i][0],leftNavArray[i][1],leftNavArray[i][2],leftNavArray[i][3])
			}
		}else{
			if ((leftNavArray[i][2].substring(0,PagePrefix[0].length) == PagePrefix[0])||leftNavArray[i][0]!=2){ //if we are in level 2 with prefix match OR in anyother level
				curSectionArray[curSectionArray.length] = new Array(leftNavArray[i][0],leftNavArray[i][1],leftNavArray[i][2])
			}
		}
		//AREA INDICATED ENDS
	}
	
}

//MUST be run before section is isolated in LeftNavIsolateSection, otherwise would prevent bind across sections
function getPageBinding(pageName){ //returns array index of page bound element
	var pageBoundTo = pageName; //returns origional page name if binding could not be found
	for (var i=0;i<leftNavArray.length;i++){
		if (pageName == leftNavArray[i][2]){ //if link on this element i.e (the page we are on)
			if (typeof leftNavArray[i][3] != "undefined"){ //and we have binding action
				pageBoundTo = leftNavArray[i][3]
				//alert(pageBoundTo)
			}
		}
	}

	return pageBoundTo
}

function getClassbit(level,isactivepage,pageName){ //level as int, isactivepage as int [reason; we use this as array index]...
	var rclassbit = 'LeftNavLinkClass'
	var rclassbitstyle = new Array('Off','On')
		if (level == 0){
			rclassbit += "Main";
		}else if (level == 1){
			rclassbit += "LvOne";
		}else if (level == 2){
			rclassbit += "LvTwo";
		}
	
	//new using PagePrefix array - highlight of parent item [item level is 1]
if (properprefix == true){ //this prevents new.htm from highlighting news.html for example.
	if ((PagePrefix[0].substring(0,PagePrefix[0].length-1) == pageName.substring(0,PagePrefix[0].length-1))&&(level==1)){ //note: would need level-1 if generic..
		isactivepage = 1
	}
}
	//end new using pageprefix array
	
	rclassbit += rclassbitstyle[isactivepage];
	
	//- reuse means that we need to do this post-process. :     rclassbit = eval(rclassbit);
	return rclassbit
}

var pageTitles = new Array(); //populated when WriteLeftNav(); is called.
function setPageTitles(level, pageName, url){
	pageTitles[level] = new Array(pageName, url)
}

var properprefix
function getPagePrefix(pageName){
	if (pageName.indexOf("_")!=-1){ //at least one prefix exists in pagename - remember no bridge between lv0 and 1 is required as lv0 and 1 are always visible.
		PagePrefix[0] = pageName.substring(0,pageName.indexOf("_")+1) //currently we only need one level (lv1 prefix for lv2 pages)
		properprefix = true;
	}else{ //if no prefix is present, this page is used as a base to compare by
		properprefix = false;
		PagePrefix[0] = pageName.substring(0,pageName.indexOf("."))+"_"
	}
}

//gets bgcolor for specified level... will not return unless "backgroundcoloronactiveonly"==false OR link/page is active
function getBackgroundColor(level,isactive){
	var retstr = '';
	if ((backgroundcoloronactiveonly == false)||(isactive==1)){
		retstr = bgcolhtml[level];
	}
	return retstr;
}

//actually writes out the left nav - needs getPage() function
var PagePrefix = new Array('nonespecified','nonespecified'); //new to get parents prefix if applicable [array allows *easier* expansion]
var writeExtraHomeLink = true; //used to force home link to all sub sections
function WriteLeftNav(){
	var curpage = getPage();
	var HTMLStr = '';
	var firstbit, lastbit, isactivepage, classbit, linkstr
		
	curpage = getPageBinding(curpage); //will locate which (if any) link this page is bound to
	
	
	getPagePrefix(curpage) //populates PagePrefix array with page prefix's (currently split by prefix1_page.html etc could be folder1/page.html)
	
	LeftNavIsolateSection(curpage); //will strip out sections not required on this page.
	
	HTMLStr += '<table cellpadding="0" cellspacing="0" border="0" width="'+widthofnavtable+'">'
	
	if (writeExtraHomeLink == true){
		HTMLStr += '<tr><td>'
		HTMLStr += '<table cellpadding="0" cellspacing="0" border="0">'
		HTMLStr += '	<tr>'
		HTMLStr += '		<td><img src="gfx/spacer.gif" width="'+linkHspacing[0]+'" height="1" alt="" border="0"></td>'
		HTMLStr += '		<td><a href="index.htm" class="'+LeftNavLinkClassMainOff+'">Home</a></td>'
		HTMLStr += '		<td><img src="gfx/spacer.gif" width="'+linkHspacing[0]+'" height="1" alt="" border="0"></td>'
		HTMLStr += '	</tr>'
		HTMLStr += '</table>'
		HTMLStr += '</td></tr>'
		HTMLStr += '<tr><td><img src="gfx/spacer.gif" width="1" height="15" alt="" border="0"></td></tr>'
	}
	
	for (var i=0;i<leftNavArray.length;i++){
if (typeof leftNavArray[i][3] == "undefined"){ //If a page is bound to another page its link will NO LONGER BE VISIBLE IN THE LEFT NAV!!!

		//sitemap only
		if (isLeftNavSitemap == true){
			if ((leftNavArray[i][0] == 0)&&(i != 0)){
				HTMLStr += '<tr><td><img src="gfx/spacer.gif" width="1" height="10" alt="" border="0"></td></tr>'
			}
		}
		//end sitemap only




		firstbit = '';
		lastbit = '';
		isactivepage = 0;;

		if (curpage == leftNavArray[i][2]){ 
			isactivepage = 1;
		}
		
		//new (put spacing between lv0/1 items
		if ((linkVspacing[leftNavArray[i][0]] != -1)&&(linkVspacing[leftNavArray[i][0]] != 0)){
			HTMLStr += '<tr><td'+getBackgroundColor(leftNavArray[i][0],isactivepage)+'><img src="gfx/spacer.gif" width="1" height="'+parseInt(linkVspacing[leftNavArray[i][0]]/2)+'" alt="" border="0"></td></tr>'
		}
		//end new
		
		HTMLStr += '<tr><td'+getBackgroundColor(leftNavArray[i][0],isactivepage)+'>'
			HTMLStr += '<table cellpadding="0" cellspacing="0" border="0"><tr>'
	
		//H spacing on left
		if ((linkHspacing[leftNavArray[i][0]] != 0)&&(linkHspacing[leftNavArray[i][0]] != -1)){
			firstbit = '<td><img src="gfx/spacer.gif" width="'+linkHspacing[leftNavArray[i][0]]+'" height="1" alt="" border="0"></td>';
			lastbit = '<td><img src="gfx/spacer.gif" width="'+linkHspacing[leftNavArray[i][0]]+'" height="1" alt="" border="0"></td>';
		}
		//hspace on left ends

		classbit = getClassbit(leftNavArray[i][0],isactivepage,leftNavArray[i][2])
		//set page title if this link is active - reuses class bit
			//this is a bit of a cheat... there is no script defined relationship between level 1 and level 0 outside that of the array... however there is only ever one level0 item and it is always the first. so we set this to title 0 (would be overidden by last level 0 item with onstate)- RB
				if (i==0){
					setPageTitles(leftNavArray[i][0], leftNavArray[i][1], leftNavArray[i][2]);
				}
			//end cheat

			if (classbit.substring(classbit.length-3,classbit.length).indexOf("On") != -1) { //check last three characters contain On.. (otherwise LvOne would match!!!
				setPageTitles(leftNavArray[i][0], leftNavArray[i][1], leftNavArray[i][2]);
			}
		//end page title set
		classbit = eval(classbit)
		
		linkstr = leftNavArray[i][2]

		HTMLStr += firstbit+'<td><a href="'+linkstr+'" class="'+classbit+'">'+leftNavArray[i][1]+'</a></td>'


		
		
			HTMLStr += '</tr></table>'
		HTMLStr += '</td></tr>'
		
		//new (put spacing between lv0/1 items
		if ((linkVspacing[leftNavArray[i][0]] != -1)&&(linkVspacing[leftNavArray[i][0]] != 0)){
			HTMLStr += '<tr><td'+getBackgroundColor(leftNavArray[i][0],isactivepage)+'><img src="gfx/spacer.gif" width="1" height="'+parseInt(linkVspacing[leftNavArray[i][0]]/2)+'" alt="" border="0"></td></tr>'
		}
		//end new

	}
}
	HTMLStr += '</table>'
	
	document.write(HTMLStr);
}