﻿
//slide show function
$(function() {
    $('#slideShow').cycle({
        delay: 1500,
        speed: 2000,
        before: onBefore
    });
    function onBefore() {
        $('#slideShowText').html(this.alt);
    }
});

//convert unordered list into collaspible panel
$(function() {
    $('li:has(ul)')
      .click(function(event) {
          if (this == event.target) {
              if ($(this).children().is(':hidden')) {
                  $(this)
      .css('list-style-image', 'url(../images/design/minus.gif)')
      .children().show();
              } else {
                  $(this)
      .css('list-style-image', 'url(../images/design/plus.gif)')
      .children().hide();
              }
          } return false;
      })
      .css('cursor', 'pointer')
      .click();
    $('li:not(:has(ul))').css({
        cursor: 'default', 'list-style-image': 'none'
    })
         .click(function(event) {
             event.stopPropagation();
             return true;
         })
});



//add external link image to hyper links
$(function() {
    $('#extlinks a').filter(function() {
        return this.hostname && this.hostname !== location.hostname;
    }).addClass('external');
});