$(document).ready(function() 
{
	$('#myform1').ajaxForm({ 
			target: '#responsediv',
			beforeSubmit: showSpinner
	}); 
});

function showSpinner() { 
	var $out = $('#responsediv');
	$out.html("<p class=\"center spinner\"><img src=\"/img/site/spinner.gif\" alt=\"Spinner\" /></p>");
	return true; 
} 

///////////////////////////////////////////////////////////////////////

$(document).ready(function() 
{
	$m = $("#lhs > ul > li:eq("+$menuItem+") > ul");
	$m.show();
	$m.prev().addClass("on");
	
	$("#lhs ul li span").toggle(
		function () {
			$(this).next().slideDown();
			$(this).addClass("on");
		},
		function () {
			$(this).next().slideUp();
			$(this).removeClass("on");
		}
	);
	
	$("dl dt").toggle(
		function () {
			$(this).next().slideDown();
			$(this).addClass("on");
		},
		function () {
			$(this).next().slideUp();
			$(this).removeClass("on");
		}
	);



	var headers = new Array("hf01", "hf02");
	i = Math.floor(Math.random()*headers.length);
	$("#header-flash").removeClass("hf01").addClass(headers[i]);

	$('#header-home').cycle({ 
		fx:     'fade', 
		speed:	1000,
		timeout: 4000
	});

	$('#theads').cycle({ 
		fx:     'scrollHorz', 
		speed:	200,
		timeout: 5000,
		next:   '#buttNext',
		prev:   '#buttPrev',
		pause:  1
	});
	
	$("a.ext").click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
});
