// Background Postion Fix
$(document).ready(resizeWindow);
$(window).bind("resize", resizeWindow);
function resizeWindow( e ) {
//IE SPACIFIC
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {}
	else {
		if($('#main_body').hasClass("home")){}
		else{
			var body_height = $('body').height();
			var body_height_dif = body_height - 562
			if (body_height <= 700)	{
					$("#footer_container, #whole_footer_container, #footer").css({'height': '138px' });
					$("#body_text").css({'padding-bottom': '138px' });
				}
			else{
					$("#footer_container, #whole_footer_container, #footer").css({'height': body_height_dif });
					$("#body_text").css({'padding-bottom': body_height_dif });	
				}
		  
		}	
	}

// BACKGROUND POSITON FIX
	var body_width = $('body').width()
	if (body_width <= 1000){
		if($('#main_body').hasClass("home")){
			$("#eye_candy li").css({'background-position':'-500px 0px', 'width' : '1000px'});
		}else{
			$("#eye_candy").css({'width' : '1000px', 'right': 'auto'});
		}
	}
	else {	
		if($('#main_body').hasClass("home")){
			$("#eye_candy li").css({'background-position':'center top', 'width' : '100%'});
		}
		else{
			$("#eye_candy").css({'background-position':'center top', 'width' : '100%', 'right' : '0px'});
		}
	}
}



// NORMAL RULES

$(document).ready(function() {

if ($.browser.msie && $.browser.version.substr(0,1)<8) {
	DD_belatedPNG.createVmlNameSpace();
	DD_belatedPNG.createVmlStyleSheet();
	DD_belatedPNG.fix('#header h1, #navigation li a, em.client_name, strong.nav_seperator, em.nav_title, .dropdown, .dropdown li a, a.job_board_item, .body_ul li, img');
}				   
if ($.browser.msie && $.browser.version.substr(0,1)<7) {
	DD_belatedPNG.createVmlNameSpace();
	DD_belatedPNG.createVmlStyleSheet();
	DD_belatedPNG.fix('#header h1, #footer_container, #footer');
}

// NAVIGATION RULES 
if($('#main_body').hasClass("home")){

$('#navigation li a em.client_name').css({
	'height': '0px',
	'top' : '50%',
	'background-position':'-484px 0px'
});		

	$("#navigation li a").hover(function(){
		$(this).children('em.nav_title').css({
			'width':'0px',
			'background-position':'-484px 0px'
		});		
		$(this).children('em.client_name').animate({
			top : '0px',
			height  : '100%'
		}, 
		200);
		$(this).children('em.nav_title').animate({
			width : '484px'
		}, 600);			
		
					 
	}, function () {
		$(this).children('em.nav_title').animate({
			width : '0'
		}, 0, function () {
			$(this).parent().children('em.client_name').animate({
				top : '50%',
				height  : '0px'
			}, 200);
			$(this).css({'background-position':'0px center'});
			$(this).fadeIn();
			$(this).animate({width:'484px'}, 100);	
		});			
	});
}

else {

	// INTERIOR DROP DOWNS 
	$("em.client_name").fadeOut(0);
	$("#about_link").hover(function(){
		$("em.client_name").fadeOut('slow');	
		$(this).find("em.client_name").fadeIn('slow');
		$("#about_dd").slideDown('slow');
		$(".dropdown").not("#about_dd").slideUp('slow');
	}, function(){
	});
	
	$("#focus_link").hover(function(){
		$("em.client_name").fadeOut('slow');	
		$(this).find("em").fadeIn('slow');
		$("#focus_dd").slideDown('slow');
		$(".dropdown").not("#focus_dd").slideUp('slow');
	}, function(){});
	
	$("#candidates_link").hover(function(){
		$("em.client_name").fadeOut('slow');	
		$(this).find("em").fadeIn('slow');
		$("#candidates_dd").slideDown('slow');
		$(".dropdown").not("#candidates_dd").slideUp('slow');
	}, function(){});
	
	$("#employers_link").hover(function(){
		$("em.client_name").fadeOut('slow');	
		$(this).find("em").fadeIn('slow');
		$("#employers_dd").slideDown('slow');
		$(".dropdown").not("#employers_dd").slideUp('slow');
	}, function(){});

	$("#contact_link").hover(function(){
		$("em.client_name").fadeOut('slow');	
		$(this).find("em").fadeIn('slow');
		$(".dropdown").slideUp('slow');
	}, function(){
		$(this).find("em").fadeOut('slow');		
	});

	$("#navigation_container")._hover(function(){}, function(){								 
		$(".dropdown").slideUp('slow');
		$("em.client_name").fadeOut("slow");
		
	});
	

}


});
