// <![CDATA[
$(document).ready(function()
{
	//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
	$("#firstpane p.menu_head").click(function()
    {
		$(this).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
       	//$(this).siblings().css({backgroundImage:"url(../images/left.png)"});
	});
	Galleria.loadTheme('../galleria/themes/classic/galleria.classic.min.js');
	// Initialize Galleria
	$('#galleria').galleria({
		autoplay: 4000, // will move forward every 4 seconds
		preload: '4',
		transition:'flash',
		transitionSpeed:1000,
		imagecrop: true,
		showImagenav: true,
		showInfo:false,
		showCounter:false,
		imageMargin:5,
		thumbMargin:5,
		extend: function() {
            this.bind(Galleria.IMAGE, function(e) {
                // bind a click event to the active image
                $(e.imageTarget).css('cursor','pointer').click(this.proxy(function() {
                    // open the image in a lightbox
                    this.openLightbox();
                }));
            });
		}
	}); 
});
// ]]>

// <![CDATA[
jQuery(document).ready(function(){
	$('#contactform').submit(function(){				  
		var action = $(this).attr('action');
		$.post(action, { 
			name: $('#name').val(),
			email: $('#email').val(),
			phone: $('#phone').val(),
			subject: $('#subject').val(),
			message: $('#message').val()
		},
			function(data){
				$('#contactform .right_align #submit').attr('disabled','');
				$('.response').remove();
				$('#contactform').before('<p class="response">'+data+'</p>');
				$('.response').slideDown();
				if(data=='Message sent!') $('#contactform').slideUp();
			}
		); 
		return false;
	});
});
// ]]>
