/* appereance.start */

function createXhttp()
{
    var xmlhttp = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false));
    if (!xmlhttp) {
        return false;
    }
    else
    {
      return xmlhttp;
    }
}

function send_xmlhttprequest(xmlhttp,state_change, method, url, content, headers) {
    xmlhttp.open(method, url);
    xmlhttp.onreadystatechange = function () {
        state_change(xmlhttp);
    };
    headers = headers || {};
    headers['X-Requested-With'] = headers['X-Requested-With'] || 'XMLHttpRequest';
    for (var key in headers) {
        xmlhttp.setRequestHeader(key, headers[key]);
    }
    xmlhttp.send(content);
}

function setOpacity(value,obj)
{ 
  if(obj!=null)
  {
      obj.style.opacity = (value / 100);
      obj.style.KhtmlOpacity = (value / 100);
      obj.style.filter = "alpha(opacity=" + value + ")";
  }
}

function objectSizeUpDown(object,act,from,to,event,frameRate,speed,withOpacity)
{
     if((act > to && to > from) || (act < from && to > from))
     {  
          event();
          return;
     } 
     
     /* opac.not implemented */
     /*
     if(opacity)
     {
       var opacVal =  
     
       setOpacity(opacVal,object);
     }
     */
     /* opac.not implemented */ 
    
     object.style.height = act+'px';
    
    
     var next = function()
     {
       if(from > to)
       {
        act = act - speed;
       }
       else
       {
        act = act + speed;
       }
       objectSizeUpDown(object,act,from,to,event,frameRate,speed,withOpacity);
     }
     setTimeout(next,frameRate);
}

function objectGrdUpDown(object,act,from,to,event,frameRate,speed,action)
{
     
     if((act > to && to > from) || (act < from && to > from) || act > 100 || act < 0)
     {  
          if(typeof(event) == "function")
          {
             event();
          }
          
          return;
     } 
     
     setOpacity(act,object);
     
     if(typeof(action) == "function")
     {
       action();
     }
    
     var next = function()
     {
       if(from > to)
       {
        act = act - speed;
       }
       else
       {
        act = act + speed;
       }
       objectGrdUpDown(object,act,from,to,event,frameRate,speed)
     }
     setTimeout(next,frameRate);
}

/* appereance.end */