// this code synchronises the left menu with the current page
// get file name of current page
var thisPath = document.URL;
thisDoc = thisPath.match(/[a-z0-9_]*\.php/);

// handle home page, whose URL may not show index.htm
if (!thisDoc) {
	thisDoc = 'index.php';
}

var leftNav = document.getElementById("left_menu");
// get all <a> tags in the left_menu div
var navLinks = leftNav.getElementsByTagName("a");
// look for a link that is same as this page
var foundLink = false;
for (var iA=0; iA < navLinks.length; iA++) {
	// next line needed because IE returns full path!
	thisLink = navLinks[iA].getAttribute("href").match(/[a-z0-9_]*\.php/);
	// handle a tags that do not contain a HTML file name
	if (!thisLink) { continue; }
	// look for match with href
	if (thisLink[0] == thisDoc) {
		// if matched, then set the class of the link to "current"
		Element.addClassName(navLinks[iA], "current");
		// determine parent tab so that we can open it later
		var currentTab = navLinks[iA].parentNode;
		foundLink = true;
		break;
	}
}
// currentTabID holds the div id of the tab that we want expanded
var currentTabID = 0;
if (foundLink) {
	currentTabID = currentTab.getAttribute("id");
}

Rico.loadModule('Accordion');

Rico.onLoad( function() {
	new Rico.Accordion( $$('div.panel-header'), $$('div.panel-content'), {panelHeight:320, hoverClass: 'panel-hover', selectedClass: 'panel-selected', selectedIndex: currentTabID});
});

/*var roundCorners = Rico.Corner.round.bind(Rico.Corner);
roundCorners('header', {corners:"bottom"});
roundCorners('menu_container');
roundCorners('main_content');
roundCorners('footer');*/

var border = RUZEE.ShadedBorder.create({ corner:8, shadow:18,  border:0 });
border.render('header');
border.render('menu_container');
border.render('main_content');
border.render('footer');



