$(function ()
{
	$('#overlay').hide();
	$('#formoverlay').hide();
	$('#qformenlogin').hide();
	$('#googlemap').hide();			
	$('.scrollable').scrollable(
	{
		size: 2
	});

	
	$('#nav-bg a').click(
		function(e)
		{
			e.preventDefault();
			var img = $(this).attr('href');
			$('#wrap').css('background-image', 'url(' + img + ')');
		}
	);
	

	
	
	$('#overlayTrigger').click(
		function(e)
		{
			$('#qformenlogin').hide();
			$('#content').show();
			$('#cols').hide();
			$('#formoverlay').hide();			
			$('#wrap').addClass('full');
			$('#overlay').show();
		}
	);
	
	$('.newsTrigger').click(
		function(e)
		{

			            $.get("/newsitem.asp", { id: $(this).attr("id")},
            function(data){
            $("#newsitem").html(data);
            });  
			$('ul#nav-sub').hide();
			$('#qformenlogin').hide();
			$('#content').show();
			$('#cols').hide();
			$('#formoverlay').hide();	
			$('#wrap').addClass('full');
			$('#overlay').show();
		}
	);

	
		$('#formOverlayTrigger').click(
		function(e)
		{
			$('h2').hide();
			$('#content').hide();
			$('#cols').hide();
			$('#overlay').hide();
			$('#wrap').addClass('full');
			$('#formoverlay').show();
			$('#qformenlogin').hide();			
		}
		
	);

		$('#mainFormTrigger').click(
		function(e)
		{
			$('#googlemap').hide();
			$('#mainform').show();			
		}	
	);
	
		$('#googleTrigger').click(
		function(e)
		{
			$('#googlemap').show();
			$('#mainform').hide();			
		}	
	);



		$('#qLogin').click(
		function(e)
		{
			$('#content').show();
			$('#cols').hide();
			$('#overlay').hide();
			$('#wrap').addClass('full');
			$('#qformenlogin').show();
			$('#formoverlay').hide();	
		}
	);


	$('#closeform').click(
		function(e)
		{
			$('#content').show();
			$('#overlay').hide();
			$('#wrap').removeClass('full');
			$('#cols').show();
			$('#formoverlay').hide();
			$('#qformenlogin').hide();				
		}
	);	
	
	$('.close').click(
		function(e)
		{
			$('#overlay').hide();
			$('#wrap').removeClass('full');
			$('#cols').show();
						$('ul#nav-sub').show();
		}
	);
});
