$(function () {
	if ($("#homepage-banners").length)
	{
		$("#homepage-banners ul").innerfade({
			speed: 'slow',
			timeout: 4000
		});
	}
	// terribly bad form, but designers like it ;(
	$("a").focus (function () {$(this).blur()});
	if ($(".lightbox").length)
	{
		$(".lightbox").fancybox();
	}

	$anchors = $("#subnav a[href=#]");
	$anchors.each (function () {
		if (!$(this).parent().hasClass('active'))
		{
			$(this).next().hide();
		}
		$(this).click (function () {
			if ($(this).next().is(':hidden'))
			{
				$anchors.each(function () { $(this).parent().removeClass('active')});
				$(this).parent().addClass('active');
				$("#subnav ul ul").slideUp();
				$(this).next().slideDown();
			}
			else
			{
				$(this).parent().removeClass('active');
				$(this).next().slideUp();
			}
			return false;
		});
	});
	if ($(".news-container").length)
	{
		$(".news-illustration").each (function () {
			$(this).css('cursor', 'pointer');
			$(this).click (function () {
				window.location = $(this).next().find("a").attr('href');
			});
		});
	}
	$("#payment_selection").change (function () {
		switch ($(this).selectedIndex)
		{
			case 0:
				$("#amount").val(305);
				break;
			case 1:
				$("#amount").val(275);
				break;
			case 2:
				$("#amount").val(579.50);
				break;
			case 3:
				$("#amount").val(522.50);
				break;
			case 4:
				$("#amount").val(854);
				break;
			case 5:
				$("#amount").val(770);
				break;
		}
		$("#item_name").val($(this).find("option:eq(" + $(this)[0].selectedIndex + ')').html());
	});
});



