// JavaScript Document

$(document).ready(function() {


     // MENU DROPDOWNS
     $('.xhdr').mouseover(function() {	
		 $('#pcompany').hide();
         $('#psolutions').hide();
		 $('#pnewsevents').hide();
		 $('#presourcecenter').hide();
		 $('#pconnect').hide();
		 });



     // COMPANY DROPDOWN
     $('li#ncompany').mouseover(function() {
		  $('#pcompany').animate({ opacity: 1, height: 'show'}, 0, function() { });
		  $(".ncompany").css('background-position', '0px -100px');  
          $('#psolutions').hide();
		  $('#pnewsevents').hide();
		  $('#presourcecenter').hide();
		  $('#pconnect').hide();
     });
     $('li#ncompany').mouseleave(function() {
          $('#pcompany').hide();
		  $(".ncompany").css('background-position', '0px 0px'); });
	 

	 // SOLUTIONS DROPDOWN
     $('li#nsolutions').mouseover(function() {
		  $('#pcompany').hide();
          $('#psolutions').animate({ opacity: 1, height: 'show'}, 0, function() { });
		  $(".nsolutions").css('background-position', '-155px -100px');  
		  $('#pnewsevents').hide();
		  $('#presourcecenter').hide();
		  $('#pconnect').hide();
     });
     $('li#nsolutions').mouseleave(function() {
          $('#psolutions').hide();
		  $(".nsolutions").css('background-position', '-155px 0px');  });
	 
	 
	 // NEWS & EVENTS DROPDOWN
     $('li#nnewsevents').mouseover(function() {
		  $('#pcompany').hide();
          $('#psolutions').hide();  
		  $('#pnewsevents').animate({ opacity: 1, height: 'show'}, 0, function() { });
		  $(".nnewsevents").css('background-position', ' -312px -100px'); 
		  $('#presourcecenter').hide();
		  $('#pconnect').hide();
     });
     $('li#nnewsevents').mouseleave(function() {
          $('#pnewsevents').hide();
		  $(".nnewsevents").css('background-position', ' -312px 0px'); });
	 
	 
	  // RESOURCE CENTER DROPDOWN
     $('li#nresources').mouseover(function() {
		  $('#pcompany').hide();
          $('#psolutions').hide();  
		  $('#pnewsevents').hide();
		  $('#presourcecenter').animate({ opacity: 1, height: 'show'}, 0, function() { });
		  		  $(".nresources").css('background-position', '  -510px -100px'); 
		  $('#pconnect').hide();
     });
     $('li#nresources').mouseleave(function() {
          $('#presourcecenter').hide();
		  $(".nresources").css('background-position', ' -510px 0px'); });
	 
	 
	  // CONNECTS DROPDOWN
     $('li#nconnect').mouseover(function() {
		  $('#pcompany').hide();
          $('#psolutions').hide();  
		  $('#pnewsevents').hide();
		  $('#presourcecenter').hide(); 
		  $('#pconnect').animate({ opacity: 1, height: 'show'}, 0, function() { });
		  $(".nconnect").css('background-position', '  -723px -100px'); });
     		
		  $('li#nconnect').mouseleave(function() {
          			$('#pconnect').hide();
		 			 $(".nconnect").css('background-position', ' -723px 0px');});
		  


     });


/* start jQuery Tabs for Solutions Drop Down Panel */
		$(document).ready(function(){
			$('#tabs div').hide();
			$('#tabs div:first').show();
			$('#tabs ul li:first').addClass('active');
			$('#tabs ul li a.btab').click(function(){ 
				$('#tabs ul li').removeClass('active');
				$(this).parent().addClass('active'); 
				var currentTab = $(this).attr('href'); 
				$('#tabs div').hide();
				$(currentTab).show();
				return false;
			});
		});




$(document).ready(function(){
		$(".featured-solutions img").fadeTo(0, .7); // This sets the opacity of the thumbs to fade down to 70% when the page loads

		$(".featured-solutions img").hover(function(){
		$(this).stop().fadeTo(200, 1); // This should set the opacity to 100% on hover
		},function(){
		$(this).stop().fadeTo(500, 0.7); // This should set the opacity back to 70% on mouseout
		
		});
});



// BUTTON POPUP
$(document).ready(function(){
     $('.global-nav').mouseover(function() {	 
          $('#popneed').fadeOut(100);
          $('#poporganization').fadeOut(100);
		  $('#poprole').fadeOut(100);
       });
	 /* START Organization */
     $('#button-organization').click(function() {
         $('#poporganization').fadeIn(100);
          $('#poprole').fadeOut(100);
		  $('#popneed').fadeOut(100);
        });
	 
     $('.popclose').click(function() { 
          $('#poporganization').fadeOut(100);
          $('#poprole').fadeOut(100);
		  $('#popneed').fadeOut(100);
       });

	 /* END Organization */
	 /* START Role*/
		  $('#button-role').click(function() {
		  $('#poprole').fadeIn(100);
          $('#poporganization').fadeOut(100);
		  $('#popneed').fadeOut(100);
        });
	 
     $('.popclose').click(function() { 
          $('#poprole').fadeOut(100);
          $('#poporganization').fadeOut(100);
		  $('#popneed').fadeOut(100);
       });
	 /* END Role*/
	 /* START Need */
		  $('#button-need').click(function() {
		  $('#popneed').fadeIn(100);
          $('#poporganization').fadeOut(100);
		  $('#poprole').fadeOut(100);
        });
	 
     $('.popclose').click(function() { 
          $('#popneed').fadeOut(100);
          $('#poporganization').fadeOut(100);
		  $('#poprole').fadeOut(100);
       });
	 /* END Need */
		
});



