$(document).ready(function(){
	$('#highlightGroup tbody, #highlightGroup table, #highlightGroup table tr, #highlightGroup table td').removeAttr("width").removeAttr("cellspacing").removeAttr("cellpadding").removeAttr("bordercolor").removeAttr("border").removeAttr("bgcolor").removeAttr("style").css({
		'border':'none',
		'padding':'0',
		'margin':'0',
		'background-color':'#ffffff'
	});
	$('tbody, table, tr, td').removeAttr("bgcolor").css({
		'background':'#ffffff'
	});
	$('#highlightGroup .highlight img').css('max-height','130px');				   
						   
	$('#highlightGroup.four .highlight:nth-child(4n+1)').css({
		'width':'206px'
	});
	$('#highlightGroup.four .highlight:nth-child(4n)').css({
		'width':'206px',
		'background':'none'
	});
	$('#highlightGroup.three table tr td .highlight').css({
		'width':'210px'
	});
	$('#highlightGroup.three table tr td .highlight:nth-child(3n+1)').css({
		'width':'208px'
	});
	$('#highlightGroup.three table tr td .highlight:nth-child(3n)').css({
		'width':'208px',
		'background':'none',
		'display':'none'
	});
	$('#content.pages img:not(.right, .left)').not('.highlight img, .hero').css({
			'margin-bottom':'15px'
	});
	$('#content.pages img.left').css({
			'margin':'0 15px 15px 0',
			'float':'left'
	});
	$('#content.pages img.right').css({
			'margin':'0 0 15px 15px',
			'float':'right'
	});
	$('#blocks>div').css({
		'position':'relative',
		'display':'block',
		'top':'0',
		'left':'0',
		'float':'left',
		'margin':'0 0 20px 20px',
		'padding':'0'
	});
	if ($.browser.msie && $.browser.version.substr(0,1)<7) {
		$('#blocks').css({
			'left':'-5px'
		});
		$('#blocks>div').css({
			'margin':'0 0 20px 16px'
		});
	};
	$('#blocks .double').css({
		'width':'450px'
	});
	/*$('#blocks>div').each(function(){
		$(this).append('<img src="/images/corner_tr.png" class="corner tr" /><img src="/images/corner_tl.png" class="corner tl" /><img src="/images/corner_br.png" class="corner br" /><img src="/images/corner_bl.png" class="corner bl" />');
	});	*/
	$('#header').append('<img src="/images/corner_br.png" class="corner br" /><img src="/images/corner_bl.png" class="corner bl" />');
	slideNumber = 0;
	
	
	//alert(($('#banner div.slide').length));
	$('#banner div.slide').fadeOut(10);
	function animate(i){
		if(i<($('#banner div.slide').length)){
			$('#banner div.slide').fadeOut(1000);
			$('#banner div.slide:eq('+i+')').fadeIn(1000).fadeTo(4000,1,function(){
				i++;
				animate(i);													 
			});
		}else{
			i=0;			
			$('#banner div.slide').fadeOut(1000);
			$('#banner div.slide:eq('+i+')').fadeIn(1000).fadeTo(4000,1,function(){
				i++;
				animate(i);													 
			});
		}
	}
	animate(0);
	$('h1.cat + p').css({
		'width':'420px',
		'display':'block',
		'float':'left',
		'margin':'0 20px 10px 0',
		'padding':'29px 0 30px 0',
		'vertical-align':'middle'
	});
	if($('h1.cat').height()<$('h1.cat + p').height()){		
		//alert("p taller");
		//alert($('h1.cat + p').height());
		newHeight = $('h1.cat + p').height()-$('h1.cat').height()+60;
		$('h1.cat').css({
			'padding-top':newHeight/2,
			'padding-bottom':newHeight/2
		});
	}else{
		//alert("heading taller");
		newHeight = $('h1.cat').height()-$('h1.cat + p').height()+60;
		$('h1.cat + p').css({
			'padding-top':newHeight/2,
			'padding-bottom':newHeight/2
		});
	}
	$('h1.cat + p').after('<hr style="clear:both;visibility:hidden;" />');
	
	//cellspacing="" cellpadding="" bordercolor="#" border="0" bgcolor="#"
	$('.drilldown').after('<h5 id="filterResults">Hide <img src="/images/filter_hide.gif" /></h5>');
	$('#filterResults').click(function(){
		$('.drilldown').slideToggle(250);
		return false;			
	}).toggle(
		function(){
			$(this).html('Show <img src="/images/filter_show.gif" />');
		},
		function(){
			$(this).html('Hide <img src="/images/filter_hide.gif" />');
		}
	);
});