//mw3 var jQuery = jQuery.noConflict();
 
jQuery(document).ready(function() {
	
/*---- Superfish drop-down ----*/
	
		jQuery(document).ready(function() { 
			jQuery('#nav').superfish({ 
				delay:       1000,          
				animation:   {opacity:'show',height:'show'},
				speed:       'fast',                  
				autoArrows:  false,                     
				dropShadows: true
			}); 
		});
		
/*---- Cycle slider ----*/

	jQuery('.slider').cycle({ 
		fx:     'fade', 
		speed:  1000,
		timeout: 6000,
		pause: 1,
		pager: '.slide-numbers'
	});
	
/*---- Toggle ----*/
	
	jQuery('.toggle h4').each( 
		function () {
			
			var iHeight = jQuery(this).closest('.toggle').find('.inner').height();
			var ipaddingTop = jQuery(this).closest('.toggle').find('.inner').css('padding-top');
			var ipaddingBottom = jQuery(this).closest('.toggle').find('.inner').css('padding-bottom');
			
			jQuery(this).toggle( 
				function () {
					
					imageURL = jQuery(this).find('span').attr('class');
					
					jQuery(this)
					.closest('.toggle')
					.find('.inner')
					.animate({height: 0, paddingTop: 0, paddingBottom: 0, opacity: 0 }, 200, 'jswing');
					jQuery(this)
					.find('span')
					.css('background', 'url('+ imageURL +'/images/toggle-sprite.png) 25px 12px');
				},
				function () {
					
					jQuery(this)
					.closest('.toggle')
					.find('.inner')
					.animate({height: iHeight, paddingTop: ipaddingTop, paddingBottom: ipaddingBottom, opacity: 1}, 200, 'jswing');
					
					jQuery(this)
					.find('span')
					.css('background', 'url('+ imageURL +'/images/toggle-sprite.png) 12px 12px');
				}
			);
		}
	);
	
/*---- Tabs ----*/
	
	if(jQuery().tabs) {
		jQuery(".tabs, .tour").tabs({ 
			fx: { opacity: 'toggle', duration: 200} 
		});
	}

/*---- prettyPhoto lightbox ----*/
	
		jQuery(document).ready(function(){
		jQuery("a[rel^='prettyPhoto']").prettyPhoto({
			theme: 'dark_square',
			autoplay: true,
			show_title: false
			});
		});
		
/*---- Form validation ----*/

	jQuery(document).ready(function(){
			jQuery("#contactform").validate();
		});
		
/*---- Tipsy tooltips ----*/

	jQuery(function() {
		jQuery('a[rel=tipsy]').tipsy({fade: true, gravity: 's'});
	});

});

