	(function($){
		$.fn.clearDefault = function(){
			return this.each(function(){
				var default_value = $(this).val();
				$(this).focus(function(){
					if ($(this).val() == default_value) $(this).val("");
				});
				$(this).blur(function(){
					if ($(this).val() == "") $(this).val(default_value);
				});
			});
		};
	})(jQuery);


$(document).ready(function() {

		
	/* 	EXTERNAL LINKS
		-------------------------------------------------------------*/
					
		
		$("a.external").click( function() {
			window.open( $(this).attr("href") );
			return false;
		});
		
		
		 		
 		 $('a.external').qtip({
			content: '<p>You are now leaving the Global Defense Technology &amp; Systems, Inc. (GTEC) Web site.  GTEC is not responsible for the content of this external site and does not monitor this site.  This link will take you to a website that may have different privacy, security and accessibility policies than the GTEC website.</p>',
			show: 'mouseover',
			hide: 'mouseout',
			position: {
				corner: {
					target: 'topMiddle',
					tooltip: 'bottomMiddle'
					}
				},
			style: { 
				padding: 5,
				background: '#296DA6',
				color: '#ffffff',
				textAlign: 'center',
				border: {
					width: 2,
					radius: 5,
					color: '#004B8B'
					},
				width: 300
			}
		});
			
			

	/* 	DROP DOWN NAV
		----------------------------------------------------------*/
		
		$("ul.structure > li").addClass("dropdown");
		
		$('#main_nav li.dropdown').hover(function() {
			$(this).children('a:first-child').addClass('hovering');
			$(this).children('ul').show();
		}, function() {
			$(this).children('a:first-child').removeClass('hovering');
			$(this).children('ul').hide();			
		});	
		
		
		
	/* 	SUB NAV
		----------------------------------------------------------*/
		
		
		
		
	/* 	NEWS/EVENTS TABS
		----------------------------------------------------------*/
		
		$('.tEvents').hide();
			
		$('.switches a').click(function() {
			if($(this).parent().hasClass('on')) return false;				
			var clickedTab = $(this).parent().attr('id');
			$('.switches li').removeClass('on');
			$(this).parent().addClass('on');
			$('.tab').fadeOut('fast');
			$('.'+clickedTab).fadeIn('fast');				
			return false;
		});
		
		
	
	/* 	SHOW/HIDE
		----------------------------------------------------------*/

		//$("ul.accordion ul").hide();
		//$("ul.accordion li a").click(function() {
		//	$(this).next("ul").toggle();
		//	$(this).toggleClass("open")
		//	return false;
		//});
		
		
		$("h2 a.accordion").parent().nextUntil("h2").hide();
		$("h2 a.accordion").click(function() {
			$(this).parent().nextUntil("h2").slideToggle("fast");
			$(this).toggleClass("open")
			return false;
		});
		
		
		$("h3 a.accordion").parent().nextUntil("h3").hide();
		$("h3 a.accordion").click(function() {
			$(this).parent().nextUntil("h3").slideToggle("fast");
			$(this).toggleClass("open")
			return false;
		});
				
		
		$("div.peoplelist li div").hide();
		$("div.peoplelist h3").click(function() {
			$(this).siblings("div").slideToggle("fast");
			return false;
		});
		
		


	/*	CLEAR INPUT FIELDS ONFOCUS
		-------------------------------------------------------------*/
		
	    $('input.clearinput').clearDefault();
	    
	        
    
	    
	/*	FLASH HEADER
		-------------------------------------------------------------*/
	    
		$(".feature").flash(
			{
				swf: "assets/flash/gtec_var0_var1.swf",
				height: 245,
				width: 669,
				play: true,
				flashvars: {
					var0: "_function/banner_intro/",
					var1: "_function/banner/"
				}
			}
		);
		
		
		
	/*	Footer jQuery popup
		-------------------------------------------------------------
		
		$('.employeeaccess > ul > li > ul').hide();
		$('.employeeaccess > ul > li').hover(function() {
			$(this).addClass('on');
			$('.employeeaccess > ul > li > ul').show();					
		}, function() {
        		$(this).removeClass('on');
        		$('.employeeaccess > ul > li > ul').hide();
      	});
		
	*/	
	

	});
