function send() {
	var ready = true;
	if($('#name').val() == "") {
		alert('Please enter a name');
		ready = false;
	}
	if ($('#email').val().indexOf('@') == -1) {
		alert('Please enter a valid email address');
		ready = false;
	}
	if ($('#subject').val() == "") {
		alert('Please enter a subject');
		ready = false;
	}
	if ($('#message').val() == "") {
		alert('Please enter a message');
		ready = false;
	}
	if (ready) {
		$.post(
			'/feedback/',
			{
				name: $('#name').val(),
				email: $('#email').val(),
				subject: $('#subject').val(),
				message: $('#message').val()
			},
			function() {
				$('#messageSent').slideDown();
			}
		)
	}
}

$(document).ready(function() {
	$('#ie').remove();
	$('.slide').css({'display': 'block'});
	$('.slidercontrol ol li div.slide').remove().appendTo('.slider');
	$('.slidercontrol ol li:first').addClass('selected');
	
	// !FIXME! 1. We aren't supporting IE6 anymore. 2. We need to get arrow.png from the appropriate domain (live points to staging!)
	if(typeof document.body.style.maxHeight === "undefined") {
		//check for IE6
		$('.slidercontrol ol').css({'background': 'url("'+media_url+'css/images/arrow.gif") no-repeat 0 0.45em'});
	} else {
		$('.slidercontrol ol').css({'background': 'url("'+media_url+'css/images/arrow.png") no-repeat 0 0.45em'});
	}

	/*if (!($.browser.msie)) {
		$('<style type="text/css"> .banner > .slidercontrol, .slide > .right { -moz-border-radius: 10px; -webkit-border-radius: 10px;}' +
		//'#feedbacklink {	-moz-border-radius-bottomleft: 10px; -moz-border-radius-bottomright: 10px; -webkit-border-bottom-right-radius: 10px; -webkit-border-bottom-left-radius: 10px; }' +
		'</style>').appendTo($('head'));
	}*/

	$('.slidercontrol ol').removeClass('no-js');

	hoverColor = '#1f415c';
	selectColor = $('.slidercontrol ol li.selected').css('color');
	normalColor = $('.slidercontrol ol li:not(.selected)').css('color')

	
	$('.slidercontrol li').hover(
		function() {
			if ($(this).attr('class') != 'selected') {
				$(this).animate({color: hoverColor}, 250);
				$(this).children().animate({color: hoverColor}, 250);
			}
		},
		function() {
			if ($(this).attr('class') != 'selected') {
				$(this).animate({color: normalColor}, 250);
				$(this).children().animate({color: normalColor}, 250);
			}
		}
	);
	

	$('.slider').scrollTo($('#prepareslide'), 500);

	$('.slidercontrol li').click(function() {
		link_id = $(this).children().attr('id');
		if(link_id == 'preparelink') {
			num = 1;
		} else if(link_id == 'runlink') {
			num = 2;
		} else if(link_id == 'monitorlink') {
			num = 3;
		}
		$('.slider').scrollTo($('#'+link_id.replace('link', 'slide')), 500);
		num = 0.50 + (num-1)*2.10;
		$('.banner ol').animate({backgroundPosition: '(0 ' + num + 'em)'}, 250);
		$('.banner ol li.selected a').animate({color: normalColor}, 250);
		$('.banner ol li.selected').animate({color: normalColor}, 250).animate({color: normalColor}, 250).removeClass('selected');
		$(this).animate({color: selectColor}, 250).addClass('selected');
		$(this).children().animate({color: selectColor}, 250);
	})

});
