// console.log('jQuery is working.');

/* On Loads */

removeBodyHorizontalOverflow();
initSliders();

/**
 * form functionality
 */
$("form .dynamic").focus(function() {
	if ($(this).val() == $(this).attr("title")) $(this).val('');
	$(this).css('color', '#222');
});

$("form .dynamic").blur(function() { 
	if ($(this).val() == '') $(this).val($(this).attr("title"));
	$(this).css('color', '#888');
});

/* support functions */	

function initSliders() {
	$(".slider .slider-content").hide(); // hide all slider(s) initially

	$('a.slider-toggle').toggle( // toggle slider text and show/hide related content
		function(){
	 		$(this).text('Show Less').addClass('less');
	 		$(this).parents('.slider').find('.slider-content').slideDown("slow");
		}, 
		function () {
			$(this).text('Show More').removeClass('less');
			$(this).parents('.slider').find('.slider-content').slideUp("slow");
		}
	);
}

function removeBodyHorizontalOverflow() {
  $("body").css("overflow-x", "hidden");
}
