/**
 * Copyright (c) 2007 E-nova Team Rocket!
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *   
 */
$(function(){
  var _current = null;
  
  $('#myScroll').jScrollPane({
    scrollbarWidth:4, 
    scrollbarMargin:0,
    scrollbarPadding:0
  });
  
	$('#cycle').cycle({ 
    fx:     'fade', 
    speed:   1000, 
    timeout: 4000, 
    next:   '#cycle', 
    pause:   1 ,
    before: onChangePicture,
    pager:  '.thumbnail#nav',
    pagerAnchorBuilder: onBuildAnchor
  });
  
  function onBuildAnchor(idx, slide) { 
	  return '.thumbnail#nav li:eq(' + idx + ') a'; 
  }
  
  function onChangePicture() { 
  	$('#output').html("for:" + this.id);
    if(_current!=null) _current.css("border-color","#444");
    _current = $('.thumbnail#nav li a#'+this.id);
    if(_current!=null) _current.css("border-color","#777");
  }

});

  