var navDropTime;

function accordionTree(idPrefix,quickSwitch){
		
	/*set instance variables*/
	this.idPrefix = idPrefix;
	this.quickSwitch = quickSwitch;
	this.lastExpanded = 0;
	this.lastExpandedRoot = 0;
	this.toggled = false;
	
	this.topOpen = false;
	
	this.toggleBlind = function(toggledID,isRoot,thisRoot,afterEval,quickSwitch){
	
		/*PUT SECOND IF HERE JUST TO BLIND UP IF ROOT AND WASN"T LAST ROOOOOOT!*/
		if(isRoot && this.lastExpandedRoot != toggledID){
			try{
				new Effect.BlindUp(this.idPrefix + this.lastExpandedRoot,{ duration: 0.25, queue: { position: 'end', scope: 'navQue' } });
			}
			catch(e){
			}
		}
		
		
		if(isRoot && toggledID != this.lastExpanded){
			/*since one isn't open by default...*/
			try{
				this.toggled = true;
				new Effect.BlindUp(this.idPrefix + this.lastExpanded,{ duration: 0.25, beforeStart : eval(afterEval),queue: { position: 'end', scope: 'navQue' } });
				/*sometimes both conditions are met, so we set this so we don't BlindUp again this time*/
			}
			catch(e){
			}
		}			
		
		/*if they open a new root, close current root and all of its children*/
		if(isRoot && this.lastExpandedRoot != toggledID && this.toggled==false){
			try{
				this.toggled = true;
				new Effect.BlindUp(this.idPrefix + this.lastExpandedRoot,{ duration: 0.25, beforeStart : eval(afterEval),queue: { position: 'end', scope: 'navQue' } });
			}
			catch(e){
			}
			
		}
		
		if(isRoot == false && this.lastExpandedRoot != thisRoot && this.toggled==false){
			try{alert("4");
				this.toggled = true;
				new Effect.BlindUp(this.idPrefix + this.lastExpandedRoot,{ duration: 0.25, beforeStart : eval(afterEval),queue: { position: 'end', scope: 'navQue' } });
			}
			catch(e){
			}
		}
				
		if(this.toggled == false && (typeof(afterEval) != "undefined" && afterEval!=null)){
			eval(afterEval);
		}
		
		/*if you remove this from the que, it looks much nicer, however if they get click happy they can break it. would be nice if we could do it this way
		without them breaking it*/
		
		/*i ended up giving it its own que, its much more stable now, although if someone clicks like a total mad man they can SOMETIMES break it. we'll leave it
		like this more now and when time permits do some tinkering to make it invincible*/
		if(this.quickSwitch == true){
			new Effect.BlindDown(this.idPrefix + toggledID,{ duration: 0.25, queue: { position: 'end', scope: 'navQuickQue' } });
		}
		else{
			new Effect.BlindDown(this.idPrefix + toggledID,{ duration: 0.25, queue: { position: 'end', scope: 'navQue' } });
		}
		
		
		if(isRoot){
			this.lastExpandedRoot = toggledID;
		}
		
		this.lastExpanded = toggledID;
		this.toggled = false;
	
	}
		
	this.mouseOutTop = function(toggledID){	
		/*the pageChildren div will call a clearTimeout if it's selected*/
		tID = toggledID;
		pref = this.idPrefix;
		
		if ( typeof(document.getElementById(pref + tID)) != "undefined" && document.getElementById(pref + tID) !=null ) {
			navDropTime = setTimeout('Effect.BlindUp(pref + tID,{ duration: 0.25 , queue: { position: "end", scope: "navQue" } })',300);
		}
	}
	
}