/* GLOBAL VARS */
var objLastShown; // used for to switch off last shown div
var objFly;  // object to show - global because you can't pass objects with setTimeout

/* simple dom constructor */
function getRef(id) {
	return (document.getElementById ? document.getElementById(id) : document.all[id]);
}

/* initialize variables and objects */
function tsSideNavInit() {
	objLastShown = null;
	objLastShownBtn = null;
}

/* show the flyout and hide the old one
	- showing of the new flyout is on a timer */
function animateFlyout(id, btnObj) {

	objFly = getRef(id);
	objFlyBtn = btnObj;

	// turn off the last displayed div if exists
	if (objLastShown != null) {
		initFlyout();
	} else {
		showFlyout();
	}
	objLastShown = objFly; // div to hide on next pass
	objLastShownBtn = objFlyBtn; // div btn to hide on next pass

}

/* close the last shown flyout - set the timer for the new flyout*/
function initFlyout() {
	objLastShown.style.display = "none";
	objLastShownBtn.className = "ts-btn";
	//setTimeout("showFlyout()", 500);
	showFlyout();
}

/* show the flyout */
function showFlyout() {
	objFly.style.display = "block";
	objFlyBtn.className = "ts-btn-on";
}
//open rotation reminder
function open_reminder() {
	var newwin=window.open('/uniroyal/rotation/index.jsp','reminder',wnoscr+'width=460,height=550');
}
