/* ---------------------------------------
 * Filename: engine.js
 * Version: 1.5.0 (2009-8-05) 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 - Append the appropriate class name to each document link (e.g. class="doc")		
        $('a[href]').each(function() {
            if ((C = $(this).attr('href').match(/[.](doc|xls|pdf|zip|txt)$/))) {
                $(this).addClass(C[1]);
            }
        });
        // 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:'fade', // Specify sets like: 'fold,fade,sliceDown'
				animSpeed:1000,
				pauseTime:5000,
				captionOpacity: 1,
				controlNav:false, // 1,2,3... navigation
				directionNav:true, // Next & Prev navigation
        		directionNavHide:true // Only show on hover
			});
		}, 500);
    }
}

// functions to run when the DOM is ready
$(document).ready(function() {
    Stylephreak.treatLinks();	
	Stylephreak.nivoSlider();	
});
// functions to run after page is fully loaded
$(window).load(function() {	

	
});
