var ie=document.all,ne=document.layers,foldercolor,txtcolor,imgclick="",tcursor="root",folderborder="",flag=0,abc="",rock=0

linkwidth="141"
function start()
{
	rock=0
	if(!ie && !ne){ie=true;nc6=true}
	else{nc6=false}
	if(nc6){linkwidth="161"}
	loadData();
	drawTree();
	readcookie();
	rock=1
}
function start1(page)
{
	rock=0
	if(!ie && !ne){ie=true;nc6=true}
	else{nc6=false}
	if(nc6){linkwidth="161"}
	loadData();
	readcookie();
	toggleFirst(page)
	flag=0
	rock=1
}
function toggleFirst(page1)
{
	flag=1
	toggleFolder(page1,'1');
}
function refresh()
{
	loadData();
	drawTree();
	open('infosolutions.htm','pageframe');
	open('infosolutionstop.htm','top1');
}


function drawTree(objk)
{
	drawBranch("root","",objk);
	treeframe.window.document.getElementById("poora").innerHTML=abc
	treeframe.window.document.alinkColor=aLinkColor
	treeframe.window.document.vlinkColor=vLinkColor
	treeframe.window.document.bgColor=backgroundColor
	if(objk){treeframe.window.document.getElementById(objk).style.color="#FFFFFF";}
	abc=""
	window.status="Infobahn Menu";
}


function drawBranch(startNode,structureString,objd)
{
	imgclick="";
	var children = extractChildrenOf(startNode);
	var currentIndex = 1,temp;
	while (currentIndex <= children.length)
	{
		abc=abc+structureString
		if (children[currentIndex].type == 'link')
		{
			var imageString = defaultImageURL
			if (children[currentIndex].target == ""){var targetFrame = defaultTargetFrame;}
			else{var targetFrame = children[currentIndex].target}
			if (currentIndex != children.length){abc=abc+"<IMG SRC='"+ defaultImageURL +"infofinance1.gif' WIDTH=9 HEIGHT=18 hspace=0 vspace=0 ALIGN=LEFT style='margin:0;padding:0'>"}
			else{abc=abc+"<IMG SRC='"+ defaultImageURL +"infofinance3.gif' WIDTH=9 HEIGHT=18 hspace=0 vspace=0 ALIGN=LEFT style='margin:0;padding:0'>"}

			if(objd)
			{
				if(objd==children[currentIndex].name)
				{
					abc=abc+"<DIV hspace=0 vspace=0 style='padding:0;margin-bottom:3;margin-top:0;margin-left:0;margin-right:0;BORDER:"+folderborder+"px outset;WIDTH:"+linkwidth+";HEIGHT:13;BACKGROUND-COLOR:"+ linkbackcolor +"' ALIGN=LEFT><font color="+linkColor+" size='6pt'><A id='"+ children[currentIndex].name +"' style='text-decoration:none;font-size:6pt;color:"+linkColor+"' HREF='"+ children[currentIndex].url +"' TARGET='"+ targetFrame +"'>&nbsp;"+ children[currentIndex].name +"</A></FONT></DIV>"
				}
				else
				{
//					if(ie)
					{abc=abc+"<DIV hspace=0 vspace=0 style='padding:0;margin-bottom:3;margin-top:0;margin-left:0;margin-right:0;BORDER:"+folderborder+"px outset;WIDTH:"+linkwidth+";HEIGHT:13;BACKGROUND-COLOR:"+ linkbackcolor +"' ALIGN=LEFT><font color="+linkColor+" size='6pt'><A id='"+ children[currentIndex].name +"' style='text-decoration:none;font-size:6pt;color:"+linkColor+"' HREF='"+ children[currentIndex].url +"' onmouseover=change(this,'"+hovercolor+"') onmouseout=changeback(this,'"+linkColor+"') onmousedown=changeactive('"+linkColor+"') TARGET='"+ targetFrame +"'>&nbsp;"+ children[currentIndex].name +"</A></FONT></DIV>"}
				}
			}
			else
			{
//				if(ie)
				{abc=abc+"<DIV hspace=0 vspace=0 style='padding:0;margin-bottom:3;margin-top:0;margin-left:0;margin-right:0;BORDER:"+folderborder+"px outset;WIDTH:"+linkwidth+";HEIGHT:13;BACKGROUND-COLOR:"+ linkbackcolor +"' ALIGN=LEFT><font color="+linkColor+" size='6pt'><A id='"+ children[currentIndex].name +"' style='text-decoration:none;font-size:6pt;color:"+linkColor+"' HREF='"+ children[currentIndex].url +"' onmouseover=change(this,'"+hovercolor+"') onmouseout=changeback(this,'"+linkColor+"') onmousedown=changeactive('"+linkColor+"') TARGET='"+ targetFrame +"'>&nbsp;"+ children[currentIndex].name +"</A></FONT></DIV>"}
			}
		}
		else
		{
			if(children[currentIndex].parent=='root')
			{
				foldercolor=levelonefolderbackcolor;
				txtcolor=levelonefoldertext;
				imgclick="";
				cellwidth=159
				if(nc6){cellwidth=161}
			}
			else
			{
				foldercolor=leveltwofolderbackcolor;
				txtcolor=leveltwofoldertext;
				cellwidth=150
				if(nc6){cellwidth=161}
			}

			var newStructure = structureString;
			if (currentIndex != children.length)
			{
				if (children[currentIndex].open == 0)
				{
//					if(ie)
					{
						if(children[currentIndex].current==1)
						{
							if(children[currentIndex].parent=='root')
							{
								imgclick="";
								changelevel1color(children[currentIndex])
								foldercolor=levelonefoldercolor;
							}
							else{imgclick="<IMG SRC='"+ defaultImageURL +""+arrow+"' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=16 ALT='Click to open this folder' BORDER=0 ALIGN=LEFT>"}
						}
						else
						{
							if(children[currentIndex].parent=='root'){imgclick=""}
							else{imgclick="<IMG SRC='"+ defaultImageURL +"img-blank.gif' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=16 ALT='Click to open this folder' BORDER=0 ALIGN=LEFT>"}
						}
						abc=abc+"<IMG SRC='"+ defaultImageURL +"infofinance1.gif' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=18 ALT='Click to open this folder' BORDER=0 ALIGN=LEFT style='margin:0;padding:0'><DIV hspace=0 vspace=0 style='padding:0;margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;BORDER:"+folderborder+"px outset;WIDTH:"+cellwidth+";HEIGHT:18;font-size:10px;BACKGROUND-COLOR:"+foldercolor+"' align=left>" + imgclick + "&nbsp;<A style='color:"+txtcolor+";font-size:10px' HREF=\"javascript:top.toggleFolder('"+ children[currentIndex].id +"',1)\" onMouseOver=\"window.status='Click to open this folder'; return true\">"
						abc=abc+"" + children[currentIndex].name + "</A></DIV>"
						imgclick="";	
					}
				}
				else
				{
//					if(ie)
					{
						if(children[currentIndex].parent=='root')
						{
							imgclick="";
							changelevel1color(children[currentIndex])
							foldercolor=levelonefoldercolor;
						}
						else{imgclick="<IMG SRC='"+ defaultImageURL +""+arrow+"' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=16 ALT='Click to open this folder' BORDER=0 ALIGN=LEFT>"}
						abc=abc+"<div><IMG SRC='" + defaultImageURL + "infofinance1.gif' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=18 ALT='Click to close this folder' ALIGN=LEFT BORDER=0 style='margin:0;padding:0'></div><DIV hspace=0 vspace=0 style='padding:0;margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;BORDER:"+folderborder+"px outset;WIDTH:"+cellwidth+";font-size:10px;HEIGHT:18;BACKGROUND-COLOR:"+ foldercolor+"' ALIGN=LEFT>" +imgclick +"&nbsp;<A  style='color:"+txtcolor+";font-size:10px' HREF=\"javascript:top.toggleFolder('"+ children[currentIndex].id +"',0)\" onMouseOver=\"window.status='Click to close this folder'; return true\">"
						abc=abc+""+ children[currentIndex].name +"</A></DIV>"
						imgclick="";
					}
					newStructure = newStructure + "<IMG SRC='"+ defaultImageURL +"infofinance2.gif' hspace=0 vspace=0 WIDTH=9 HEIGHT=18 ALIGN=LEFT>";
					drawBranch(children[currentIndex].id,newStructure,objd);
				}
			}
			else
			{
			if (children[currentIndex].open == 0)
			{
//				if(ie)
				{
					if(children[currentIndex].current==1)
					{
						if(children[currentIndex].parent=='root')
						{
							imgclick="";
							changelevel1color(children[currentIndex])
							foldercolor=levelonefoldercolor;
						}
						else{imgclick="<div><IMG SRC='"+ defaultImageURL +""+arrow+"' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=16 ALT='Click to open this folder' BORDER=0 ALIGN=LEFT></div>"}
					}
					else
					{
						if(children[currentIndex].parent=='root'){imgclick=""}
						else{imgclick="<div><IMG SRC='"+ defaultImageURL +"img-blank.gif' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=16 ALT='Click to open this folder' BORDER=0 ALIGN=LEFT></div>"}
					}
					abc=abc+"<div><IMG SRC='"+ defaultImageURL +"infofinance3.gif' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=18 ALT='Click to open this folder' ALIGN=LEFT BORDER=0 style='margin:0;padding:0'></div><DIV hspace=0 vspace=0 style='padding:0;margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;BORDER:"+folderborder+"px outset;WIDTH:"+cellwidth+";HEIGHT:18;font-size:10px;BACKGROUND-COLOR:"+ foldercolor+"' ALIGN=LEFT>"+ imgclick +"&nbsp;<A style='color:"+txtcolor+";font-size:10px' HREF=\"javascript:top.toggleFolder('"+ children[currentIndex].id +"',1)\" onMouseOver=\"window.status='Click to open this folder';return true\">"
					abc=abc+""+ children[currentIndex].name +"</A></DIV>"
				}
			}
			else
			{
//				if(ie)
				{
					if(children[currentIndex].parent=='root')
					{
						imgclick="";
						changelevel1color(children[currentIndex])
						foldercolor=levelonefoldercolor;
					}
					else
					{
						imgclick="<div><IMG SRC='"+ defaultImageURL +""+arrow+"' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=16 ALT='Click to open this folder' BORDER=0 ALIGN=LEFT></div>"
					}
					abc=abc+"<div><IMG SRC='"+ defaultImageURL +"infofinance3.gif' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=18 ALT='Click to close this folder' ALIGN=LEFT BORDER=0 style='margin:0;padding:0'></div><DIV hspace=0 vspace=0 style='padding:0;margin-bottom:0;margin-top:0;margin-left:0;margin-right:0;BORDER:"+folderborder+"px outset;WIDTH:"+cellwidth+";HEIGHT:18;font-size:10px;BACKGROUND-COLOR:"+ foldercolor+"' ALIGN=LEFT>"+ imgclick +"&nbsp;<A style='color:"+txtcolor+";font-size:10px' HREF=\"javascript:top.toggleFolder('"+ children[currentIndex].id +"',0)\" onMouseOver=\"window.status='Click to close this folder';return true\">"
					abc=abc+""+ children[currentIndex].name +"</A></DIV>"	
					imgclick="";
				}
				newStructure = newStructure + "<IMG SRC='"+ defaultImageURL +"img-blank.gif' hspace=0 vspace=0 style='margin:0' WIDTH=9 HEIGHT=18 ALIGN=LEFT>";
				drawBranch(children[currentIndex].id,newStructure,objd);
			}
		}
	}
	currentIndex++;
	}
}
function setcookie(curid,hours)
{
var tcursor=curid;
var tcookie="wm_javascript=cursor:"+escape(tcursor);

if ((typeof(hours) == 'string') && Date.parse(hours)) 
	{var numHours = hours;}
else if(typeof(hours) == 'number') 
	{var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString();}
var tcookie= tcookie + ";expires=" + numHours;
document.cookie =tcookie;
}
function readcookie()
{
try
{
var tcookie=wm_readcookie("wm_javascript");
if(tcookie==false){tcursor='';return false}
var brokencookie = tcookie.split(":");
var tcursorpart = brokencookie[1];
var brokencursor=tcursorpart.split(";");
tcursor = brokencursor[0];
}
catch(error){}
}
function wm_readcookie(cursor)
{
	if(document.cookie == ''){return false}
	else{return unescape(wmgetcookievalue(cursor))}
}
function wmgetcookievalue(cursor)
{
var firstchar, lastchar;
var tbigcookie = document.cookie;
firstchar = tbigcookie.indexOf(cursor);
if(firstchar != -1)
{
	firstchar += cursor.length + 1;
	lastchar = tbigcookie.indexOf(';',firstchar);
	if(lastchar == -1){ lastchar = tbigcookie.length; }
	return tbigcookie.substring(firstchar, lastchar);
}
else{ return false;}
}
function indexOfNode(id) 
{
	var currentIndex = 1;
	while (currentIndex <= treeData.length) {
		if ((treeData[currentIndex].type == 'root') || (treeData[currentIndex].type == 'folder')){
			if (treeData[currentIndex].id == id) {return currentIndex}}
		currentIndex++}
	return -1;
}
function extractChildrenOf(node) 
{
	var children = new Collection();
	var currentIndex = 1;
	while (currentIndex <= treeData.length)
	{
		if ((treeData[currentIndex].type == 'folder') || (treeData[currentIndex].type == 'link')) 
		{
			if (treeData[currentIndex].parent == node)
			{
				children.add(treeData[currentIndex])
			}
		}
			currentIndex++
	} 
	return children
}
function Collection() 
{
	this.length = 0;
	this.add = add;
	return this
}
function add(object) 
{
	this.length++; 
	this[this.length] = object
}
function RootNode(id,name,url,target,icon) 
{
	this.id = id;
	this.name = name;
	this.url = url;
	this.target = target;
	this.icon = icon;
	this.type = 'root';
	return this
}
function FolderNode(id,parent,name,iconClosed,iconOpen) 
{
	this.id = id;
	this.parent = parent;
	this.name = name;
	this.iconClosed = iconClosed;
	this.iconOpen = iconOpen;
	this.type = 'folder';
	this.open = 0;
	this.current=0;
	return this
}
function LinkNode(parent,name,url,target,icon) 
{
	this.parent = parent;
	this.name = name;
	this.url = url;
	this.target = target;
	this.icon = icon;
	this.type = 'link';
	return this
}