function is_slider(target_id, duration, pause, style, repeat, start_function, end_function){
  this.target = document.getElementById(target_id);
  this.pause = pause;
  this.style = style;
  this.repeat = repeat;
  that = this;
  switch(this.style)
  {
    case 'up':
      if(repeat=='loop') this.active = window.setInterval(function(){that.up(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.up(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'down':
      if(repeat=='loop') this.active = window.setInterval(function(){that.down(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.down(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'right':
      if(repeat=='loop') this.active = window.setInterval(function(){that.right(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.right(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'left':
      if(repeat=='loop') this.active = window.setInterval(function(){that.left(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.left(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'back2front_right':
      if(repeat=='loop') this.active = window.setInterval(function(){that.back2front_right(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.back2front_right(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'back2front_left':
      if(repeat=='loop') this.active = window.setInterval(function(){that.back2front_left(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.back2front_left(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'back2front_bottom':
      if(repeat=='loop') this.active = window.setInterval(function(){that.back2front_bottom(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.back2front_bottom(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'back2front_top':
      if(repeat=='loop') this.active = window.setInterval(function(){that.back2front_top(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.back2front_top(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'fade':
      if(repeat=='loop') this.active = window.setInterval(function(){that.fade(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.fade(target_id, duration, start_function, end_function);}, this.pause);
      break;
    case 'flip':
      if(repeat=='loop') this.active = window.setInterval(function(){that.flip(target_id, duration, start_function, end_function);}, this.pause);
      else window.setTimeout(function(){that.flip(target_id, duration, start_function, end_function);}, this.pause);
      break;
    default:
      break;
  }
      
  this.up = function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];    
    $(current_element).animate({
      top: -current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      top: -current_element.offsetHeight
      }, duration,'',function(){that.animation_finished(target, end_function);})
  }

  this.down = function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    next_element.style.top = -next_element.offsetHeight*2 + 'px';
    $(current_element).animate({
      top: current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      top: -current_element.offsetHeight
      }, duration,'',function(){that.animation_finished(target, end_function);}  )
  }

  this.right=function(target,duration){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    next_element.style.left=-next_element.offsetWidth;
    next_element.style.top=-next_element.offsetHeight;
    $(current_element).animate({
      left: current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      left: '0px'
      }, duration,'',function(){that.animation_finished(target, end_function);}  )
  }
  
  this.left=function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    next_element.style.left=next_element.offsetWidth;
    next_element.style.top=-next_element.offsetHeight;
    $(current_element).animate({
      left: -current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      left: '0px'
      }, duration,'',function(){that.animation_finished(target, end_function);}  )
  }
  
  this.back2front_right=function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    next_element.style.left=next_element.offsetWidth;
    next_element.style.top=-next_element.offsetHeight;
    $(current_element).animate({
      left: current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      left: '0px'
      }, duration,'',function(){that.animation_finished(target, end_function);}  )
  }
  
  this.back2front_left=function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    next_element.style.left=-next_element.offsetWidth;
    next_element.style.top=-next_element.offsetHeight;
    $(current_element).animate({
      left: -current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      left: '0px'
      }, duration,'',function(){that.animation_finished(target, end_function);}  )
  }

  this.back2front_bottom=function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    $(current_element).animate({
      top: current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      top: -current_element.offsetHeight
      }, duration,'',function(){that.animation_finished(target, end_function);}  )
  }

  this.back2front_top=function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    next_element.style.top = -next_element.offsetHeight*2 + 'px';
    $(current_element).animate({
      top: -current_element.offsetHeight
      }, duration,'','')
      
    $(next_element).animate({
      top: -current_element.offsetHeight
      }, duration,'',function(){that.animation_finished(target, end_function);}  )
  }

  this.fade=function(target, duration, start_function, end_function){
    eval(start_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    current_element.style.position="relative";
    current_element.style.zIndex="2";
    next_element.style.position="relative";
    next_element.style.zIndex="1";
    next_element.style.top=-current_element.offsetHeight+'px';
    $(current_element).animate({
      opacity: "0"
      }, duration, '', function(){that.animation_finished(target, end_function);} )
  }
  
  this.flip=function(target, duration, start_function, end_function){
    eval(start_function);
    that.animation_finished(target, end_function);
  }

  this.animation_finished = function(target, end_function){
    eval(end_function);
    current_element=document.getElementById(target).getElementsByTagName("Div")[0];
    next_element=document.getElementById(target).getElementsByTagName("Div")[1];
    document.getElementById(target).appendChild(current_element);
    next_element.style.top = '0px';
    next_element.style.left = '0px';
    current_element.style.top = '0px';
    current_element.style.left = '0px';
    $(current_element).css({
      opacity: "1"});
  }
}