var flag=0;
function f_s(id){
       var obj=document.getElementById(id);
       obj.style.display="block";
       obj.style.height="1px"; 
       var changeW=function(){ 	 		
              var obj_h=parseInt(obj.style.height);
              if(obj_h<=180){ 
                     obj.style.height=(obj_h+Math.ceil((180-obj_h)/10))+"px";
              }
              else{ 
              clearInterval(bw1);
              }
       }       
       bw1= setInterval(changeW,1);
	   if(flag>0){
	   	 clearInterval(bw2);
	   }
}
function closeW(id){
		flag++;
       var obj=document.getElementById(id);
       var closeDiv=function(){
clearInterval(bw1);
              var obj_h=parseInt(obj.style.height);
              if(obj_h>1){ 
                     obj.style.height=(obj_h-Math.ceil(obj_h)/10)+"px";
					
              }
              else{
              clearInterval(bw2);
              obj.style.display="none";
              }
       }         
      bw2= setInterval(closeDiv,1);
}

/////////////////////////////////////////////////////////////

function f_s2(id){
       var obj=document.getElementById(id);
       obj.style.display="block";
       obj.style.height="1px"; 
       var changeW=function(){ 	 		
              var obj_h=parseInt(obj.style.height);
              if(obj_h<=30){ 
                     obj.style.height=(obj_h+Math.ceil((30-obj_h)/5))+"px";
              }
              else{ 
              clearInterval(bw1);
              }
       }       
       bw1= setInterval(changeW,1);
	   if(flag>0){
	   	 clearInterval(bw2);
	   }
}
function closeW2(id){
		//flag++;
       var obj=document.getElementById(id);
       //var closeDiv=function(){
clearInterval(bw1);
              //var obj_h=parseInt(obj.style.height);
              //if(obj_h>1){ 
                     //obj.style.height=(obj_h-Math.ceil(obj_h)/5)+"px";
              //}
              //else{
              //clearInterval(bw2);
              obj.style.display="none";
              //}
       //}         
      //bw2= setInterval(closeDiv,1);
}

/////////////////////////////////////////////////////
function f_s_h(id){
       var obj=document.getElementById(id);
       obj.style.display="block";
       obj.style.width="1px"; 
       var changeW=function(){ 	 		
              var obj_h=parseInt(obj.style.width);
              if(obj_h<=180){ 
                     obj.style.width=(obj_h+Math.ceil((180-obj_h)/10))+"px";
              }
              else{ 
              clearInterval(bw1);
              }
       }       
       bw1= setInterval(changeW,1);
	   if(flag>0){
	   	 clearInterval(bw2);
	   }
}
function closeW_h(id){
		flag++;
       var obj=document.getElementById(id);
       var closeDiv=function(){
clearInterval(bw1);
              var obj_h=parseInt(obj.style.width);
              if(obj_h>1){ 
                     obj.style.width=(obj_h-Math.ceil(obj_h)/10)+"px";
					
              }
              else{
              clearInterval(bw2);
              obj.style.display="none";
              }
       }         
      bw2= setInterval(closeDiv,1);
}
////////////////////////////////////////////////

function showDiv(){ 
	var ele = document.getElementById("div1");
	clearInterval(bw1);
	clearInterval(bw2);
	ele.style.display = "block";
	ele.style.height = 180 + "px";	
}
