$(document).ready(function() {
	$('area.title').cluetip({splitTitle: '|', topOffset: 200, leftOffset: 0, mouseOutClose: true, clickThrough: true,
		hoverIntent: {
			  sensitivity:  3,
			  interval:     50,
			  timeout:      0
	    }
	}
);

$('.two-columns').columnize({ columns: 2, lastNeverTallest: true });

	stretch_portal_content();
	$(window).resize( stretch_portal_content );

	function stretch_portal_content() {
		if( $(window).height() > $('body').height() ) {
			$( '#rightcol' ).height(
				$(window).height() - ( $('body').height() - $('#rightcol').height() )
			);
		}
	}
});

$(window).load(function() {
    $('#slider').nivoSlider({
        effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
        slices:2,
        animSpeed:500, //Slide transition speed
        pauseTime:3000,
        startSlide:0, //Set starting Slide (0 index)
        directionNav:false, //Next & Prev
        directionNavHide:true, //Only show on hover
        controlNav:false, //1,2,3...
        controlNavThumbs:false, //Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, //Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', //Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
        keyboardNav:true, //Use left & right arrows
        pauseOnHover:true, //Stop animation while hovering
        manualAdvance:false, //Force manual transitions
        captionOpacity:0.8, //Universal caption opacity
        beforeChange: function(){},
        afterChange: function(){},
        slideshowEnd: function(){}, //Triggers after all slides have been shown
        lastSlide: function(){}, //Triggers when last slide is shown
        afterLoad: function(){} //Triggers when slider has loaded
    });
	
			// You need to specify the size of your background image here (could be done automatically by some PHP code)
			var FullscreenrOptions = {  width: 1275, height: 850, bgID: '#bgimg' };
			// This will activate the full screen background!
			$.fn.fullscreenr(FullscreenrOptions);	
			
			$(function () {
			$('.bg').hide();//hide all the images on the page
			});
		
			var i = 0;//initialize
			var int=0;//Internet Explorer Fix
			$(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
				var int = setInterval("doThis(i)",20);//500 is the fade in speed in milliseconds
			});
		
			function doThis() {
				var images = $('.bg').length;//count the number of images on the page
				if (i >= images) {// Loop the images
					clearInterval(int);//When it reaches the last image the loop ends
				}
				$('.bg:hidden').eq(0).fadeIn(500);//fades in the hidden images one by one
				i++;//add 1 to the count
	}

	
});




