
var eid;
 	function ExpandStop(DivID,Width,Height)
            {
                window.clearTimeout(eid);
   			    wintop = 0;
		        winbottom = Height;
		        winleft = 0;
		        winright = Width;

		        DoExpand(DivID,wintop, winbottom, winleft, winright);
		       // document.getElementById("_ctl0:HiddenField1").value=DivID;
                eid=setTimeout("CollapseStop('"+DivID+"')", 150);
            }
   
     function CollapseStop(DivID)
            {
                if (eid)
                {
                    window.clearTimeout(eid);
                }
       			wintop = 0;
			    winbottom = 0;
			    winleft = 0;
			    winright = 0;
			    document.getElementById(DivID).expanded="false";

			    DoExpand(DivID,wintop, winbottom, winleft, winright);
            }                        
	function CollapseAll()
            {
			    var divs = document.getElementsByTagName('div');   

				for (var i = 0; i < divs.length; i++){                      
					  var divname = divs[i].id; 
					  var   subSection = divname.substring(3,0);  
					  if(subSection == "Div") {
						  CollapseStop(divname);
					  }

					 
				}//for
			    
            }      
	
	function ExpandfromLeft(DivID,Width,Height)
			{
			    window.clearTimeout(eid);
			    if (document.getElementById(DivID).expanded != "true")
			    {
			    	CollapseAll();
			        wintop=Height/2;
			        winbottom=Height/2;
			        winleft=0;
			        winright=0;
			        document.getElementById(DivID).expanded="true";
			    }
			    widthinc = Width/10;
			    heightinc = (Height/2)/10;			
			    if (winright < Width)
			    {
	            wintop-=heightinc;
	            winbottom+=heightinc;
	            winright+=widthinc;
	            winleft=0;
                eid=setTimeout("ExpandfromLeft('"+DivID+"',"+Width+","+Height+")", 50);            			
	            DoExpand(DivID,wintop, winbottom, winleft, winright);
	            }
            }            
			
      function DoExpand(DivID,wtop,wbottom,wleft,wright)
            {
               
               wright += 5; 
                document.getElementById(DivID).style.clip="rect(" + wtop + "px " + wright + "px " + wbottom + "px " + wleft + "px)";
            }
            
		function showdivs(){
			var divs = document.getElementsByTagName('div');   

				for (var i = 0; i < divs.length; i++){                      
					  var divname = divs[i].id; 
					  var   subSection = divname.substring(3,0);  
					  if(subSection == "Div") {
						  CollapseStop(divname);
					  }

					 
				}//for
		}
       function ExpandfromTop(DivID,Width,Height)
                  {
                                         
                      
                      window.clearTimeout(eid);
                      if (document.getElementById(DivID).expanded != "true")
                      {
                        CollapseAll();
                          wintop=0;
                          winbottom=0;
                          winleft=Width/2;
                          winright=Width/2;
                          document.getElementById(DivID).expanded="true";
                      }
					 document.getElementById(DivID).style.display= "block";
                      widthinc = (Width/2)/10;
                      heightinc = Height/10; 
                      if (winright < Width)
                      {
                          wintop=0;
                          winbottom+=heightinc;
                          winright+=widthinc;
                          winleft-=widthinc;
                        eid=setTimeout("ExpandfromTop('"+DivID+"',"+Width+","+Height+")", 10);   
                        DoExpand(DivID,wintop, winbottom, winleft, winright);
                        }                 
                   

            } 
