// <!--

var f=getFileName(window.location.href.toLowerCase());

window.onload = function(){
	var s=getLinkIdNo(f);

	setClassName('h'+s,'sideNavListSelected');	// set the list item disc 

	s=s.substring(0,2)
	var c='t'+(eval(s)+1).toString();
	s=s+'00';

	setSubMenu('k'+s,'block');
	
	setClassName('f'+s,c);		 // set the top nav bar color
	
	setClassName('h'+s,'sideNavHeaderDefault');// set the header item to 
   
	toggleSign('j'+s);	 // set the +/- sign
//	alert('navigator.userAgent="'+navigator.userAgent+'"')	
	if(navigator.userAgent.indexOf('Firefox')!=-1 || navigator.userAgent.indexOf('MSIE 8.')!=-1){addFloat();}
}		

function addFloat(){
   var o=document.getElementById('h0000');if(o!=null){o.className='sideNavHeaderFox';}
   o=document.getElementById('h0100');if(o!=null){o.className='sideNavHeaderFox';}
   o=document.getElementById('h0200');if(o!=null){o.className='sideNavHeaderFox';}
   o=document.getElementById('h0300');if(o!=null){o.className='sideNavHeaderFox';}
}
function setClassName(id,cn){
    if(document.getElementById(id)!=null) {document.getElementById(id).className=cn;}
   // else {alert('id='+id+ ' was null while triing to set '+cn);}
}

// set the top navigational colors
// do not change the color if it is the parent of the current page
function setColor(id,b) {setClassName('f'+id.substring(1),b);}

// return the file name with no .htm
//.search('.aspx') for home page i.e. http://www.domain.com/
function getFileName(x){
    if(x.search('.aspx')<=0) {return 'index.aspx';}
	return x.substring(x.lastIndexOf('/')+1);
	
} 


function setli(o,t){
	if(o!=null) {
        if(o.className=='sideNavListSelected'){return;}
        if(t=='over'){o.className='sideNavListOver';}
		else {o.className='sideNavList';}
	}
	return;
}	

// functions toggleSign,unToggleSign, and setSign are for the +/- bitmaps used on the accordian menu
function toggleSign(s){
    var o=document.getElementById('j'+s.substring(1));
	if(o!=null){
	    // may have selected a new link so turn all items with class name expanders to '+'
	    var snh=document.getElementsByName('expander');
	    for (var i=0;i<snh.length;i++){
	  		if(o.id==snh[i].id && o.alt=='+'){
	  		    setSign(snh[i].id,'-');
	  		    setSubMenu('k'+snh[i].id.substring(1),'block');
	  		}else {
	  		    setSign(snh[i].id,'+');
	  		    setSubMenu('k'+snh[i].id.substring(1),'none');
	  		}
	    }
	} //else {alert('error: toggleSign no id with j'+s.substring(1));}
}

// for double clicks
// prevents the signs from getting stuck in the wrong position.
// can still get stuck because of accordian effects (timer), 
// but unlikey unless the person is trying to get it stuck.
function unToggleSign(s){
	if(document.getElementById(s)!=null){
	    var o=document.getElementById(s);
	    if (o.alt=='-'){o.alt='-';o.src='http://'+ window.location.host+'/img/bmp/minus.bmp';}
	  	else {o.alt='+';o.src='http://'+ window.location.host+'/img/bmp/plus.bmp';}
	}// else {alert('error: unToggleSign no id with '+s);}
} 

function setSign(s,i){
    if(document.getElementById(s)!=null){
	    var o=document.getElementById(s);
		if(o.alt=='-' && i=='-') {return;}
		if(o.alt=='+' && i=='+') {return;}
		
		if(o.alt=='-'){o.src='http://'+ window.location.host+'/img/bmp/plus.bmp';}
		else {o.src='http://'+ window.location.host+'/img/bmp/minus.bmp';}
		
		o.alt=i;
	}
		
    return
}

function setSubMenu(s,i){
	if(document.getElementById(s)!=null){
		var o=document.getElementById(s);
		if(o.style.display==i){return;}
		
		o.style.display=i;
		return;
	}
	//alert('error: setSubMenu no id with '+s);
 }

var aFiles =[
['index.aspx',						'00','01'],
['software.aspx',					'00','02'],
['sample-editor.aspx',				'00','03'],
['faq.aspx',						'00','04'],
['site-map.aspx',					'00','05'],
['logon.aspx',						'00','06'],
['online-tools.aspx',				'01','01'],
['break-even-calculator.aspx',		'01','02'],
['start-up-calculator.aspx',		'01','03'],
['loan-calculator.aspx',			'01','04'],
['cash-requirements.aspx',			'01','05'],
['sample.aspx',						'02','01'],
['outline.aspx',					'02','02'],
['sample-graph.aspx',				'02','03'],
['sample-reports-formatting.aspx',	'02','04'],
['consultant.aspx',					'03','01'],
['contact.aspx',					'03','02']];

function getLinkIdNo(f){
   var linkId = '0001';
   for (var i=0;i<aFiles.length;i++){
	    if(f==aFiles[i][0]){linkId=aFiles[i][1]+aFiles[i][2];break;}
	}
	return linkId;
}


-->
