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("span")[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("span")[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=/";
	}
};

var myMenu;
var myMenu2;
var myMenu3;
var myMenu4;
var myMenu5;
function sdMenuFunction() {
		myMenu = new SDMenu("my_menu");
		myMenu.init();		
		myMenu2 = new SDMenu("my_menu2");
		myMenu2.init();	
		myMenu3 = new SDMenu("my_menu3");
		myMenu3.init();
		myMenu4 = new SDMenu("my_menu4");
		myMenu4.init();
		myMenu4 = new SDMenu("my_menu5");
		myMenu4.init();
		
		
};

function DisplayMenu(){
    document.write("<div style=\"float: left\" id=\"my_menu\" class=\"sdmenu\">");
     document.write("<div class=\"collapsed\">");
        document.write("<span>Tally.ERP 9</span>");
        document.write("<a href=\"Tallyerp_9_Overview.htm\">Overview</a>");
        document.write("<a href=\"Tallyerp_9_PlannedCalendarofDevelopment.htm\">Planned Calendar of Development</a>");
        document.write("<a href=\"Tallyerp_9_SeriesA(Current-May09).htm\">Series A (Current - May '09)</a>");
        document.write("<a href=\"Tallyerp_9_SeriesB(Sep09-Feb10).htm\">Series B (Sep '09 - Feb '10)</a>");
        document.write("<a href=\"Tallyerp_9_SeriesC(Jun-Aug10).htm\">Series C (Jun - Aug '10)</a>");
      document.write("</div>");
	  
      document.write("<div class=\"collapsed\">");
        document.write("<span>Series A (Current - May '09)</span>");
        document.write("<a href=\"Tallyerp_9_UnderstandingSeriesA.htm\">Understanding Series A</a>");
        document.write("<a href=\"Tallyerp_9_DesignandTally.NET.htm\">Design and Tally.NET</a>");
        document.write("<a href=\"Tallyerp_9_PrinciplesofFunctionality&KeyCharacteristics.htm\">Principles of Functionality & Key Characteristics</a>");
		document.write("<a href=\"Tallyerp_9_BuildingBlocksMasters.htm\">Building Blocks: Masters,Transactions, Link Masters</a>");
      document.write("</div>");
	  
      document.write("<div class=\"collapsed\">");
        document.write("<span>Editions Available</span>");
        document.write("<a href=\"Tallyerp_9_SilverEdition.htm\">Silver Edition - Single User</a>");
        document.write("<a href=\"Tallyerp_9_GoldEdition.htm\">Gold Edition - Unlimited Multi User</a>");
        document.write("<a href=\"Tallyerp_9_AuditorsEdition.htm\">Tally.ERP 9 - Auditors' Edition</a>");
      document.write("</div>");
	 
	 document.write("<div class=\"collapsed\">");
        document.write("<span>Upgrades & Migration</span>");
        document.write("<a href=\"Tallyerp_9_Upgradingfrompriorversions.htm\">Upgrading from prior versions</a>");        
      document.write("<a href=\"Tallyerp_9_Migratingfromotherproducts.htm\">Migrating from other products</a>");
      document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Functions & Features</span>");
        document.write("<a href=\"Tallyerp_9_Accounting.htm\">Accounting</a>");        
        document.write("<a href=\"Tallyerp_9_FinancialManagement&Controls.htm\">Financial Management & Controls</a>");
        document.write("<a href=\"Tallyerp_9_InventoryAccounting&Management.htm\">Inventory Accounting & <br>Management</a>");
		document.write("<a href=\"Tallyerp_9_Purchases&Payables.htm\">Purchases & Payables : from Order to Payment</a>");
		document.write("<a href=\"Tallyerp_9_Sales&Receivables.htm\">Sales & Receivables : from Order to Receipt</a>");
      document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
	  document.write("<span>Special Needs</span>");
        document.write("<a href=\"Tallyerp_9_Multi-company.htm\">Multi-Company</a>");        
        document.write("<a href=\"Tallyerp_9_Multi-Period.htm\">Multi-Period</a>");
        document.write("<a href=\"Tallyerp_9_Multi-Cost_ProfitCentres.htm\">Multi-Cost/Profit Centres</a>");
		document.write("<a href=\"Tallyerp_9_Multi-currency.htm\">Multi-Currency</a>");
		document.write("<a href=\"Tallyerp_9_Multi-units.htm\">Multi-Units</a>");
		document.write("<a href=\"Tallyerp_9_Multi-LocationInventory.htm\">Multi-Location Inventory</a>");
		document.write("<a href=\"Tallyerp_9_SecurityandAccessControl.htm\">Security and Access Control </a>");
		document.write("<a href=\"Tallyerp_9_RemoteAccess_Authentication.htm\">Remote Access, Authentication and User Management</a>");
      document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Installation & Management</span>");
        document.write("<a href=\"Tallyerp_9_Single-Site.htm\">Single Site</a>");        
        document.write("<a href=\"Tallyerp_9_Multi-Site.htm\">Multi Site</a>");
      document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Technology of Tally.ERP 9</span>");
        document.write("<a href=\"Tallyerp_9_InternalArchitecture&Design.htm\">Internal Architecture & Design</a>");        
        document.write("<a href=\"Tallyerp_9_TallyDefinitionLanguage(TDL).htm\">Tally Definition Language (TDL)</a>");
        document.write("<a href=\"Tallyerp_9_ApplicationInterfaces.htm\">Application Interfaces</a>");
      document.write("</div>");
	 
      document.write("<div class=\"collapsed\">");
        document.write("<span>Series B</span>");
        document.write("<a href=\"Tallyerp_9_WhatisSeriesB.htm\">What is Series B?</a>");        
      document.write("</div>");
	
	  document.write("<div class=\"collapsed\">");
        document.write("<span>New Editions Available</span>");
        document.write("<a href=\"Tallyerp_9_DiamondEdition.htm\">Diamond Edition - Unlimited Multi User </a>");        
        document.write("<a href=\"Tallyerp_9_PlatinumEdition.htm\">Platinum Edition - Unlimited Multi Use</a>");
      document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Series C</span>");
        document.write("<a href=\"Tallyerp_9_WhatisSeriesC.htm\">What is Series C?</a>");        
       document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Tally.ERP 9 Auditors' Edition</span>");
        document.write("<a href=\"Tallyerp_9_Auditors_Edition.htm\">Auditors' Edition</a>");        
      document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
      document.write("<span>Tally.ERP 9 - Rental</span>");
      document.write("<a href=\"TallyRentalOverview.htm\">Overview</a>");
      document.write("<a href=\"TallyRentalPrices.htm\">Rental Prices</a>");
      document.write("<a href=\"TallyRentalorPerpetual.htm\">Rental or Perpetual?</a>");      
      document.write("<a href=\"TallyRentalRenewalOptions.htm\">Renewal Options</a>");
      document.write("</div>");	 
	  
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Tally Shoper 9</span>");
        document.write("<a href=\"Tallyerp_9_shoper9.htm\">Introduction</a>");        
      document.write("</div>");
	  
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Download</span>");
        document.write("<a href=\"download.htm\">Download Tally.ERP 9 </a>");        
       document.write("</div>");
        document.write("</div>");
  
};

function DisplayMenu2(){
    document.write("<div style=\"float: left\" id=\"my_menu2\" class=\"sdmenu2\">");
	  document.write("<div class=\"collapsed\">");
        document.write("<span>Tally Solutions</span>");
        document.write("<a href=\"solutions.htm\">Tally Enterprise Solution</a>");
        document.write("<a href=\"solutions.htm\">Tally Integration </a>");
        document.write("<a href=\"WebEnabling.htm\">Web Enabling Tally</a>");
        document.write("<a href=\"MobileEnabling.htm\">Mobile Enabling Tally</a>");
      document.write("</div>");
	  document.write("</div>");
};

function DisplayMenu3(){
    document.write("<div style=\"float: left\" id=\"my_menu3\" class=\"sdmenu2\">");
      document.write("<div class=\"collapsed\">");
        document.write("<span>Tally Support & Services</span>");
        document.write("<a href=\"TallySalesandServices.htm\">Services </a>");
		document.write("<a href=\"TallyAnnualSupportCover.htm\">Annual Support Cover </a>");
		

		document.write("<div class=\"collapsed\">");
        document.write("<span>Customizations</span>");
		document.write("<a href=\"TallyCustomizations.htm\">Tally Customizations </a>");
        document.write("<a href=\"TallyDocumentPrintingFormats.htm\">Document Printing Formats </a>");
		document.write("<a href=\"TallyCustomReportsIntegrationandFunctionalityExtensions.htm\">Customizations & Integration </a>"); 
	    document.write("</div>");
		
		document.write("<div class=\"collapsed\">");
        document.write("<span>Support</span>");
		document.write("<a href=\"TallySupport.htm\">Tally support </a>");
        document.write("<a href=\"TallyOnsiteandRemotesupport.htm\">Onsite and Remote support </a>"); 
	    document.write("</div>");
	    document.write("</div>");

};

function DisplayMenu4(){
    document.write("<div style=\"float: left\" id=\"my_menu4\" class=\"sdmenu2\">");
      document.write("<div class=\"collapsed\">");
        document.write("<span>Tally Addons</span>");
document.write("<a href=\"manufacturersexcise.htm\">Manufacturing Excise software</a>");
document.write("<a href=\"reportgenerator.htm\">Tally Report Writer</a>");
document.write("<a href=\"materialrequirement.htm\">Material Requirement Planning </a>");
document.write("<a href=\"audittrail.htm\">Audit Trail</a>");
document.write("<a href=\"VoucherTypeLevelSec.htm\">Voucher-Type Level Security</a>");      
document.write("<a href=\"smsplugin.htm\">SMS Plugin for Tally</a>");
      document.write("</div>");	  
document.write("</div>");

};





