	
		var lobj=-1,alllastobj=-1,testl2=false,all,len;
	
		//ID is the FULL ADDRESS of the TR box
		// NAME defines under which it lies 
		//OBJ passed as arg. is the complete ID of the box clicked, which act as NAME for SUB BOX

		 function checkl2(obj1)
		 {
	  		 var i=0,att1;
	  		 for(i = 0; i < len; i++) 
        		{
	      			att1 = all[i].getAttribute("name");
          			if(att1 == obj1)
           		  {
           			  testl2=true;
           			  break;
           		  }
   			    	else
   			    	  testl2=false;
				}

			

		 }

	    function clear()
		{
			
     		var i=0,att,x;
    		for(i = 0; i <len; i++) 
    		 {
	   				var x=document.getElementById(all[i].getAttribute("id"));
	   				x.style.display = "none";         
              
        	  }

			return true;
		}
	
   		function menu(obj)
		 {
	 		checkl2(obj);
	 		if(alllastobj!=obj && testl2==true)
	 		  {
				clear();
				var i=0,att1,att2,x,f=false;
	  			for(i = 0; i < len; i++) 
        		  {
	      			att1 = all[i].getAttribute("name");
          			att2 = all[i].getAttribute("id");
          			if(att1 == obj ||att1==lobj || att2.indexOf("t")==-1) //for selection
           			  {
	    	 			if(att1==obj && obj!=lobj)
  	    	 	 		  f=true;
		          		x=document.getElementById(att2);
		          		x.style.display = "block";
	  			      }
				  	}
				if(f==true)
				  lobj=obj;
   				alllastobj=obj;
 				testl2=false;
			  }
			return true;
		 }
	   
		 function start()
		{
         		all=document.getElementById("lmenu").getElementsByTagName("tr");
			len=all.length
     		var i=0,att,x;
    		for(i = 0; i <len; i++) 
    		 {
         		 att = all[i].getAttribute("id");
         		 if(att.indexOf("t")!=-1 && all[i].getAttribute("value")=="false")
          		  {
 	    				
 	    				var x=document.getElementById(att);
	    				x.style.display = "none";         
          		   }
          
        	  }

			return true;
		}



