<?php define('BASE_PATH', dirname(__FILE__)); ?>
<?php //define( 'BASE_PATH', $_SERVER['DOCUMENT_ROOT'] ); ?>

<?php set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH .'/libs/phpseclib'); ?>
<?php include "page.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php require_once("header.php"); ?>
<body>
<noscript>
    <style type="text/css">
        .pagecontainer {display:none;}
    </style>
    <div class="noscriptmsg" style="text-align:center; margin: 10% auto; font-size:16px;"><p>You don't have JavaScript Enabled.</p><p>To use this application you must enable JavaScript.</p></div>
</noscript>
<!--MOTW  Start Google Analytics Code -->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 
  ga('create', 'UA-5756425-4', 'microcooltool.com');
  ga('send', 'pageview');
 
</script>
<!--MOTW  End Google Analytics Code -->
<script type="text/javascript">
$(document).ready(function() {
	
	var parentBody = window.parent.document.body;
	if(typeof $("#event-frame", parentBody) != "undefined") {
			$("#event-frame", parentBody).height($("#event-frame", parentBody).contents().find("html").height());
	}
})
 </script>

<?php if( $user->signed ) { ?>
<script type="text/javascript">
$(document).ready(function() {
	
	var parentBody = window.parent.document.body;
	if(typeof $("#event-frame", parentBody) != "undefined") {
			$("#event-frame", parentBody).height($("#event-frame", parentBody).contents().find("html").height());
	}
	
	
	
	
	
	$.idleTimeout('#idletimeout', '#idletimeout a', {
	idleAfter: 10*60,
	pollingInterval: 2*60,
	keepAliveURL: 'libs/cooltool/ps/keepalive.php',
	serverResponseEquals: 'OK',
	onTimeout: function(){
		$(this).slideUp();
		window.location = "libs/uam/ps/logout.php";
	},
	onIdle: function(){
		$(this).slideDown(); // show the warning bar
	},
	onCountdown: function( counter ){
		$(this).find("span").html( counter ); // update the counter
	},
	onResume: function(){
		$(this).slideUp(); // hide the warning bar
	}
  });
  
  // function to lock the eC2 instance if not already locked
	function lockEc2Instance() {
		
		$.ajax({
        		type: "POST",
        		url : 'libs/cooltool/ps/runEc2Instance.php',
        		async: true,  
				dataType: 'json',
        		success: function(data){
            		
        	}
    		});
		
		
		
	}
  
 
  lockEc2Instance();
  
});

</script>
 <?php  }?>

 <!--[if lte IE 7]>
 <script type="text/javascript">
$(document).ready(function() {
	
	var parentBody = window.parent.document.body;
	if(typeof $("#event-frame", parentBody) != "undefined") {
			$("#event-frame", parentBody).css("min-height",650);
	}
})
 </script>
 <style>
ul.nav a.iefix {
	line-height:normal !important;	
}
</style> 
<![endif]-->


<script>
if(!$.support.hrefNormalized) {
    //var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf("/") + 1);
	//var url = $(this).attr("href").replace(baseUrl, "");
	//alert(baseUrl);
	//alert(url);
}
</script>




<!--<div class="pagecontainer">-->
<div id="idletimeout">
	You will be logged off in <span><!-- countdown place holder --></span>&nbsp;seconds due to inactivity. 
	<a id="idletimeout-resume" href="#">Click here to continue using this web page</a>.
</div>

	<!--<div id="container">-->
    	<?php //include "top-nav.php"; ?>
  		<!--<div id="main">-->
        	<?php //include "banner.php"; ?>
             <!--<div id="content">-->
      			<div class="left">
       				<hr  class="breakblue" />
                    <?php include "sidebar.php"; ?>
                    
                    	<div class="main_display">
                        
                        	<?php if( $user->signed ) { ?> 
								
							<?php }?>
                        
                        	 <?php include $page_inc; ?>
                    	</div><!-- End main_display-->
                </div><!-- End left -->
                <div id="right"><div id="clearbox"></div></div><!-- end #right -->
             <!--</div>--><!-- End content -->
        <!--</div>--><!-- End main -->
   <!--</div>--><!-- End container -->
   <?php //include "footer.php"; ?>
   
   <!-- dialog window markup -->
   
<!--</div>  --><!-- End pagecontainer --> 
</body>

</html>