/**
 * @name Define Design Group - User Interface
 * @version 2009.06.18
 * @author nick herold (nick@axisweb.com)
 * @copyright 2009 - Define Design Group, LLC
 * 
 * @type jQuery
 * @requires jQuery v1.3.2
 * @requires jquery.preload v1.0.7 (2008.03.12)
 * @requires jquery.cycle (2009.01)
 * @desc jquery functions
 */

// preload rollover imgs with load event (fires before document.onready)
$(window).bind('load', function() {
	$('#nav img:not(.active)').each(function(elm) { 
		$.preload($(this).attr('src').replace('.png', '-on.png'));
	});
});


$(document).ready(function() {
	// rollovers
	$('#nav img:not(.active)').hover(
		function() {
			$(this).attr('src', $(this).attr('src').split('.pn').join('-on.pn'));
		}, function() {
			$(this).attr('src', $(this).attr('src').split('-on.pn').join('.pn'));
	});

	// slideshows
	$('#text .slide, #slides-res').cycle({
		fx:'fade',
		timeout:3600,
		random:1
	}).show('fast');
	$('#slides-com').cycle({
		fx:'fade',
		timeout:3600,
		random:1
	});
	// 'Projects' page slide nav
	$('a#res').click(function() {
		$('#subhead h2').text('Projects: Residential');
		$('#slides-res').css('display','block');
		$('#slides-com').css('display','none');
		return false;
	});
	$('a#com').click(function() {
		$('#subhead h2').html('Projects: Commercial');
		$('#slides-com').css('display','block');
		$('#slides-res').css('display','none');
		return false;
	});

	$('#awards li:first').css('margin-top','0');
// jQuery.end(); --
});
