function openWin(theURL, winName, features) {
	var newwindow = window.open(theURL, winName, features);
	if (window.focus) { newwindow.focus(); }
}

/*
*	set up fading text field backgrounds
*/
function fade_texts() {
	jQuery(document).ready(function($) {
		var fields = 'input[@type=text], input[@type=password], textarea';
		$(fields).css('background-color', '#000').focus(function() {
			$(this).animate({
				backgroundColor: "#222"
			}, 400);
		});
		$(fields).blur(function() {
			$(this).animate({
				backgroundColor: "#000"
			}, 400);
		});
	});
}

function banners() {
	jQuery(document).ready(function($) {
		$('#banner div.mask').fadeOut(1500, function() {
			$(this).remove();
			$('#banner div.slideshow').slideshow({
				transTime: 1500,
				pauseTime: 2000
			});
		});
	});
}

/*
*	set up flash message animations
*/
function flash_messages() {
	jQuery(document).ready(function($) {
		$('div.flash, div.flash-error').css('opacity', 1);
		setTimeout(function() {
			$('div.flash, div.flash-error').fadeTo(500, 0, function() {
				$(this).css('height', $(this).height());
				$(this).animate({height : 0, marginTop : 0, marginBottom : 0, paddingTop : 0, paddingBottom : 0}, 400, 'swing', function() {
					$(this).hide();
				});
			});
		}, 6000);
	});
}