$(document).ready(function() {
	$('.topimg h2').css('opacity',0.8);
	//
	//get original width
	var containerWidth = $('#container').width();
	var contentWidth = $('#content').width();
	var origWidth = contentWidth;
	
	//get largest width of items inside content
	$('#content').find('table, div').not('#dhtmlwindowholder,div[id^=mpip] ,#banner, .wrap, .clear').each(function(){
		if($(this).outerWidth()>contentWidth){
			//console.log($(this).attr('id'));
			contentWidth = $(this).outerWidth();
		}
	});
	
	//get difference and apply to content and container
	if (contentWidth > origWidth){
		$('#content').css('width', contentWidth+'px');
		var pxDiff = contentWidth - origWidth;
		$('#container').css('width', containerWidth+pxDiff+'px');
		$('body').addClass('expanded');
	}

	//parent nav items not clickable
	$('#nav > li > ul').parent('li').children('a').attr('href','#').click(function(e){
		e.preventDefault();
	});
	$('#nav li ul').parent('li').addClass('parent');

	//add hover for ie 6
	$('#nav li').hover(function(){
		$(this).addClass('hover');
	}, function() {
	  $(this).removeClass('hover');
	});
});
