﻿/// <reference path="jquery-1.2.6-vsdoc.js" />
$(document).ready(function() {
  var arrSlide = $('.travel_slide');
  var arrNav = $('.nav');
  var i = 0;
  //show all tour list, the all tour list is set to display = none to avoid the poping during loading.
  $('.all_list').show();
  for (i = 0; i < arrSlide.length; i++) {
    $('#' + arrSlide[i].id).cycle({
      fx: 'zoom', // fade, turnDown, shuffle, curtainX, zoom
      speed: 'slow',
      timeout: 4000,
      pager: '#' + arrNav[i].id,
      pagerAnchorBuilder: function(idx, slide) {
        // return sel string for existing anchor
        //return '.nav li:eq(' + (idx) + ') a';
        return '<li><a href="#"><img src="' + slide.src + '" /></a></li>';
      }
    });
  }

  /* for catogry image */
  $(".Block").hide(); //hide all tour list
  $(".Block_Content").hide(); //hide all content block
  $(".Block_Title").click(function() { $(this).next().slideToggle(); }); //pre-set the toggle effect

  //category image click event
  $(".division img").click(function() {
    $(".Block").hide(); //hide all blocks
    $(".division img").animate({ opacity: '0.25' }); //set opacity to all
    $("." + this.id).show(); //show only the related block
    $("#" + this.id).animate({ opacity: '1' }); //set the selected category image opactiy to 1 
    anchor = $('.all_list').attr("id");
    location.href = "#" + anchor;
  }
	);


});

