/* ---------------------------------------
 * Filename: engine.js
 * Version: 1.5.0 (2010-9-25) yyyy-mm-dd
 * Description: script configurations and document onload functions - multiple dependencies
 * Website:
 * Author: Anthony Eggert - http://www.stylephreak.com
 ----------------------------------------- */
var Stylephreak = { 

  // Link Treatments
    treatLinks: function() { 
    // Link Treatment - Find all links with external designations and open them in a new window (validates Strict)
        $('a[rel="external"]').click(function() {
            window.open($(this).attr('href'));
            return false;
        }); 
        // Link Treatment - Appends the class 'ui-state-active' to the current navigation link's parent.  
        $("#nav a").each(function() {
            var hreflink = $(this).attr("href");
            if (hreflink.toLowerCase() == location.href.toLowerCase()) {
                $(this).parent("li").addClass("selected");
            }
        });
    },
  
    // NivoSlider
    nivoSlider: function() {  
      setTimeout(function(){
        $('#slider .nivoSlider').nivoSlider({
          effect:'random',
          animSpeed:500,
          pauseTime:3000,
          captionOpacity: 1
        });
      }, 200);
    }
}

// functions to run when the DOM is ready
$(document).ready(function() {
    Stylephreak.treatLinks();  
    Stylephreak.nivoSlider();
    $('.myCorner').corner('10px');   
    
    // initialise plugins
    jQuery(function () {
      jQuery('ul.sf-menu').superfish();
    });
});
// functions to run after page is fully loaded
$(window).load(function() {  

});

