[HTML]<html>
<head>
<title>j</title>
<link rel="stylesheet" type="text/css" href="sdmenu.css" />
<script type="text/javascript" src="sdmenu.js">
<script type="text/javascript">
// <![CDATA[
var myMenu;
window.onload = function() {
myMenu = new SDMenu("my_menu");
myMenu.init();
};
// ]]>
</script>
</head>
<body>
<div style="float: left" id="my_menu" class="sdmenu">
<div><span>Inventory</span></div>
<div><span>Field Descriptions</span>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventFields.html#Field_Desc" class="submenu">General Fields</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventFields.html#UserTab" class="submenu">User/Location Tab</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventFields.html#CoverageTab" class="submenu">Coverage Tab</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventFields.html#POTab" class="submenu">P.O. Tab</a>
</div>
<div>
<span>Adding a Record</span>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventAddEquip.html#User_Location_tab" class="submenu">User/Location Tab</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventAddEquip.html#Coverage_tab" class="submenu">Coverage Tab</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventAddEquip.html#PO_Info_tab" class="submenu">P.O. Tab</a>
</div>
<div>
<span>Edit/Update Existing Record</span>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventEditRec.html#Transfer_to_different_user:" class="submenu">Transfer to different user</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventEditRec.html#Change_info_other_than_user:" class="submenu">Other Changes</a>
</div>
<div>
<span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/InventDisposeRec.html">Disposing Equipment</a></span>
</div>
<div>
<span>Help Desk</span>
</div>
<div>
<span>Field Descriptions</span>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/HDFields.html#TicketInfo" class="submenu">Ticket Info</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/HDFields.html#AssetTag" class="submenu">Asset Tag</a>
<a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/HDFields.html#Desc_Fields" class="submenu">Description Fields</a>
</div>
<div>
<span> <a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/HDOpenTicket.html" class="menu1"> Opening a new ticket</a></span></div>
<div><span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/HDUpdateTicket.html" class="menu1"> Updating Open Ticket </a></span></div>
<div><span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/HDCloseTicket.html" class="menu1"> Closing a Ticket</a></span></div>
<div><span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/HDKnowBase.html" class="menu1"> Knowledge base/Searching for records</a></span></div>
<div><span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/TaskPanel.html" class="menu1"> Task Panel Button Descriptions</a></span></div>
<div><span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/BasicCommands.html" class="menu1"> Filemaker Tips and Tricks</a></span></div>
<div><span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/AdminTools.html" class="menu1" onClick="showHide('Admin_menu')"> Admin Tools</a></span></div>
<div><span><a href="http://webcontent.courtnet.org/w1_www/courts/DistrictOffices/6thDistrict/ops/Instructions/UCICS/default.html" class="menu1">Main Page</a></span></div>
</div>
</body>
</html>
[/HTML]
the JS file is:
Expand|Select|Wrap|Line Numbers
- var SDMenu;
- SDMenu = new SDMenu("my_menu");
- function SDMenu(id) {
- if (!document.getElementById || !document.getElementsByTagName)
- return false;
- this.menu = document.getElementById(id);
- this.submenus = this.menu.getElementsByTagName("div");
- this.remember = true;
- this.speed = 3;
- this.markCurrent = true;
- this.oneSmOnly = false;
- }
- SDMenu.prototype.init = function() {
- var mainInstance = this;
- for (var i = 0; i < this.submenus.length; i++)
- this.submenus[i].getElementsByTagName("a")[0].onclick = function() {
- mainInstance.toggleMenu(this.parentNode);
- };
- if (this.markCurrent) {
- var links = this.menu.getElementsByTagName("a");
- for (var i = 0; i < links.length; i++)
- if (links[i].href == document.location.href) {
- links[i].className = "current";
- break;
- }
- }
- if (this.remember) {
- var regex = new RegExp("sdmenu_" + encodeURIComponent(this.menu.id) + "=([01]+)");
- var match = regex.exec(document.cookie);
- if (match) {
- var states = match[1].split("");
- for (var i = 0; i < states.length; i++)
- this.submenus[i].className = (states[i] == 0 ? "collapsed" : "");
- }
- }
- };
- SDMenu.prototype.toggleMenu = function(submenu) {
- if (submenu.className == "collapsed")
- this.expandMenu(submenu);
- else
- this.collapseMenu(submenu);
- };
- SDMenu.prototype.expandMenu = function(submenu) {
- var fullHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
- var links = submenu.getElementsByTagName("a");
- for (var i = 0; i < links.length; i++)
- fullHeight += links[i].offsetHeight;
- var moveBy = Math.round(this.speed * links.length);
- var mainInstance = this;
- var intId = setInterval(function() {
- var curHeight = submenu.offsetHeight;
- var newHeight = curHeight + moveBy;
- if (newHeight < fullHeight)
- submenu.style.height = newHeight + "px";
- else {
- clearInterval(intId);
- submenu.style.height = "";
- submenu.className = "";
- mainInstance.memorize();
- }
- }, 30);
- this.collapseOthers(submenu);
- };
- SDMenu.prototype.collapseMenu = function(submenu) {
- var minHeight = submenu.getElementsByTagName("div")[0].offsetHeight;
- var moveBy = Math.round(this.speed * submenu.getElementsByTagName("a").length);
- var mainInstance = this;
- var intId = setInterval(function() {
- var curHeight = submenu.offsetHeight;
- var newHeight = curHeight - moveBy;
- if (newHeight > minHeight)
- submenu.style.height = newHeight + "px";
- else {
- clearInterval(intId);
- submenu.style.height = "";
- submenu.className = "collapsed";
- mainInstance.memorize();
- }
- }, 30);
- };
- SDMenu.prototype.collapseOthers = function(submenu) {
- if (this.oneSmOnly) {
- for (var i = 0; i < this.submenus.length; i++)
- if (this.submenus[i] != submenu && this.submenus[i].className != "collapsed")
- this.collapseMenu(this.submenus[i]);
- }
- };
- SDMenu.prototype.expandAll = function() {
- var oldOneSmOnly = this.oneSmOnly;
- this.oneSmOnly = false;
- for (var i = 0; i < this.submenus.length; i++)
- if (this.submenus[i].className == "collapsed")
- this.expandMenu(this.submenus[i]);
- this.oneSmOnly = oldOneSmOnly;
- };
- SDMenu.prototype.collapseAll = function() {
- for (var i = 0; i < this.submenus.length; i++)
- if (this.submenus[i].className != "collapsed")
- this.collapseMenu(this.submenus[i]);
- };
- SDMenu.prototype.memorize = function() {
- if (this.remember) {
- var states = new Array();
- for (var i = 0; i < this.submenus.length; i++)
- states.push(this.submenus[i].className == "collapsed" ? 0 : 1);
- var d = new Date();
- d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
- document.cookie = "sdmenu_" + encodeURIComponent(this.menu.id) + "=" + states.join("") + "; expires=" + d.toGMTString() + "; path=/";
- }
- };