// first initialization
function navInit()
{
	if (parent.frames.length > 0)
	{
		// location of frames
		navBrain			=	parent.navBrain
		topMenu				=	parent.navMenu	
		defaultTargetFrame	=	parent.pumpContent
		setPopID = ''
	}
	// open the very first page
	if (dataObj.top.childs[0])
	{openPage(dataObj.top.childs[0])}
	else
	{openPage('top')}
	// or set active page
	//	setActive('ncsDB_82')
	// write the menu
	writeViewMenu()
}

/// configure options: ////////////////////////////////////////////////////////
dbName					=	'navDB' // default value for which DB to use - used in administration
lastDBname				=	'navDB' // default value for which DB that is last in the DB listing - used in administration
useIndentString 		=	'no'	// options are 'yes', 'no' or 'allways' ('allways' even overrides customized input)
useIcons				=	false	// options are: 'yes',false or '[level]' where level is the level sent to writeLinks, example: allChilds(tree-structures)
all_expanded			=	'yes'	// options are 'yes' or 'no'
useTreeLevels			=	'yes'	// options are: 'yes' or false - use special classes for tree-structures?
skipLevel				=	'top'		//  set level to skip when doing allParents-listing - normally : 'top', to skip the current active page: 'current'
useFirstChildForFolders	=	'yes'	// options are 'yes' or 'no' - ? open first child as default for folders ?
webPath					=	''		//
imgPath					=	'/sys_images/'	
defaultLinkDesc			=	'click to view'	//
defaultAction			=	doNothing // set the normal click action (for IE5+)
// html markup for menu's
// html markup for menu's
connect_doc			=	''//'<img src="'+imgPath+'continue_line.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
connect_last_doc	=	''//'<img src="'+imgPath+'end_line.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
connect_rows		=	''//'<img src="'+imgPath+'connect_line.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
connect_rows		=
empty_image			=	'<img src="'+imgPath+'pix.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
icons = new Array() // icons in array should be named : [open/closed_][templatename]_icon
icons['file_icon']			=	'<img src="'+imgPath+'fileDoc.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
icons['image_icon']			=	'<img src="'+imgPath+'imageDoc.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
icons['URL_icon']			=	'<img src="'+imgPath+'webDoc.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
icons['default_icon']		=	'<img src="'+imgPath+'paperDoc.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
icons['closed_folder_icon']	=	'<img src="'+imgPath+'closed_folder.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
icons['open_folder_icon']	=	'<img src="'+imgPath+'open_folder.gif" width="15" height="18" alt="" border="0" hspace="0" vspace="0" align="absmiddle">'
icons['open_sys_folder_icon']		=	'<img src="'+imgPath+'open_sys_folder.gif" width="15" height="18" alt="" border="0" align="absmiddle">'
icons['closed_sys_folder_icon']		=	'<img src="'+imgPath+'closed_sys_folder.gif" width="15" height="18" alt="" border="0" align="absmiddle">'
icons['open_top_icon']		=	'<img src="'+imgPath+'open_folder.gif" width="15" height="18" alt="" border="0" align="absmiddle">'
icons['closed_top_icon']	=	'<img src="'+imgPath+'closed_folder.gif" width="15" height="18" alt="" border="0" align="absmiddle">'
icons['open_pop_icon']		=	''//'<img src="'+imgPath+'open_pop_arrow.gif" width="9" height="9" alt="" border="0" align="absmiddle">'
icons['close_pop_icon']		=	''//'<img src="'+imgPath+'close_pop_arrow.gif" width="9" height="9" alt="" border="0" align="absmiddle">'
linklist_delimiter			=	'&nbsp;&nbsp;&nbsp;&nbsp;' // default delimiter 
linkListEnd					=	''	// default listings end
allchilds_delimiter			=	' '	// delimiter for allChilds listings (tree structures)
allparents_delimiter		=	':<br>'	// delimiter for allParents listings (path structures)
///////////////////////////////////////////////////////////////////////////////
///    Navigation Object by niclas@nomedia.net 2002       /////////////////////
///////////////////////////////////////////////////////////////////////////////

// Add some functionality to Arrays
Array.prototype.addTo	=	addToArray
Array.prototype.matchObjInList	=	matchObjInList
// Create initial active pages array
activePages = new Array()
// Create dataObject
createDataObj()

// dataObject ///////
function createDataObj()
{
	for (count = 0; count < dataList.length ; count++)
	{
		if (dataList[0].split('\t')[0] == 'ID')
		{
			dataObj[dataList[count].split('\t')[0]] = new dataObj(dataList[count].split('\t'))
			dataObj[dataList[count].split('\t')[0]].currPos =	count
		}
		else
		{
			dataObj[count]	=	new dataObj(dataList[count].split('\t'))
			dataObj[count].ID	=	count
			dataObj[count].currPos	=	count
		}
	}
	if (dataObj[dataList[1].split('\t')[0]].ID == 'top') //handle standalone top-level doc without parentID
	{
		dataObj['topParent']	=	new dataObj(dataList[1].split('\t'))
		dataObj['topParent'].ID = 'topParent'
		dataObj.top.parentId	=	'topParent'
		//dataObj.topParent.childs.addTo('top')
	}
	if (dataObj[dataList[1].split('\t')[0]].parentId)
	{
		for (count = 1; count < dataList.length ; count++)
		{
			if (dataList[0].split('\t')[0] == 'ID')
			{
				if (dataObj[dataObj[dataList[count].split('\t')[0]].parentId])
				{
					dataObj[dataObj[dataList[count].split('\t')[0]].parentId].childs.addTo([dataList[count].split('\t')[0]])
					dataObj[dataObj[dataList[count].split('\t')[0]].parentId][dataList[count].split('\t')[0]] =  dataObj[dataList[count].split('\t')[0]]
				}
				else if (dataObj[dataList[count].split('\t')[0]].ID == 'top')
				{
					// do something with the root document
				}
				else if (dataList[count].split('\t')[0] == 'system')
				{
					dataObj.system.parentId	=	'topParent'
					dataObj.topParent.childs.addTo('system')
										dataObj[dataObj[dataList[count].split('\t')[0]].parentId][dataList[count].split('\t')[0]] =  dataObj[dataList[count].split('\t')[0]]
				}
				else
				{
					alert('Error:\ndocument "'+[dataList[count].split('\t')[0]]+'" refers to "'+dataObj[dataList[count].split('\t')[0]].parentId+'" as parent\n\n : "'+dataObj[dataList[count].split('\t')[0]].parentId+'" does not exist!')
				}
			}
			else
			{
				if (dataObj[dataObj[count].parentId])
				{
					dataObj[dataObj[count].parentId].childs.addTo(count)
					dataObj[dataObj[count].parentId][count]	=	dataObj[count]
				}
				else
				{
					alert('Error:\ndocument "'+count+'" refers to "'+dataObj[count].parentId+'" as parent\n\n : "'+dataObj[count].parentId+'" does not exist!')	;
				}
			}
		}
	}
}
// the actual navigation object - creates properties named by headings in dataList and values from input(row from dataList)
function dataObj(inData)
{
	for (var rows = inData.length ; rows >= 0  ; rows--)
	{
		this[dataList[0].split('\t')[rows]]	=	inData[rows]
	}
		if (((this.ID)&&(this.template))&&(!this.href))
	{
		// edit this line to fit your system
		this.href	= '/cgi-bin/docParser.pl?&ID='+this.ID+'&template='+this.template
	}
	this.childs	=	new Array
}
// end dataObject ///

// build navigation
function writeLinks(input,action,level,linkString,custom_delimiter,matchCol,matchStr) 
// actions are: view (optionally : edit, move, del ...)
// levels are : 
//	'childs'		- lists childs level
//	'current' (default)
// 	'singelCurrent' - outputs the the calling ID
//	'parent'		- lists parent level
//	'singelParent'	- outputs the parent
//	'allChilds'		- creates childs multi-level tree-structures
//	'allParents'	- creates an hierarchy upwards, defining where you are on the site (bread crumbs)
// for the advanced users there is also linkString that replaces the entire link from input and uses <navObj:propertyname> för properties
// and custom_delimiter
// added for pumpteknik: matchCol and matchStr : matching list column(heading) and the value to match
{
	linkList	=	new Array()
	var docList		=	0
	if (custom_delimiter)
	{
		var delimiter	=	custom_delimiter
	}
	else
	{
		var delimiter	=	linklist_delimiter
	}
	if (level == 'childs')
	{
		docList = 	dataObj[input].childs
	}
	else if (level == 'parent')
	{
		docList = 	dataObj[dataObj[dataObj[input].parentId].parentId].childs
	}
	else if (level == 'singleParent')
	{
		docList = 	new Array(dataObj[input].parentId)
	}
	else if (level == 'singleCurrent')
	{
		docList = 	new Array(dataObj[input].ID)
	}
	else if (level == 'allParents')
	{
		docList = 	new Array
		parentTest = input
		testCount=100
		while (dataObj[parentTest].parentId)
		{
			if ((parentTest != skipLevel)&&((skipLevel != 'current')||(parentTest != input)))
			{
				docList[testCount]	=	parentTest
			}
			parentTest	=	dataObj[parentTest].parentId
			testCount--
		}
		delimiter	=	allparents_delimiter
	}
	else if (level == 'allChilds')
	{
		docList 	=	findChilds(input)
		delimiter	=	allchilds_delimiter
	}
	else if (level == 'matchList')
	{
		docList = matchObj(matchCol,matchStr)
		delimiter	=	allchilds_delimiter
	}
	else
	{
		docList	= 	dataObj[dataObj[input].parentId].childs
	}
	if (docList)
	{
/*		if ((matchCol)&&(matchStr))
		{
			docList	=	new Array(docList.matchObjInList(matchCol,matchStr))
		}*/
		var rows = docList.length - 1
		for (var i = 0 ; i <= rows;i++)
		{
			if (level == 'allChilds')
			{
				var childLevel	=	docList[i].split('::')[1]
				var activeLevels	=	docList[i].split('::')[2].split('\t')
				docList[i]	=	docList[i].split('::')[0]
			}
			//if ((docList[i])&&(dataObj[docList[i]].ID!='system')) // används i navObj
			if (docList[i])
			{
				// manage target
				if (dataObj[docList[i]].target == '_top')
				{
					targetFrame =	'parent'
				}
				else if (dataObj[docList[i]].target == '_new')
				{
					targetFrame	=	'window.open()'
				}
				else if (dataObj[docList[i]].target)
				{
					targetFrame	=	'parent.'+[dataObj[docList[i]].target]
				}
				else
				{
					targetFrame	=	'parent.'+defaultTargetFrame.name
				}
				// set class
				(dataObj[docList[i]].parentId == '1')	?	
					preRefClass = 'top'
				:	
					((level == 'allChilds')&&(useTreeLevels))	?	
						(dataObj[docList[i]].parentId == 'top')	?	
							preRefClass = 'treeTop'
						:
							preRefClass = 'treeSub'
					:
						preRefClass = 'sub'	
				;
				(setPopID)	?
					(docList[i] == setPopID)		?	
						refClass	=	preRefClass+'NavActiveAction'	
						:
						(activePages[docList[i]])		?	
						refClass	=	preRefClass+'NavActive'
						:
						refClass	=	preRefClass+'Nav'
					:
					(activePages[docList[i]])		?	
						refClass	=	preRefClass+'NavActive'
						:
						refClass	=	preRefClass+'Nav'
				;
				dataObj[docList[i]].refClass = refClass;
				
				//handle fullName and linkdescription
				(dataObj[docList[i]].fullName)	?	
				fullName	=	dataObj[docList[i]].fullName
				:	
					(dataObj[docList[i]].template == 'static')?	
					fullName = dataObj[docList[i]].ID	
					:
					fullName = dataObj[docList[i]].href
					;
				;
				
				// use expansion icon when childs are present in allChilds-trees
				(dataObj[docList[i]].linkDesc)	?	linkDesc	=	dataObj[docList[i]].linkDesc	:	linkDesc = fullName	;
				
				if ((level == 'allChilds')&&(dataObj[docList[i]].childs.length >= 1))
				{
					expand_ico = 'pop_icon'
				}
				else
				{
					expand_ico = ''
				}
				
				// indent for child level - loop through indent-columns(levels)
				var indentString = ''
				for (var count = 0;count <= childLevel; count++)
				{
					if (activeLevels[count] == 'y')	// should there be a connector downwards in this column?
					{
						if (count == childLevel)	// the last column for this Item
						{
							indentString = indentString+connect_doc
						}
						else	 // the other columns for this Item
						{
							indentString = indentString+connect_rows
						}
					}
					else	
					{
						// ful-hack för webspinner
						if ((dataObj[docList[i]].ID == 'top')&&(dbName != lastDBname))
						{
							indentString = indentString+connect_doc
						}
						else if (count == childLevel)	// the last column for this Item
						{
							indentString = indentString+connect_last_doc
						}
						// ful-hack för webspinner
						else if ((count == 0)&&(dbName != lastDBname))
						{
							indentString = indentString+connect_rows
						}
						else	// the other columns for this Item
						{
							indentString = indentString+empty_image
						}
					}
				}
				// set icons
				if ((useIcons == level)||(useIcons == 'yes'))
				{
					var iconName = dataObj[docList[i]].template.replace(/_none/,'')
					if (icons[iconName+'_icon'])
					{
						use_icon	=	icons[iconName+'_icon']
					}
					else if ((icons['open_'+iconName+'_icon'])&&(icons['closed_'+iconName+'_icon']))
					{
						use_icon	=	(activePages[docList[i]])		?	icons['open_'+iconName+'_icon'] : icons['closed_'+iconName+'_icon'] ;
					}
					else
					{
						use_icon	=	icons['default_icon']
					}
				}
				else
				{
					use_icon	=	''
				}
				// use indent, icon etc with expansion 
				if  (expand_ico) 
				{
					(activePages[docList[i]])	?
					popAction = 'close'
					:
					popAction = 'open'
					;
					expand_start	=	'<span class="pop_expand">'
					expand_end	=	'</span>'
					if (useIndentString!='no')
					{
						indentString = indentString+expand_start+'<a ID="'+dataObj[docList[i]].ID+'" href="javascript:{parent.navBrain.popPage(\''+dataObj[docList[i]].ID+'\',\''+popAction+'\')}" class="expand" onMouseover="window.status=\''+linkDesc+'\'; return true;" onMouseOut="window.status=\'\'; return true;">'+icons[popAction+'_'+expand_ico]+'</a><img src="'+imgPath+'pix.gif" border="0" width="6" height="18" alt="" align="absmiddle">'
					}				}
				else
				{
				expand_end	=	''
				}
				// add to links list
				if (action == 'view') // for compability
				{
					if (linkString)
					{
						dbHeadings = dataList[0].split('\t')
						dbHeadings.addTo('href')
						dbHeadings.addTo('refClass')

						var headings = dbHeadings.length - 1
						var itemLinkString =	linkString
						for (var inte = 0 ; inte <= headings;inte++)
						{
							//var myTestStr	=	"\\$"+dbHeadings[inte]+"\\"
							var myTestStr	=	"<navObj:"+dbHeadings[inte]+"/>"
							
							var myPattern	=	new RegExp(myTestStr,"g")
							itemLinkString	=	itemLinkString.replace(myPattern, dataObj[docList[i]][dbHeadings[inte]]) + expand_end
						}
						if (useIndentString == 'allways')
						{
							linkList.addTo(indentString+itemLinkString)
						}
						else
						{
							linkList.addTo(itemLinkString)
						}
					}
					else
					{
						// edit this line as you please
						/*linkList.addTo(indentString+
						'<a href="#" onClick="javascript:
						{navBrain.openPage(\''+dataObj[docList[i]].ID+'\','+targetFrame+');}" 
						class="'+refClass+'" onMouseover="window.status=\''+linkDesc+'\'; return true;" 
						onMouseOut="window.status=\'\'; return true;">'+use_icon+fullName+'</a>
						'*/
						if (dataObj[docList[i]].pageType == 'produkt')
						{
							myHref =	'<tr><td class="indent"></td><td colspan="4" class="subRubrik"><a href="'+dataObj[docList[i]].href+'" class="prodLink">'+dataObj[docList[i]].fullName+'&nbsp;&nbsp;&nbsp;<img src="/images/linkarrow.gif" width="15" height="13" alt="" border="0" align="absmiddle"></a></td></tr>'
							myHref +=	(dataObj[docList[i]].linkDesc != 'none')	?	'<tr><td class="indent"></td><td class="right">Applikationer:</td><td class="indent2"></td><td class="right">'	+dataObj[docList[i]].linkDesc+	'</td></tr>'	:	''	;
							myHref +=	(dataObj[docList[i]].linkDesc2 != 'none')	?	'<tr><td class="indent"></td><td class="right">Media:</td><td class="indent2"></td><td class="right">'			+dataObj[docList[i]].linkDesc2+	'</td></tr>'	:	''	;
							myHref +=	(dataObj[docList[i]].linkDesc3 != 'none')	?	'<tr><td class="indent"></td><td class="right">Produktnamn:</td><td class="indent2"></td><td class="right">'		+dataObj[docList[i]].linkDesc3+	'</td></tr>'	:	''	;
							myHref +=	(level == 'matchList')						?	'<tr><td class="indent"></td><td class="right">Tillverkare:</td><td class="indent2"></td><td class="right">'+'<a href="'+dataObj[dataObj[docList[i]].parentId].href+'" class="dark">'+dataObj[dataObj[docList[i]].parentId].fullName+'</a></td></tr>'		:	''	;
							myHref += '<tr><td colspan="4" class="right">&nbsp;</td></tr>' 
						}
						else if (dataObj[docList[i]].pageType == 'personal')
						{
							myHref =	'<tr><td class="indent"></td><td colspan="4" class="subRubrik"><a href="'+dataObj[docList[i]].href+'" class="prodLink">'+dataObj[docList[i]].fullName+'&nbsp;&nbsp;&nbsp;<img src="/sys_images/mail_icon.gif" width="13" height="11" alt="" border="0" align="absmiddle"></a></td></tr>'
							myHref +=	(dataObj[docList[i]].linkDesc != 'none')	?	'<tr><td class="indent"></td><td class="right">Telefon:</td><td class="indent2"></td><td class="right">'	+dataObj[docList[i]].linkDesc+	'</td></tr>'	:	''	;
							myHref +=	(dataObj[docList[i]].linkDesc2 != 'none')	?	'<tr><td class="indent"></td><td class="right">Mobil:</td><td class="indent2"></td><td class="right">'			+dataObj[docList[i]].linkDesc2+	'</td></tr>'	:	''	;
							myHref +=	(dataObj[docList[i]].linkDesc3 != 'none')	?	'<tr><td class="indent"></td><td class="right">Fax:</td><td class="indent2"></td><td class="right">'		+dataObj[docList[i]].linkDesc3+	'</td></tr>'	:	''	;
							myHref += '<tr><td colspan="4" class="right">&nbsp;</td></tr>' 
						}
						else if (dataObj[docList[i]].pageType == 'dept')
						{
							myHref = '<tr><td colspan="2" class="subRubrik">'+dataObj[docList[i]].fullName+'</td>' 
							myHref +=	(dataObj[docList[i]].linkDesc != 'none')	?	'<td class="subRubrik" colspan="2">'	+dataObj[docList[i]].linkDesc+	'</td>'	:	'<td>&nbsp;</td><td>&nbsp;</td>'	;
							//myHref +=	(dataObj[docList[i]].linkDesc3 != 'none')	?	'<td class="right">Fax:</td><td class="right">'		+dataObj[docList[i]].linkDesc3+	'</td>'	:	'<td>&nbsp;</td>'	;
							myHref += '</tr>' 
						}
/*						else if (dataObj[docList[i]].pageType == 'location')
						{
							myHref = '<tr><td colspan="2" class="stdRubrik">'+dataObj[docList[i]].fullName+'</td>' 
							myHref +=	(dataObj[docList[i]].linkDesc != 'none')	?	'<td class="subRubrik" colspan="2">'	+dataObj[docList[i]].linkDesc+	'</td></tr>'	:	'<td>&nbsp;</td><td>&nbsp;</td></tr>'	;

							myHref +=	(dataObj[docList[i]].linkDesc2 != 'none')	?	'<tr><td class="indent"></td><td colspan="3" class="right">'	+dataObj[docList[i]].linkDesc2+	'</td></tr>'	:	''	;
							myHref +=	(dataObj[docList[i]].linkDesc3 != 'none')	?	'<tr><td class="indent"></td><td class="right">Fax:</td><td class="indent2"></td><td class="right">'		+dataObj[docList[i]].linkDesc3+	'</td></tr>'	:	''	;
							myHref += '<tr><td class="indent"></td><td colspan="3" class="right">&nbsp;</td></tr>' 
						}*/
						else
						{
							myHref = ''
							//myHref = '<tr><td colspan="4" class="stdRubrik">'+dataObj[docList[i]].fullName+'</td></tr>' 
							//myHref += '<tr><td colspan="4" class="right">&nbsp;</td></tr>' 
						}
						linkList.addTo(myHref)
						//)
					}
				}
			}
		}
	}
	//return links
	return(linkList.join(delimiter)+linkListEnd)
}
function setActive(input)
{
// kolla ev extrarader här !!!
	activePage	=	input
	while(input)
	{
		activePages[input]	=	true
		if (dataObj[input])
		{
			if (activePages[dataObj[input].parentId])
			{
				input = false
			}
			else if (dataObj[input].parentId)
			{
				input = dataObj[input].parentId
			}
			else
			{
				input = false
			}
		}
		else
		{
			input = false
		}
	}
	activate()
}
function activate()
{
	var	i = 0
	while(i < activePages.length)
	{
		//here you add any common tasks for all active pages
		i++
	}
}
function findChilds() // loop through all childs and return a complete list
{
	var input	=	findChilds.arguments[0]
	var level	=	findChilds.arguments[1]
	var count	=	0
	if (!level)
	{
		levelFind = new Array()
		allChildsList = new Array()
		levelCount = 0
	}
	for (count = 0; count < dataObj[input].childs.length ; count++)
	{
		if(count < dataObj[input].childs.length-1)
		{
			levelFind[levelCount] = 'y'
		}
		else
		{
			levelFind[levelCount] = 'n'
		}
		allChildsList.addTo(dataObj[input].childs[count]+'::'+levelCount+'::'+levelFind.join('\t'))
		if (dataObj[dataObj[input].childs[count]].childs) // dig deeper
		{
			if ((all_expanded =='yes')||(activePages[dataObj[input].childs[count]]))
			{
				levelCount++
				this.findChilds(dataObj[input].childs[count],levelCount)
			}
		}
	}
	levelCount--
	return allChildsList
}
function matchObj(matchCol,matchStr)
{
	matchList = new Array()
	for (count = 0; count < dataList.length ; count++)
	{
		if (dataObj[dataList[count].split('\t')[0]][matchCol] == matchStr)
		{
			matchList.addTo(dataList[count].split('\t')[0])
		}
	}
	matchList.sort(sortObjOnColum)
	return matchList
}
function matchObjInList(matchCol,matchStr)
{
	matchList = new Array()
	for (count = 0; count < this.length ; count++)
	{
		if (dataObj[this[count]][matchCol] == matchStr)
		{
			matchList.addTo(this[count])
		}
	}
	
	return matchList.sort(sortObjOnColum)
}

function sortObjOnColum(arg1,arg2)
{
	if (dataObj[arg1].fullName < dataObj[arg2].fullName)
	{return -1}
	if (dataObj[arg1].fullName > dataObj[arg2].fullName)
	{return 1}
	if (dataObj[arg1].fullName == dataObj[arg2].fullName)
	{return 0}
	
}

/// addon function for Arrays ///
function addToArray(input)
{
	this[this.length]	=	input
}
/// open Page ///
function openPage(ID,target)
{
	activePages	=	new Array()
	setActive(ID)
	setPopID = ID
	if (dataObj[ID].template == 'folder')
	{
		if (useFirstChildForFolders == 'yes')
		{
			openPage(dataObj[ID].childs[0])
		}
	}
	else
	{
		if (target)
		{
			if (target.location)
			{
				target.location = dataObj[ID].href
			}
		}
		else
		{
			defaultTargetFrame.location = dataObj[ID].href
		}
	}
	//writeViewMenu()
	//siteMap.innerHTML = 	writeLinks('top','view','allChilds')
}
/// pop Page ///
function popPage(ID,action)
{
	activePages	=	new Array();
	(action == 'close')	?
	setActive(dataObj[ID].parentId)	:
	setActive(ID)	;

//	writePopMenu('pop')
	siteMap.innerHTML = 	writeLinks('top','view','allChilds')
}
/// print menu ///
function writeViewMenu()
{
topMenu.document.open("text/html")
topMenu.document.write('\n\
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n\
	\n\
	<html>\n\
	<head>\n\
		<title> </title>\n\
		<link rel="stylesheet" type="text/css" href="'+webPath+'style.css">\n\
		<script language="JavaScript1.2" src="'+webPath+'pageScript.js" type="text/javascript">\n\
		</script>\n\
	</head>\n\
	\n\
<body background="images/top_bg.gif" bgcolor="#FFFFFF" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 link="#FFFFFF" vlink="#FFFFFF">\n\
<a href="/" target="_top"><img src="images/logo.gif" width="256" height="26" border="0" alt="" vspace="0"></a><span class="topText">PUMPAR – BLÅS-/VAKUUMAGGREGAT – SLAMUTRUSTNING</span>\n\
<div class="nav0" id="navDiv0"><table border="0" cellspacing="0" cellpadding="0">\n\
<tr>\n\
	<td><img src="images/white_pix.gif" width="1" height="20" border="0" alt=""></td>'+writeLinks('top','view','childs','<td><a class="nav0" href="<navObj:href/>" target="pumpContent">&nbsp;&nbsp;<navObj:fullName/>&nbsp;&nbsp;</a></td>', ' ')+'\n\
</tr>\n\
</table>\n\
</div>\n\
\n\
</body>\n\
</html>\n\
')
topMenu.document.close()
}
/*
'<body background="images/top_bg.gif" bgcolor="#FFFFFF" leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 link="#FFFFFF" vlink="#FFFFFF" onLoad="navInit()">\n\
<a href="/" target="_top"><img src="images/logo.gif" width="256" height="26" border="0" alt="" vspace="0"></a>\n\
<div class="nav0" id="navDiv0"><table border="0" cellspacing="0" cellpadding="0">\n\
<tr>\n\
	'+writeLinks('top','view','childs','<td><img src="images/white_pix.gif" width="1" height="20" border="0" alt=""></td><td><a class="nav0" href="<navObj:href/>" target="pumpContent">&nbsp;&nbsp;<navObj:fullName/>&nbsp;&nbsp;</a></td>')+'\n\
	<td><img src="white_pix.gif" width="1" height="20" border="0" alt=""></td>\n\
</tr>\n\
</table>\n\
</div>\n\
\n\
</body>\n\
</html>\n\'
*/
function doNothing()
{
	return false
}