// http://www.mootools.net/download
// mootools requirements for accordion and slimbox
// core
// class - all
// native - all
// element - event, filters, selectors
// window - all
// effects - base, css, style, styles, elements, transitions
// accordion

window.addEvent('domready', function() {
	var options = {opacity: false};
	
	if(gCurrentDoc >= 0){
		options.show = gCurrentDoc;
		options.initialDisplayFx = false;
	}else{
		options.display = -1;
	}
	
	//console.log('gCurrentDoc=',gCurrentDoc,options);
	
	var productsAccordion = new Accordion($$('ul#products li h3.parent'), $$('ul#products li ul.inner'),
				options
			);
	//console.log('gCurrentDoc',gCurrentDoc);
	//productsAccordion.display(gCurrentDoc);	
});

function getCurrentDoc(str){
	var currentDoc = $('childDoc' + str);var r;
	if (currentDoc) {
		r = currentDoc.getParent();
	}else{
		r = false;
	}
	return r;
}
 
function getCurrentDocIndex(str){
	if(!str)return -1;
	var currentDoc = $('childDoc' + str);
	if(!currentDoc) return -1;
	var r = -1;
	var currentParent = currentDoc.getParent();
	
	// get all nav level 2 ULs
	
	var navULs = $('products').getElements('ul.inner');
	if(navULs){
		//console.log('navULs',navULs);
		
		r = navULs.indexOf(currentParent);
	}
	
	return r;
	
} 
 
 
