
$(document).ready(function() {

	var IE6 = (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) == 6);
	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 + "');");
		});
	}


	/** Setup dropdowns **/
	var to;
	$('a.openup').mouseover(function() {
		clearTimeout(to);
		$('.opened').hide();

		var id = $(this).attr('id');
		$('#' + id + '-drop').show();
	}).mouseout(function() {
		var id = $(this).attr('id');
		to = setTimeout(function() {
			closeme($('#' + id + '-drop'));
		}, 2000);
	});

	$('.opened').mouseover(function() {
		clearTimeout(to);
	}).mouseout(function() {
		var id = $(this).attr('id');
		to = setTimeout(function() {
			closeme($('#' + id));
		}, 1000);
	});

	function closeme(o) {
		o.hide();
	}


	/** link list hovers **/
	$('ul.links>li').hover(function() {	//mouseover
		$(this).addClass('on');
	}, function() {				//mouseout
		$(this).removeClass('on');
	});

	$("#content .outer .bottom .padding tr:odd").css("backgroundColor", "#f1efe9");
	$("#content .outer .bottom .padding tr:even").css("backgroundColor", "");
	$("#content .outer .bottom .padding td").attr("bgcolor", "");


	/** RBW 2010-03-09: Start the fade **/
	setTimeout('nextBanner()', BANNERTIMEOUT);

});

        
/** RBW 2010-03-09: Fade-in...Fade-out **/
var BANNERTIMEOUT = 5500;
function nextBanner() {
	var $thisbanner = $("#banner ul li:visible");

	var $nextbanner = $thisbanner.next('li');
	if( !$nextbanner.length ) $nextbanner = $("#banner ul li").eq(0);

	$thisbanner.fadeOut('slow');
	$nextbanner.fadeIn('slow');

	setTimeout('nextBanner()', BANNERTIMEOUT);
}

function showCalendar() {
	dynamItLoad('/calendar/dlg_full.php', null, 650, 'auto', null);
}

function disableButton() {
	if(dynamItElem('submit-button').disabled==true) {
		dynamItElem('submit-button').disabled='';
	} else {
		dynamItElem('submit-button').disabled=true;
     }
}

function lightbox(path) {
	dynamItLoad('/lightbox/dlg_lightbox.php?path=' + path, null, 650, 500, null);
}
