// JavaScript Document

$(function(){

	Cufon.replace('.cufonText', {fontFamily:'TradeGothic LT', hover: true});
	Cufon.replace('.cufonTextBold', {fontFamily:'TradeGothic LT Bold', hover: true});
	Cufon.replace('.cufonTextCondensed', {fontFamily:'TradeGothic LT CondEighteen', hover: true});
	Cufon.replace('.quoteBlock p', {fontFamily:'TradeGothic LT CondEighteen', hover: true});
	Cufon.replace('.quoteBlockLast p', {fontFamily:'TradeGothic LT CondEighteen', hover: true});
	Cufon.now();

	$("#a[href^=http://]").attr("target", "_blank");

	$('#applyHere').hide();

	$('#applyHereButton').click(function(){

		$('#applyHere').slideDown();
		$(this).hide();

	});
	
	$('#search #industry').change(function(){
		if($(this).val() == 'energy' && !$(this).val().indexOf('energy')){
			$(window.location).attr('href', 'energy/');
		}
		if($(this).val() == 'consumer' && !$(this).val().indexOf('consumer')){
			$(window.location).attr('href', 'consumer/');
		}
		if($(this).val() == 'medical' && !$(this).val().indexOf('medical')){
			$(window.location).attr('href', 'medical/');
		}
	});
	
	$('#industry_adv_s').change(function(){
		if($(this).val() == 'energy' && !$(this).val().indexOf('energy')){
			$(window.location).attr('href', 'energy/advanced-search.html');
		}
		if($(this).val() == 'consumer' && !$(this).val().indexOf('consumer')){
			$(window.location).attr('href', 'consumer/advanced-search.html');
		}
		if($(this).val() == 'medical' && !$(this).val().indexOf('medical')){
			$(window.location).attr('href', 'medical/advanced-search.html');
		}
	});
	var middleHeight = $('.content_middle').height();
	var endHeight = $('.side_info').height();
	
	if ( middleHeight < endHeight ) {
		
		$('.content_middle').height(endHeight)
		
	}
});
