/* [%-# @(#)jquery.togglecontent.js	1.1 08:44:38,08/11/27 (yy/mm/dd) -%] */
/**
 * @author justin.perry
 * Tab <script>
 */
$(document).ready(function(){
	// Hide all tabs
	$('#mainContent .tabs div.tab').hide();
	
	// Show default tab
	$('#mainContent .tabs div.tab:first').show();
	
	// Set active default tab class
	$('#mainContent .tabs .tabLink:first').addClass('active');
	
	// Class added for formatting items when JS enabled
	$('#mainContent .tabs').addClass('jsOn');
	
	// Watch for click
	$('#mainContent .tabLink').click(function(){
		
		// Remove active class from all links 
		$('#mainContent .tabs .tabLink').removeClass('active');
		
		// Add active class to current link
		$(this).addClass('active');
		
		// Traverse clicked link, find parent, and hide all child tabs within that tabs div
		//$(this).parents('.tabs').children("div.tab").hide();
		$('#mainContent .tabs div.tab').hide(); // Use this option for global hiding of child tabs
		
		// Assign selected href tab reference to variable
		var currentTab = $(this).attr('href');
		
		// Show selected tab
		$(currentTab).show();
		return false;
	});
});
$(document).ready(function(){
	// Hide all tabs
	$('#subContent .tabs div.tab').hide();
	
	// Show default tab
	$('#subContent .tabs div.tab:first').show();
	
	// Set active default tab class
	$('#subContent .tabs .tabLink:first').addClass('active');
	
	// Class added for formatting items when JS enabled
	$('#subContent .tabs').addClass('jsOn');
	
	// Watch for click
	$('#subContent .tabLink').click(function(){
		
		// Remove active class from all links 
		$('#subContent .tabs .tabLink').removeClass('active');
		
		// Add active class to current link
		$(this).addClass('active');
		
		// Traverse clicked link, find parent, and hide all child tabs within that tabs div
		//$(this).parents('.tabs').children("div.tab").hide();
		$('#subContent .tabs div.tab').hide(); // Use this option for global hiding of child tabs
		
		// Assign selected href tab reference to variable
		var currentTab = $(this).attr('href');
		
		// Show selected tab
		$(currentTab).show();
		return false;
	});
});
/**
 * @author justin.perry
 * Toggle <div>
 */
$(document).ready(function(){	
	$("#advancedSearch").hide();
	// Watch for click
	$("#advancedSearchToggle").click(function(event) {
	event.preventDefault();
	
	// Find current text of link so we can toggle it...
	var strLinkText = $(this).text().toString()
	var defaultText = "More Search Options"
	var toggledText = "Less Search Options"			
	
	// Check text then swap out
	if(strLinkText==toggledText){
		$(this).text(defaultText)
		$(this).removeClass('toggled')
		$(".advancedSearch").removeClass('advbgchange');
		}
	else{
		$(this).text(toggledText)
		$(this).addClass('toggled')
		$(".advancedSearch").addClass('advbgchange');
	
	}
	
	// Show box
	$("#advancedSearch").slideToggle();
	});	
});

