<!DOCTYPE html>
<?js var that = this; ?>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title><?js= this.navOptions.systemName ?> <?js= title ?></title>
	
  <script src="scripts/prettify/prettify.js"> </script>
  <script src="scripts/prettify/lang-css.js"> </script>
	<!--[if lt IE 9]>
	<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
	<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
	<link rel="shortcut icon" href="../img/favicon.ico" type="image/x-icon">

	<?js if (this.navOptions.theme === "darkstrap"){ ?>
	<link type="text/css" rel="stylesheet" href="styles/site.cyborg.css">
	<link type="text/css" rel="stylesheet" href="styles/darkstrap.css">
	<?js } else { ?>
	<link type="text/css" rel="stylesheet" href="styles/site.<?js= this.navOptions.theme ?>.css">
	<?js } ?>
</head>

<body>
<div class="container-fluid">
	<div class="navbar navbar-fixed-top <?js= this.navOptions.inverseNav ? 'navbar-inverse' : '' ?>">
		<div class="navbar-inner">
			<a class="brand" href="<?js= this.nav.index.link ?>"><?js= this.nav.index.title ?></a>
			<ul class="nav">
				<?js this.nav.topLevelNav.forEach(function(entry){ ?>
				<li class="dropdown">
					<a href="<?js= entry.link ?>" class="dropdown-toggle" data-toggle="dropdown"><?js= entry.title ?><b
						class="caret"></b></a>

					<ul class="dropdown-menu <?js= that.navOptions.navType ==='inline' ? 'inline' : '' ?>">
						<?js entry.members.forEach(function(member){ ?>
						<li>
							<?js= member ?>
						</li>
						<?js	}); ?>

					</ul>
				</li>
				<?js }); ?>
			</ul>
		</div>
	</div>

	<div class="row-fluid">

		<?js if(docs && docs[0].kind !== "source"){ ?>
		<div class="span8">
			<?js }else{ ?>
			<div class="span12">
				<?js } ?>
				<div id="main">
					<?js= content ?>
				</div>

				<div class="clearfix"></div>
				<footer>
					<?js if (that.navOptions.footer.length > 0){ ?>
					<?js= that.navOptions.footer ?>
					<br />
					<?js } ?>
					<?js if (that.navOptions.copyright.length > 0){ ?>
		<span class="copyright">
		<?js= that.navOptions.copyright ?>
		</span>
					<br />
					<?js } ?>
		<span class="jsdoc-message">
		Documentation generated by <a href="https://github.com/jsdoc3/jsdoc" target="_blank">JSDoc <?js= env.version.number ?></a>
		using a customized version of the <a href="https://github.com/terryweiss/docstrap" target="_blank">DocStrap template</a>.
		</span>
				</footer>
			</div>

			<?js if(docs && docs[0].kind !== "source"){ ?>
			<div class="span3">
				<div id="toc"></div>
			</div>
			<?js } ?>
			<br clear="both">
		</div>

	</div>
	<script src="scripts/sunlight.js"></script>
	<script src="scripts/sunlight.javascript.js"></script>
	<script src="scripts/sunlight-plugin.doclinks.js"></script>
	<script src="scripts/sunlight-plugin.linenumbers.js"></script>
	<script src="scripts/sunlight-plugin.menu.js"></script>
	<script src="scripts/jquery.min.js"></script>
	<script src="scripts/jquery.scrollTo.js"></script>
	<script src="scripts/jquery.localScroll.js"></script>
	<script src="scripts/bootstrap-dropdown.js"></script>
	<script src="scripts/toc.js"></script>

	<script> prettyPrint(); </script>
	<script>  Sunlight.highlightAll({lineNumbers:<?js= this.navOptions.linenums ?>,  showMenu: true, enableDoclinks :true}); </script>

	<script>
		function openDeeplinkedElement (skipAni) {
			try {
				$("dt h4.member-collapsed").filter(window.location.hash.substring(1).replace(":", "\\:")).trigger("click", skipAni);
			} catch (e) {
				console.warn("ah ah ah! :p");
			}
		}
		$( function () {
			$( "#toc" ).toc( {
			    anchorName  : function(i, heading, prefix) {
					return $(heading).attr("id") || ( prefix + i );
				},
				selectors   : "h1:visible,h2:visible,h3:visible,h4:visible",
				onScrollFinish : openDeeplinkedElement,
				highlightOffset : 10,
				scrollOffset: 60
			} );
			$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
			$( "#main span[id^='toc']" ).addClass( "toc-shim" );

		} );
	</script>

	<?js if (this.navOptions.collapseSymbols) { ?>
	<script>
		$( function () {
			// $('#main').localScroll({
			// 	offset: { top: 56 } //offset by the height of your header (give or take a few px, see what works for you)
			// });
			// workaround for anchors below header...
			window.setTimeout(function () {
				$(document).scrollTop($(document).scrollTop()-60);
			}, 1)
			
			var hash = window.location.hash.substring(1).replace(":", "\\:");
			$( "dt h4.name" ).each( function () {
				var $this = $( this );
				var icon = $( "<i/>" ).addClass( "icon-plus-sign" ).addClass( "pull-right" ).addClass( "icon-white" );
				var dt = $this.parents( "dt" );
				var children = dt.next( "dd" );

				$this.append( icon ).css( {cursor : "pointer"} );
				$this.addClass( "member-collapsed" ).addClass( "member" );
				if (hash != $this.attr("id")) {
					children.hide();
				}
				$this.toggle( function (e, skipAni) {
					var scrollPos = $(document).scrollTop();
					window.location.hash = $(this).attr("id");
					$(document).scrollTop(scrollPos);
					icon.addClass( "icon-minus-sign" ).removeClass( "icon-plus-sign" ).removeClass( "icon-white" );
					$this.addClass( "member-open" ).removeClass( "member-collapsed" );
					children.slideDown(skipAni ? 0 : undefined);
				}, function () {
					icon.addClass( "icon-plus-sign" ).removeClass( "icon-minus-sign" ).addClass( "icon-white" );
					$this.addClass( "member-collapsed" ).removeClass( "member-open" );
					children.slideUp();
				} );
			} );
			// open if deeplinked
			if (hash.length > 0)
				openDeeplinkedElement(true);
		} );
	</script>
	<?js } ?>

	<script type="text/javascript" src="../js/tracking.js"></script>
</body>
</html>
