var $j = jQuery.noConflict();
$j(function () {
	
    $j('#rotator').bxSlider({
      auto: true,
      pager: true,
	  controls: false,
	  speed: 1000,
	  pause: 13000
    });
	
	//colorbox
	$j(".modal").colorbox({iframe:true, innerWidth:720, innerHeight:500});
	
	//find the tallest height of the group and set all heights in group to that height
	function equalHeight(group) {
		var tallest = 0;
		group.each(function() {
			var thisHeight = $j(this).height();
			if(thisHeight > tallest) {
				tallest = thisHeight;
			}
		});
		group.height(tallest);
	}

	//set the group for height
	equalHeight($j(".column"));

	// Reset Font Size
	var originalFontSize = $j('body').css('font-size');
	$j(".resetFont").click(function(){
		$j('body').css('font-size', originalFontSize);
	});
	
	// Increase Font Size
	$j(".increaseFont").click(function(){
		var currentFontSize = $j('body').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*1.2;
		$j('body').css('font-size', newFontSize);
		return false;
	});
	
	// Decrease Font Size
	$j(".decreaseFont").click(function(){
		var currentFontSize = $j('body').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*0.8;
		$j('body').css('font-size', newFontSize);
		return false;
	});
  
    // Open external links in a new window
	$j('a, area').filter(function () {
        return this.hostname && (this.hostname).split(':')[0] !== (location.hostname).split(':')[0] || $j(this).attr('rel') == 'external'
    }).not(':has(img, div, mailto)').addClass('external').end().click(function (e) {
        open(this.href);
        e.preventDefault()
    });
	
	$j('#navigation ul li').hover(function () {
        $j('ul', this).stop(true, true).fadeIn('slow');
		$j(this).addClass("current-hover");
    }, function () {
        $j('ul', this).stop(true, true).fadeOut('slow');
		$j(this).removeClass("current-hover");
    });		

});
