// Fireup the plugins
jQuery(document).ready(function () {
  jQuery(".fancybox").fancybox({
    'titlePosition': 'inside',
    'overlayColor': '#aaa',
    'overlayOpacity': '0.5',
    'hideOnContentClick': 'true',
    'speedIn': '100',
    'speedOut': '100',
    'transitionIn': 'fade',
    'transitionOut': 'elastic'
  });

  jQuery("ul.sf-menu").superfish({
		autoArrows: false,
		speed: 250,
		animation: {
			height: "show"
		}
	});

	//mobile select menu
	jQuery("#mobileselect").mobileMenu({
		switchWidth: 600, // at what size to begin showing the select box
		indentString: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
		topOptionText: "Navigation"
	});

	//login
	jQuery("#feloginbox").hide();
	jQuery(".feloginshow").click(function () {
		jQuery("#feloginbox").slideToggle("slow");
		jQuery(this).toggleClass("active");
	});

	//languages
	jQuery(".languages").hide();
	jQuery(".languageshow").click(function () {
		jQuery(".languages").slideToggle();
		jQuery(this).toggleClass("active");
	});

	//set the link
	jQuery(".totop a,.csc-linkToTop a").click(function () {
		jQuery("body,html").animate({
			scrollTop: 0
		}, 800);
		return false;
	});

	jQuery(".showmore").on("click", function () {
		jQuery(this).closest(".frame-custom-40").toggleClass("shorten").toggleClass("opened");
	});

  jQuery(".showmore").on("click", function () {
    jQuery(this).closest(".frame-custom-41").toggleClass("shorten").toggleClass("opened");
  });
});

jQuery(window).on("load", function() {
	jQuery(".flexslider").flexslider({
		slideshowSpeed: 8000
	});
});

