<html xmlns="http://www.w3.org/1999/xhtml">

<head>

  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  <title>Kautilya 4.6</title>
 <% 
 String Theme = request.getParameter("theme");
 if (Theme == null)
	 Theme = "mac_os_x";
 int WindowWidth = 0;
 try {
	 WindowWidth = Integer.parseInt(request.getParameter("width"));
 } catch (Exception e) {}
 if (WindowWidth <= 0)
	 WindowWidth = 800;
 int WindowHeight = 0;
 try {
	 WindowHeight = Integer.parseInt(request.getParameter("height"));
 } catch (Exception e) {}
 if (WindowHeight <= 0)
	 WindowHeight = 500;
 int LeftWidth = 0;
 try {
	 LeftWidth = Integer.parseInt(request.getParameter("left"));
 } catch (Exception e) {}
 if (LeftWidth <= 0)
	 LeftWidth = 200;
 
 %>

<c:set var="contextPath" scope="request">${pageContext.request.contextPath}</c:set>

  <script type="text/javascript" src="<%=request.getContextPath()%>/js/prototype.js"></script>
  
<script type="text/javascript" src="<%=request.getContextPath()%>/js/pwc/effects.js"> </script>

<script type="text/javascript" src="js/pwc/window.js"> </script>
<script type="text/javascript" src="js/pwc/debug.js"> </script>

<script type="text/javascript" src="<%=request.getContextPath()%>/js/scriptaculous/scriptaculous.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/rico/rico.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/rico/ricoBehaviors.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/rico/ricoEffects.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/rico/ricoComponents.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/rico/ricoCommon.js"></script>



  <script type="text/javascript" src="<%=request.getContextPath()%>/js/overlibmws/overlibmws.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/js/overlibmws/overlibmws_crossframe.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/js/overlibmws/overlibmws_iframe.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/js/overlibmws/overlibmws_hide.js"></script>
  <script type="text/javascript" src="<%=request.getContextPath()%>/js/overlibmws/overlibmws_shadow.js"></script>

<link href="themes/mac_os_x.css" rel="stylesheet" type="text/css" />
<link href="themes/debug.css" rel="stylesheet" type="text/css" />
<link href="themes/spread.css" rel="stylesheet" type="text/css" />
<link href="themes/alert.css" rel="stylesheet" type="text/css" />
<link href="themes/alert_lite.css" rel="stylesheet" type="text/css" />
<link href="themes/alphacube.css" rel="stylesheet" type="text/css" />
<link href="themes/nuncio.css" rel="stylesheet" type="text/css" />
<link href="themes/darkX.css" rel="stylesheet" type="text/css" />
<link href="themes/lighting.css" rel="stylesheet" type="text/css" />
<link href="themes/default.css" rel="stylesheet" type="text/css" />


<link href="stylesheet.css" rel="stylesheet" type="text/css" />
<link href="css/kautilyaAjax.css" rel="stylesheet" type="text/css" />


<style>
#leftpane {
  width: <%= LeftWidth %>px;
  height: <%= (WindowHeight - 10) %>px;
}  
#rightpane {
  left: <%= LeftWidth %>px;
  height:<%= (WindowHeight - 10) %>px;
  width: <%= WindowWidth - LeftWidth %>px;
}  

#TasksAccordion {
    width: <%= LeftWidth %>px;
}

</style>

</head>
<body>
<script>showDebug();</script>
<script type='text/javascript'>
Rico.loadModule('Accordion');
Rico.onLoad( function() {
  new Rico.Accordion( $$('div.panelheader'), $$('div.panelContent'),
                      {panelHeight:<%= (WindowHeight - 210) %>, hoverClass: 'panelHover', selectedClass: 'panelSelected'});
});
</script>
  <div id="wrapper">
  <div id= "content" class="content">

<script type="text/javascript">debug('created tree');</script>

<div id="container" style="clear: both;">
	<div id="mywin">
		<div id="leftpane">
		<div id="treepane">
     <div id="TasksAccordion">
     		<div>
     		  <div class="panelheader">My Reports</div>
     		  <div class="panelContent">
<!--				<ajax:tree 
					baseUrl="${contextPath}/tree.view" 
					styleId="reportfolders"
					parameters="repid={ajaxParameter}"
					nodeClass="nodeClass"
					expandedClass="expandedNode"
					collapsedClass="collapsedNode"
					treeClass="tree">
				</ajax:tree>
-->				<jsp:include page="tree/treeAjaxTree.jsp"></jsp:include>
       		  </div>
       		</div>
     		<div>
     		  <div class="panelheader">Dashboard</div>
     		  <div class="panelContent">
     			 <br>Dashboard tasks and links
     		  </div>
     		</div>
       		<div>
       		  <div class="panelheader">Report Designer</div>
     		  <div class="panelContent">
     			<br>Report Designer links here
     		  </div>
     		</div>
     		<div>
    		  <div class="panelheader">System Settings</div>
    		  <div class="panelContent">
    			<br>System settings links here
          	  </div>
    		</div>
    		<div>
    		  <div class="panelheader">BI on ER</div>
    			<div class="panelContent">
    				<br>BI on ER links here
          		</div>
    		</div>
    		<div>
    		  <div class="panelheader">BI</div>
   			  <div class="panelContent">
    			<br>BI links here
              </div>
             </div> 
     </div>

   </div>
   </div>
		<div id="rightpane">
			<div id="clicker">You have clicked <span >Result...</span></div>
		</div>
	</div>


<script type="text/javascript">debug('created window');</script>
<!--
<ajax:htmlContent baseUrl="${contextPath}/Frame1.jsp" 
sourceClass="nodeClass" 
target="clicker" 
parameters="repid={ajaxParameter},action=info"/>
-->
</div>
</div>
</div>
<script type="text/javascript">debug('content window');</script>

<a href="javascript:showDebugWindow()">debug</a>

<script>
function showDebugWindow() {
 //   if (mouseTracker == null)
//        mouseTracker = new MouseTracker();
    hideDebug();
    showDebug();
}
</script>

<script>
var contentWin=null;
if (contentWin != null) {
  Dialog.alert("Close the window 'Test' before opening it again!",{width:200, height:330}); 
}
else {
  contentWin = new Window({maximizable: true, 
  						className: "<%= Theme %>", 
  width: <%= WindowWidth %>, 
  height: <%= WindowHeight %>, 
  resizable: true, 
  hideEffect:Element.hide, 
  showEffect:Element.show, 
  minWidth: 500, 
  destroyOnClose: true,
  top: 20,
  left: 20
  })
  contentWin.setContent('mywin', false, false)
  contentWin.show();	

  // Set up a windows observer, check ou debug window to get messages
  myObserver = {
    onDestroy: function(eventName, win) {
      if (win == contentWin) {
        $('container').appendChild($('mywin'));
        contentWin = null;
        Windows.removeObserver(this);
      }
      debug(eventName + " on " + win.getId())
    }
  }
  Windows.addObserver(myObserver);
}

debug("Creating window winleft");
   var winleft = new Window({id: "winleft_id", 
  						className: "<%= Theme %>", 
  						title: "Tasks", 
  						width: <%= (LeftWidth - 50) %>, 
  						height: <%= (WindowHeight - 80) %>, 
  						top:0, 
  						left: 0, 
  						parent:$('leftpane'),
  						closable: false,
  						minimizable: false,
  						maximizable: false
  						}); 
 //win.getContent().innerHTML = "<h1>Constraint inside  a div !!</h1>constraint: {left:10, right:20}<br><a href='#' onclick='Windows.getWindow(\"win1\").maximize()'>Maximize me</a>"; 
  winleft.setContent('treepane',false,false);
  winleft.setDestroyOnClose(); 
  winleft.show(true);
  debug("setting constriant winleft");
  winleft.setConstraint(true, {left:5, right:5, bottom: 5})
  winleft.toFront();
  //winleft.maximize();
debug("done");
debug("Creating window");
   var win = new Window({id: "win1", 
  						className: "<%= Theme %>", 
  						title: "Information", 
  						width: <%= (WindowWidth - LeftWidth - 35) %>, 
  						height:  <%= (WindowHeight - 80) %>, 
  						top:0, 
  						left: 0, 
  						parent:$('rightpane'),
  						closable: false,
  						minimizable: false,
  						maximizable: false
  						}); 
 //win.getContent().innerHTML = "<h1>Constraint inside  a div !!</h1>constraint: {left:10, right:20}<br><a href='#' onclick='Windows.getWindow(\"win1\").maximize()'>Maximize me</a>"; 
  win.setContent('clicker',false,false);
  win.setDestroyOnClose(); 
  win.show(true);
  debug("setting constriant");
  win.setConstraint(true, {left:5, right:5, bottom: 5})
  win.toFront();
 // win.maximize();
debug("done");
</script>
</body>
</html>
