// JQUERY FUNCTION

jQuery(document).ready(function($){
	
	// IMAGE WITH CLASS PICTURE WILL WORK WITH THICKBOX
	$("#colleft img.picture, #colleft img[longdesc]").each(function(){		
  	//var stop = $(this).attr("src").indexOf("-256_x.jpg");
		//var sublink = $(this).attr("src").substring(0,stop);
		
		var rel = $(this).attr("rel");
		var longdesc = $(this).attr("longdesc");
		
		if(longdesc =='' || longdesc ==undefined)
		{
			var link = rel;
		}
		else
		{
			var link = longdesc;
		}
		
		$(this).wrap("<a href=\""+link+"\" class=\"thickbox\"></a>");
		$(this).removeAttr("title");
	});
	

	// PAGE NAVIGATION SHOW HIDE

	var page = $("#pageSelection li").size();
	if(page < 6)
	{
		$("#pageSelection").remove();
	};


	$("#content hr:last").remove();


	// TARGET BLANK XHTML STRICT
	$('a[@rel$="external"]').click(function(){
	
		this.target = "_blank";
	
	});
	
});

$(window).load(function(){
	var height0 = $("#content").height();
	var height1 = $("#news").height();
	var height2 = $("#menu").height();
	
	maxHeight = Math.max(Math.max(height0,height1),height2);
	
	$("#menu,").height(maxHeight);
	$("#news").height(maxHeight);
	$("#content").height(maxHeight+70);
});


