$(document).ready( function() {

	if( $('*').is('.thickboxLinks') ) {
		$('.thickboxLinks a').each( function() {
			$(this).attr('href', $(this).attr('href')+'&height=428&width=550&KeepThis=true&TB_iframe=true').addClass('thickbox');
		});
		$('#TB_closeAjaxWindow').children().each( function() {
							alert($(this).text());
							
						});
	}
	
	if( $('*').is('.thickbox') ) {
				
		$('a[class=prev-link], a[class=next-link]').live( 'click', function(e) {
			e.preventDefault();
			$('#loading').css({'display':'block', 'z-index':'1000'});
			$('body').load($(this).attr('href')+' .thickbox');
		});
		
		$('div .news-single-img').css('padding-top', '30px');
		
		
		
		
		//$('div.controls img').wrap('<div id="TB_closeAjaxWindow"><a id="TB_closeWindowButton" title="Close" href="#"></a></div>');
		
		// center images in thickbox horizontally and vertically
		// $('div.thickbox div.image > img')
		// 			.css('top', (parseInt($('div.image').css('height'))/2)-(parseInt($('div.image > img').attr('height'))/2) )
		// 			.css('left', (parseInt($('div.image').css('width'))/2)-(parseInt($('div.image > img').attr('width'))/2) );
	}
	
	if( $('*').is('.download-menu') ) {
		$('.download-menu a').live( 'click', function(e) {
			e.preventDefault();
			tb_show("", $(this).attr('href')+"?type=600&height=408&width=520&KeepThis=true&TB_iframe=true");
		});
	}
	
	if( $('*').is('.job-menu') ) {
		$('.job-menu a').live( 'click', function(e) {
			e.preventDefault();
			tb_show("", $(this).attr('href')+"?type=600&height=468&width=670&KeepThis=true&TB_iframe=true");
		});
	}
	
});