//	Namespace for any global vars
var HYDRA	=	{};


function AddActiveState(dept) {
    $('.' + dept).addClass("active");
}

//	when the document has loaded
$(document).ready( function(){
	
	////////////////////////////////////////////////////////////////////////////////////////
	//
	//	if there is a color picker on the page, initialize it
	//
	if( document.getElementById('colorpicker') )
	{
		$('#colorpicker').farbtastic('#color');
		if (someMethod())
		    someMethod();
	}
	
	
	
	////////////////////////////////////////////////////////////////////////////////////////
	//
	//	show and hide accordian menus for press, faq pages
	//
	$('.headline > a').click( function()
	{
		var cc	=	$(this);

		if (  cc.attr('rel') == 'open')
		{
			cc.css('background-color', '');
		}
		
		if ( cc.attr('rel') == 'closed' || !cc.attr('rel') )
		{
			cc.css('background-color', '#E7E7E7');
			cc.css('border-bottom', 'none');
		}
		
		$(this).parent().next().slideToggle( function() 
		{
			if ( cc.attr('rel') == 'open') 
			{
				cc.css('background-color', '#FFF');
				cc.attr('rel', 'closed')
				cc.css('background-image', 'url(img/icon_boxed_arrow_down.gif)');
				cc.css('border-bottom', '#c3c3c3 1px solid');
			}
			else 
			{
				cc.attr('rel', 'open')
				cc.css('background-image', 'url(img/icon_boxed_arrow_up.gif)');
			}
		});

		return false;
	});
	
	
	
	////////////////////////////////////////////////////////////////////////////////////////
	//
	//	switches out main sidebar navigation with step 2 once a department is chosen
	//
	if ( document.getElementById('main_nav') )
	{
		$('#main_nav > li > a').click( function()
		{
			//$('#department').val( $(this).attr('class') )
            var dept = $(this).attr('class');
            $('#InputForm_department').children("option").each(function() {
                if ( $(this).val() == dept ) {
                    $(this).attr("selected","selected");
                }
            });
		
			$('#step_1').hide();
			$('#step_2').show();
		
			return false;
		});
	
	
		$('#nav_return').click( function()
		{
			$('#step_1').show();
			$('#step_2').hide();

			return false;
		});
		
		
	}

	
	
	
	////////////////////////////////////////////////////////////////////////////////////////
	//
	//	testimonials redirects for <select> options
	//
	
	$('#test_type').change( function(){
		switch( $(this).val() )
		{			
		case '1':
			location.replace('/testimonials_advertising.aspx');
			break;
			
		case '2':
			location.replace('/testimonials_design.aspx');
			break;	
				
		case '3':
			location.replace( '/testimonials_marketing.aspx');
			break;	
			
		case '4':
			location.replace('/testimonials_pr.aspx');
			break;
		
		case '5':
			location.replace('/testimonials_interactive.aspx');
			break;
		
		case '6':
			location.replace('/testimonials_in-house.aspx');
			break;
		}
			
	})
	
	
	
	
});	//	end $(document).ready()






