$(document).ready(function(){
	// rounded corners
	//$('.rounded').corner();
	
	// ie png fix
	//$.ifixpng('/images/pixel.gif');
	$('.transpng').ifixpng();
	
	// rollovers
	// preload rollover images
	$('.rollover').children('img').each(function() {
		rollsrc = $(this).attr('src');
		rollON = rollsrc.replace(/(.*)\.(jpg|gif|png)$/i, '$1_over.$2');
		$('<img>').attr('src', rollON);
	});

	// check for rollover
	$('.rollover').mouseover(function(){
		imgsrc=$(this).children('img').attr('src');
		matches = imgsrc.match(/_over/);

		// don't do the rollover if state is already ON
		if (!matches) {
			imgsrcOn = imgsrc.replace(/(.*)\.(jpg|gif|png)$/i, '$1_over.$2');
			$(this).children('img').attr('src', imgsrcOn);
			
			$('.rollover').mouseout(function(){
				$(this).children('img').attr('src', imgsrc);
			});
		}
	});
	
	
	//nav markers
	$('#nav_'+$('body').attr('id')).addClass('active');
	
	
	
	//external links
	//grab the links with a rel attribute of 'extLink' and append a title attribute
	//that says it opens in a new window
	$("a[rel='extlink']").attr('title','Opens in a new window').click(function(){
		window.open($(this).attr('href')); // opens the link in a new window
		return false; // stops the normal link behaviour firing
	});
});