function close_all(divid){
     if(document.getElementById('popup1') && divid != "popup1") closediv('popup1');
     if(document.getElementById('popup2') && divid != "popup2") closediv('popup2');
     if(document.getElementById('popup3') && divid != "popup3") closediv('popup3');
     if(document.getElementById('popup4') && divid != "popup4") closediv('popup4');
     if(document.getElementById('popup5') && divid != "popup5") closediv('popup5');
     if(document.getElementById('popup6') && divid != "popup6") closediv('popup6');
}

function closediv(divid){
    object = document.getElementById(divid);
    object2 = document.getElementById(divid+'sh');
      object.style.border = '0px solid #C8DDDD';
      if(parseInt(object.style.height) > 0){
         object.style.height = "0px";
      }
      if(parseInt(object2.style.height) > 0){
           object2.style.height = "0px";
      }
      if(parseInt(object.style.width) > 0){
            object.style.width = "0px";
      }
      if(parseInt(object2.style.width) > 0){
            object2.style.width = "0px";
      }
      object.style.display ="none";
      object2.style.display ="none";
}

function togo(divid){
   close_all(divid);
   object = document.getElementById(divid);
   object2 = document.getElementById(divid+'sh');
   if(parseInt(object.style.borderWidth) == 0){
      object.style.display ="";
      object2.style.display ="";
      display(divid);
   }else{
      displayout(divid);
   }
}
function display(divid){
    object = document.getElementById(divid);
    object2 = document.getElementById(divid+'sh');
    if((parseInt(object.style.height) < 500) || (parseInt(object.style.width) < 500) || (parseInt(object2.style.height) < 500) || (parseInt(object2.style.width) < 500)){
      object.style.border = '1px solid #C8DDDD';
      if(parseInt(object.style.height) < 500){
         object.style.height = parseInt(object.style.height) + 50 + "px";
      }
      if(parseInt(object2.style.height) < 500){
         object2.style.height = parseInt(object2.style.height) + 50 + "px";
      }
      if(parseInt(object.style.width) < 500){
            object.style.width = parseInt(object.style.width) + 50 + "px";
      }
      if(parseInt(object2.style.width) < 500){
            object2.style.width = parseInt(object2.style.width) + 50 + "px";
      }
      setTimeout("display('"+divid+"')",1);
    }
}

function displayout(divid){
    object = document.getElementById(divid);
    object2 = document.getElementById(divid+'sh');
    if((parseInt(object.style.height) > 0) || (parseInt(object.style.width) > 0) || (parseInt(object2.style.height) > 0) || (parseInt(object2.style.width) > 0)){
      object.style.border = '0px solid #C8DDDD';
      if(parseInt(object.style.height) > 0){
         object.style.height = parseInt(object.style.height) - 50 + "px";
      }
      if(parseInt(object2.style.height) > 0){
         object2.style.height = parseInt(object.style.height) - 50 + "px";
      }
      if(parseInt(object.style.width) > 0){
            object.style.width = parseInt(object.style.width) - 50 + "px";
      }
      if(parseInt(object2.style.width) > 0){
            object2.style.width = parseInt(object.style.width) - 50 + "px";
      }
      setTimeout("displayout('"+divid+"')",1);
    }else{
          object.style.display ="none";
          object2.style.display ="none";
    }
}
