jQuery(document).ready(function() {

	jQuery('#reg-form .formleft #login_right').remove('#login_right');
	jQuery('body.home-2 ul.pagenav').remove('ul.pagenav');
	jQuery('body.welcome ul.pagenav').remove('ul.pagenav');

	jQuery("ul.sf-menu").superfish({
		autoArrows: true,
		pathLevels: 2,
		delay: 1200,
		animation: {opacity:'show',height:'show'},
		dropShadows: true
	});

	jQuery(".toggle-contents").hide();
	jQuery(".toggle-button").click(function() {
		jQuery(this).toggleClass("open").next(".toggle-contents").toggle("fast");
		return false;
	});
	
		function toggleHover() {
		jQuery(this).find('.toggle-contents-cat').animate({
			height: jQuery(this).find('.toggle-contents-cat').data('baseheight'),
			paddingBottom: '0px'
		}, 200 );
	}
	function toggleLeave() {
		jQuery(this).find('.toggle-contents-cat').animate({
			height: '0',
			paddingBottom: '0px'
		}, 200 );
	}
	jQuery('.toggle-contents-cat').each(function(index) {
		jQuery(this).data('baseheight', jQuery(this).height());
		jQuery(this).css({
			height: 0,
			paddingBottom: 0,
			top: "100%"
		});
	});
	
	jQuery('.toggle-block').hoverIntent({
		over: toggleHover,
		out: toggleLeave,
		timeout: 1000
	});

	jQuery('.dropdown > a').click(function() {
		return false;
	});
	
	/*
jQuery(".toggle-content-cat").hide();
	jQuery(".toggle-button-cat").mouseover(function() {
		jQuery(this).toggleClass("open").next(".toggle-content-cat").toggle("fast");
	}).mouseleave(function() {
		jQuery(this).toggleClass("open").next(".toggle-content-cat").toggle("fast");
	});
*/
	
	 $(".fade").fadeTo(1, 1);
     $(".fade").hover(
        function () {
          $(this).fadeTo("fast", 0.6);
        },
        function () {
          $(this).fadeTo("slow", 1);
        }
    ); 

 /*
	$("#foo1").carouFredSel();
	
	$("#foo1 a").fancybox({
		cyclic	: true,
		onStart	: function() {
			$("#foo1").trigger("pause");
		},
		onClosed: function() {
			$("#foo1").trigger("play");
		}
*/

	jQuery('.rotating-clients').cycle({
		fx: 'fade',
		timeout: 6000,
		delay: 2500
	});

	
	jQuery('.featured-slider-contents').cycle({
		fx: 'fade',
		timeout: 6000,
		delay: 3000,
		pause: true,
		slideExpr: 'div.slide-img',
		pager: '#nav-featured-slider'/*
,
		before:  onBefore,
		function onBefore() { 
			$('#slide-title').html("Dynamic Slider Title"); 
		}
*/
	});

	jQuery(".lightbox").fancybox({
		cyclic: true,
		scrolling: 'auto',
		titleShow: true,
		titlePosition: 'over',
		onComplete: function() { 
			$("#fancybox-title").css({'top':'-40px', 'bottom':'auto'}); 
		},
		modal: false,
		padding: 0,
		margin: 0,
		//width: 350,
		//height: 275,
		opacity: true,
		autoScale: true,
		autoDimensions: true,
		centerOnScroll: true,
		hideOnOverlayClick: true,
		hideOnContentClick: true,
		overlayShow: true,
		overlayColor: '#333',
		transitionIn: 'elastic',
		transitionOut: 'elastic',
		speedIn: 400,
		speedOut: 100

	});

});

jQuery('.answer').hide();
jQuery('.question').click(function(){
	//$(this).next().toggle();
	jQuery('.answer').slideUp('normal');
	jQuery(this).next().slideToggle(400);
	return false;
});


/*
jQuery("#foo1").carouFredSel({
	scroll	: 2
});
*/

