/*************************** Lightbox ***************************/


jQuery(document).ready(function(){
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'light_square'
	});
});


/*************************** Accordion Links ***************************/


jQuery(document).ready(function(){
	lastBlock = jQuery(".page_item li:last");
	indexMaxWidth = 170;
	indexMinWidth = 150;	
	jQuery("#index-nav ul li a").hover(
	function(){
		jQuery(lastBlock).animate({width: indexMinWidth+"px"}, { queue:false, duration:400 });
		jQuery(this).animate({width: indexMaxWidth+"px"}, { queue:false, duration:400});
		lastBlock = this;
	},
	function() {
		jQuery(this).animate({width: indexMinWidth+"px"}, { queue:false, duration:400 });
	}
	);
});

jQuery(document).ready(function(){
	lastBlock = jQuery(".page_item li:last");
	mainMaxWidth = 130;
	mainMinWidth = 100;	
	jQuery("#main-nav ul li a").hover(
	function(){
		jQuery(lastBlock).animate({width: mainMinWidth+"px"}, { queue:false, duration:400 });
		jQuery(this).animate({width: mainMaxWidth+"px"}, { queue:false, duration:400});
		lastBlock = this;
	},
	function() {
		jQuery(this).animate({width: mainMinWidth+"px"}, { queue:false, duration:400 });
	}
	);
});


/*************************** Collapsible Content ***************************/


jQuery(document).ready(function () {
jQuery('.toggle-button').toggle(
function() {
jQuery(this).parent().siblings('#toggle-box').slideToggle('fast');
},
function() {
jQuery(this).parent().siblings('#toggle-box').slideToggle('fast');
});
});


/*************************** Image Hover ***************************/

   
jQuery(document).ready(function(){
    jQuery(".image-rollover, .video-rollover").css({'opacity':'0'});
	jQuery('.slider-image').hover(
		function() {
			jQuery(this).find('.image-rollover, .video-rollover').stop().fadeTo(500, 0.8);
		},
		function() {
			jQuery(this).find('.image-rollover, .video-rollover').stop().fadeTo(500, 0);
		}
	)
});


/*************************** Contact Form ***************************/


jQuery(document).ready(function(){
	
	jQuery('#contactform').submit(function(){
	
		var action = jQuery(this).attr('action');
		
		jQuery("#message").slideUp(750,function() {
		jQuery('#message').hide();
		
 		jQuery('#submit')
			.after('<div class="loader"> </div>')
			.attr('disabled','disabled');
		
		jQuery.post(action, { 
			name: jQuery('#name').val(),
			email: jQuery('#email').val(),
			subject: jQuery('#subject').val(),
			comment_box: jQuery('#comment_box').val(),
			verify: jQuery('#verify').val()
		},
			function(data){
				document.getElementById('message').innerHTML = data;
				jQuery('#message').slideDown('slow');
				jQuery('#contactform div.loader').fadeOut('slow',function(){jQuery(this).remove()});
				jQuery('#contactform #submit').attr('disabled',''); 
				if(data.match('success') != null) jQuery('#contactform').slideUp('slow');
				
			}
		);
		
		});
		
		return false; 
	
	});
	
});
