var defHeight = '220px',
	defHeight2 = '180px',
	largeHeight = '420px',
	largeHeight2 = '257px',
	lessText = 'SHOW LESS',
	moreText = 'SHOW ALL';
		
$(function(){
	
	$('ul.sf-menu').superfish({delay:0, speed:0});

	/*a very dirty fix for the footer rounded corners image: it should hidden for redirect pages*/
	if ($('p.redirect').length>0){
		$('div.content-bottom').css('display', 'none');
	}
	
	$(".featured").css('height', largeHeight).css('overflow', 'hidden');
	$(".partners").css('height', largeHeight2).css('overflow', 'hidden');
	
	$(".toggle").click(function() {
		var pDiv = $(this).closest('.col2');
		
		if(($(this).text()).indexOf(moreText)>-1) {
			pDiv.stop().animate({'height': ((pDiv.hasClass('partners'))?largeHeight2:largeHeight), 'overflow': 'visible'},'normal', 
				function() {
					$(this).find('.toggle').hide().fadeIn('slow').css('line-height','18pt').text(lessText);
				});
		}
		else {
			pDiv.stop().animate({'height': ((pDiv.hasClass('partners'))?defHeight2:defHeight), 'overflow': 'visible'},'normal', 
				function() {
					$(this).find('.toggle').hide().fadeIn('slow').css('line-height','18pt').text(moreText);
				});
		}
		return false;
	});
	
	$("div.table_job_title a, .search_res a.search, #news .search_res h2 a, .articles_right .search_res h2 a, #submenu a, #view_profile_link a, #mass_apply_form a[href*='apply_for_job'], #resume_wizard_thumbnails a, .jseeker a[href*='sign_in'], .employer a[href*='sign_in'], .header_form_ctrl a:not(a:eq(0), a.social, a[href*='logout'])").colorbox({width:"80%", height:"90%", iframe:true, fixed: true});
	
	$('#logo').addGlow({ textColor: '#2d2d2d', haloColor: '#39c', radius: 100 });
	$('img.t_trig').tooltip({effect: 'slide'});
	
});
$(window).load(function() {
        $('.bannerslider').nivoSlider({
			effect:'fade',
			directionNav: false
		});
});
