function slider()
{
    this.position = 0;
}

function MoveLeft(prefix,size,images,links,state,defaultImageUrl)
{
  if(state.position != 0)
  {
    state.position--;
    Init(prefix,size,images,links,state,defaultImageUrl);
  }
}

function MoveRight(prefix,size,images,links,state,defaultImageUrl)
{
  if(state.position != images.length - size)
  {
    state.position++;
    Init(prefix,size,images,links,state,defaultImageUrl);
  }
}

function Init(prefix,size,images,links,state,defaultImageUrl)
{
    if(state.position > images.length - size)
        state.position = images.length - size;
    
  for(var ii = 0 ; ii < size; ii++)
  {
    var element = document.getElementById(prefix+"_"+ii);
    if(element != null)
    {           
        element.setAttribute("src",defaultImageUrl); 
    }
  }
  
  for(var ii = 0 ; ii < size; ii++)
  {  
    var element = document.getElementById(prefix+"_"+ii);
    if(element != null)
    {
        element.setAttribute("src",images[ii+state.position]);  
        element.setAttribute("image_index",ii+state.position);  
    }
    
    var element = document.getElementById(prefix+"_link_"+ii);
    if(element != null)
        element.setAttribute("href",links[ii+state.position]);  
    
  }
}

try
{
    if( Sys && Sys.Application )
        Sys.Application.notifyScriptLoaded();
}
catch(e){}