
$(document).ready(function() {


	if(IE6) {
		/// PNGs
		$("img[src$='.png']").each(function() {
			var src = $(this).attr('src');
			$(this).attr("src", "http://www.dynamit.us/img/spacer.gif").attr("style", "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "');");
		});
	}


	$("ul#nav").dynamItDrop();

	/** text box focus value swap thingamajig **/
	$('.focusvalue').each( function() {
		if( ! $(this).val().length ) {
			$(this).val($(this).attr('title'));
		}
	}).focus( function() {
		if($(this).val() == $(this).attr('title'))
			$(this).val('');
	}).blur( function() {
		if( ! $(this).val().length ) {
			$(this).val( $(this).attr('title') );
		}
	});


	/** fix bottom links class ***/
	$('ul#links li:first').addClass('first');

	/** auto-rotate homepage features ***/
	var flipTimeout = null;
	var $first = $('ul#featnav li').eq(0);
	var $last = $('ul#featnav li').eq(1);

	$('ul#featnav li').not('.clean').mouseover( function() {
//		clearTimeout(flipTimeout);

		$('#featinner').css('borderColor', '#ACD6F2');

		var previd 	= '#' + $last.attr('id') + '_img';
		var myid 	= '#' + $(this).attr('id') + '_img';

		if( previd == myid ) return;

		$('#banner img').not(previd).hide();
		$(previd).fadeOut('slow');
		$(myid).fadeIn('slow');

		$last.removeClass('on');
		$last = $(this).addClass('on');

/*		flipTimeout = setTimeout(function() {
			$next = $last.next();
			if($next.hasClass('last'))
				$next = $first;
			$next.mouseover();
		}, 3500); */

	}).mouseout( function() {
		$('#featinner').css('borderColor', '#ffffff');
	});

	$('#featinner').hover( function() {
		$(this).css('borderColor', '#ACD6F2');
	}, function() {
		$(this).css('borderColor', '#ffffff');
	});

	$first.mouseover();
	$('#featinner').css('borderColor', '#ffffff');

	$('#featinner').children('img').click( function() {

		var lnk = str_replace('_img', '', $(this).attr('id'));
		var url = $('#' + lnk).children('a').attr('href');
		location.href = url;

	});

});
