$(document).ready(function(){
    $('ul.accordion').accordion({ 
        autoheight: false,
        header: ".opener",
        active: '.selected',
        selectedClass: 'active',
        alwaysOpen: false,
        event: "click"
    });
});

var loadGalleryInterval = setTimeout("loadGallery()", 1);

function loadGallery()
{
 if (transType == '')
 {
  transType = 'scrollLeft';
 }
 if (transSpeed == '')
 {
  transSpeed = 1000;
 }
 if (transDelay == '')
 {
  transDelay = 4000;
 }
 $('#wrapper').cycle(
 {
  fx: transType,
  speed: transSpeed,
  timeout: transDelay,
  pause: 1,
  cleartypeNoBg: true,
  after: onAfter
 });
 if (transAutoAdvance != '1')
 {
  $('#wrapper').cycle('pause');
 }
}

function onAfter()
{
 var index = $('#wrapper .tab').index(this);
 
 var activeJqueryElement = $($('#tour-path a').get(index));

 $('#tour-path a').attr("class", "");
 activeJqueryElement.attr("class", "active");
}