
$(document).ready(function(){
	// signup function
	function verifyRequired() {
		if (document.icpsignup["fields_fname"].value == "") {
			document.icpsignup["fields_fname"].focus();
			alert("The First Name field is required.");
			return false;
		}
		if (document.icpsignup["fields_email"].value == "") {
			document.icpsignup["fields_email"].focus();
			alert("The Email Address field is required.");
			return false;
		}
			return true;
	};
	// slide out of social links
	$('#slideout > li').hover(function () {
		$('a',$(this)).stop().animate({'marginLeft':'-8px'},200).fadeTo('fast', 1);
			},
		function () {
			$('a',$(this)).stop().animate({'marginLeft':'0'},200).fadeTo('fast', 0.5);
		}
	);
	// main navigation drop menus
	$('.drop-menu-trigger').mouseover(function() {
		$(this).addClass('selected');
		$(this).children('.nav-item').addClass('selected');
		$(this).children('.dropdown-menu').addClass('show');
	});
	$('.drop-menu-trigger').mouseout(function() {
		$(this).removeClass('selected');
		if ($(this).children('.nav-item').not('active')) {
			$(this).children('.nav-item').removeClass('selected');
		}
		$(this).children('.dropdown-menu').removeClass('show');
	});
});

jQuery().ready(function(){
	// second simple accordion with special markup
	jQuery('#navigation').accordion({
		active: false,
		header: '.head',
		navigation: true,
		autoHeight: true,
		event: 'mouseover',
		fillSpace: false,
		animated: 'easeslide',
		collapsible: true,
		icons: { 'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' }
	});	
	// bind to change event of select to control first and seconds accordion
	// similar to tab's plugin triggerTab(), without an extra method
	var accordions = jQuery('#list1a, #list1b, #list2, #list3, #navigation, #wizard');	
	jQuery('#switch select').change(function() {
		accordions.accordion("activate", this.selectedIndex-1 );
	});
	jQuery('#close').click(function() {
		accordions.accordion("activate", -1);
	});
	jQuery('#switch2').change(function() {
		accordions.accordion("activate", this.value);
	});
	jQuery('#enable').click(function() {
		accordions.accordion("enable");
	});
	jQuery('#disable').click(function() {
		accordions.accordion("disable");
	});
	jQuery('#remove').click(function() {
		accordions.accordion("destroy");
		wizardButtons.unbind("click");
	});		
	// removes display none from the ul of active menu item
	$('li.selected ul').css("display","block");
});

