//jQuery(document).ready(function($){
$(document).ready(function () {
	/*$('.photogalleryItem a').colorbox( { current:'' });
	$('.photogalleryItem a').live('click', function() { alert('hi'); });*/
	$('.photogalleryItem a').colorbox( { current:'', innerWidth:500, innerHeight:500 });
	
	if($('div.nav').height() <= $('#main').height() || $('div.nav').height() >= $('.news').height()) {
		var height = $(document).height() - 140;//($('#main').height() > $('.news').height())?parseFloat($('#main').height())+140:parseFloat($(document).height())-300;
		$('div.nav').height(height); // fix sidebar menu problem
	}

	$('.announcement-list').each(function() { $(this).find('p').append(' <a class="more" href="'+$(this).find('h2 a').attr('href')+'">Read More</a>');});
	var i = randomnumber=Math.floor(Math.random()*4);
	/*$('#headerbackground img').attr('src', '/Images/topBanners-main/header-'+i+'.jpg').show();*/
	$('#headerbackground img').show();
	
	var i = 1; $('#main .announcement-list').each(function() { i++; if(i > 4) $(this).hide(); });	
	var i = 1; $('.news .announcement-list').each(function() { i++; if(i > 4) $(this).hide(); });	



	//If an 'alt' tag attribute exists within an image make a 'title' tag attribute with the same value
	$('#main img').each(function() {
		var altTag = $(this).attr("alt");
		var titleTag = $(this).attr("title");
		if(altTag && altTag.length > 0 && titleTag.length == 0) {
			$(this).attr('title',altTag);
		}
		if(titleTag && titleTag.length > 0 && altTag.length == 0) {
			$(this).attr('alt',titleTag);
		}
	});	

});
