// BACKGROUND POSITION FIX

$(document).ready(resizeWindow);
$(window).bind("resize", resizeWindow);
	function resizeWindow( e ) {
	var $j = jQuery; 
	var body_width = $j('body').width()
	if (body_width <= 1000)
	  {
				$j("div#whole_site_container, div#footer_container").css({'background-position:':'500px 0px', 'width' : '1000px' });
	  }
	else
	  {
  			//alert("RESIZED-LARGE");
			$j("div#whole_site_container, div#footer_container").css({'background-position:':'center top', 'width' : '100%'});
		}
	  
	}	 


// FULL HEIGHT FIX

$(document).ready(homeheight);
$(window).bind("resize", homeheight);
	function homeheight( e ) {
	var body_height = $('body').height()
	$("div#site_container").css('min-height', body_height , '_height' , body_height);
	}


$(document).ready(function() {


// DROP DOWN MENUS

	$("a#candidates_link").hover(function () {
      $(this).css("background-position"," 0px -67px");
	  $("div#candidates_dd").css({display: "block", top: "-600px"}); 
	  $('div#candidates_dd').animate({top: "0px" }, 300);
	  $("div#govig_dd, div#employers_dd").animate({top: "-600px" }, 300);
	  $("a#govig_link, a#employers_link").css("background-position"," 0px 0px");
	 }, 
     function () {}
    );

	$("a#employers_link").hover(function () {
      $(this).css("background-position"," 0px -67px");
	  $("div#employers_dd").css({display: "block", top: "-600px" }); 
	  $("div#employers_dd").animate({top: "0px" }, 300);
	  $("div#candidates_dd, div#govig_dd").animate({top: "-600px" }, 300);
	  $("a#candidates_link, a#govig_link").css("background-position"," 0px 0px");
	 }, 
     function () {}
    );
	$("a#govig_link").hover(function () {
      $(this).css("background-position"," 0px -67px");
	  $("div#govig_dd").css({display: "block", top: "-600px" }); 
	  $("div#govig_dd").animate({top: "0px" }, 300);
	  $("div#candidates_dd, div#employers_dd").animate({top: "-600px" }, 300);
	  $("a#candidates_link, a#employers_link").css("background-position"," 0px 0px");
	 }, 
     function () {}
    );
	$("div#candidates_dd, div#employers_dd, div#govig_dd").mouseleave(function () {
		  $(this).animate({top: "-600px" }, 300);
		  $("a#govig_link, a#candidates_link, a#employers_link").css("background-position"," 0px 0px");
		}
    );	

/*	
	$("#main_body, #footer_container, #opportunities_link, #contact_link, #header h1, #sub_navigation, #market_selection_list, .welcome, #header").mouseover(function () {
	  $("a#candidates_link, a#employers_link, a#govig_link").css("background-position"," 0px 0px");
	  $("div#candidates_dd, div#employers_dd, div#govig_dd").css({display: "none" });
	});
*/

	// CONTENT SLIDE HOME
	
	$("a.industry_selector_link").toggle(
		function() {
	    	 $('.welcome').animate({
			  left: "-1800px" 
			 // opacity:0
			 }, 500);
			 $('#market_selection_list').animate({
			  right: "0px" 
			 // opacity:100
			 }, 500);
			 
		},
		function() {
			$('.welcome').animate({
				left: "0px" 
			//	opacity:100
			 }, 500);  
		
			$('#market_selection_list').animate({
				right: "-1800px" 
			//	opacity:0
			 }, 500);
		});	
	
	
	// CONTENT SLIDE INTERIOR
	
	$("a.int_industry_selector_link").toggle(
		function() {
			 $('#main_body').animate({
			  left: "-1800px" 
			 // opacity:0
			 }, 500);
			// $('#main_body').css({display: "none" });					
			 $('#market_selection_list').animate({
			  right: "0px" 
			 // opacity:100
			 }, 500);
			 
		},
		function() {
			$('#main_body').animate({
				left: "0px" 
			//	opacity:100
			 }, 500);  
			//$('#main_body').css({display: "block" });					
			$('#market_selection_list').animate({
				right: "-1800px" 
			//	opacity:0
			 }, 500);
			
			
		});	


	// CONTENT ACCORDIAN

	$("#accordion div").hide()
	$("#accordion h3").live("click",function() {
		$(this).toggleClass("on");
			if($(this).hasClass("on")) {
				$(this).next().slideDown();
			} 
			else {
				$(this).next().slideUp();
			}
	});

	// JOBS BUTTON FUNTIONS
	$(".job_board").popupWindow({ 
		height:500, 
		width:800, 
		top:50, 
		left:50
	});
	
	if ( $("#jb_link").hasClass("govig_jb_links") ) {
		$("#jb_link").popupWindow({ 
			height:500, 
			width:800, 
			top:50, 
			left:50
		});
		$("#jb_link").trigger("click");

	}
	

	if ( $("#job_board_link").hasClass("no_industry") ) {
		$(".no_industry").toggle(
				function() {
					 $('.welcome').animate({
					  left: "-1800px" 
					 // opacity:0
					 }, 500);
					 $('#market_selection_list').animate({
					  right: "0px" 
					 // opacity:100
					 }, 500);
					 
					var jobs_click = "set";
		
		
					$("#biopharma_link").attr({
						href: "/refresh/templates/govig.php?id=35&industry=biopharma&jobs=true",
					   	title: "Biopharma Jobs"
					});

					$("#health_info_mgmt_link").attr({ 
					   href: "/refresh/templates/govig.php?id=37&industry=health_info_management&jobs=true",
					   title: "Health Management Jobs"
					});
					
					$("#senior_housing_link").attr({ 
					   href: "/refresh/templates/govig.php?id=36&industry=senior_housing&jobs=true",
					   title: "Senior Houseing Jobs"
					});
					
					$("#rpo_link").attr({ 
					   href: "/refresh/templates/govig.php?id=38&industry=rpo&jobs=true",
					   title: "RPO Jobs"
					});			
	
					$("#arizona_market_link").attr({ 
					   href: "/refresh/templates/govig.php?id=33&industry=arizona_market&jobs=true",
					   title: "Arizona Market Jobs"
					});
		
					$("#tax_link").attr({ 
					   href: "/refresh/templates/govig.php?id=39&industry=tax&jobs=true",
					   title: "Tax Jobs"
					});		
	
//					$("#engineering_link").attr({ 
//					   href: "/refresh/templates/govig.php?id=40&industry=engineering&jobs=true",
//					   title: "Engineering Jobs"
//					});

					$("#construction_link").attr({ 
					   href: "/refresh/templates/govig.php?id=32&industry=construction&jobs=true",
					   title: "Construction Jobs"
					});				
	
	
				},
				function() {
					$('.welcome').animate({
						left: "0px" 
					//	opacity:100
					 }, 500);  
				
					$('#market_selection_list').animate({
						right: "-1800px" 
					//	opacity:0
					 }, 500);
				}
			);		
					
	
			
		// END IF			
		}

});