jQuery.noConflict();
jQuery(document).ready(function($){
	
	// CONTENT: Clean up page title, and breadcrumbs
	if( $('#page-title').css('display') == 'none' && $('#breadcrumbs ul').size() == 0 ){
		$('#page-title').remove();
		$('#content-wrapper').css('paddingTop','0px');
	}
	if( $('#breadcrumbs ul').size() == 0 )
		$('#breadcrumbs').remove();
	
	// HEADER: Clean up title, slogan, and logo
	if( $('#title').text() == '' && $('#slogan').text() == '' && $('#logo').html() == '' ){
		$('#title,#slogan,#logo').remove();
		$('#header').css({paddingTop:'36px',paddingBottom:'0px'});
	}

	// MENU: Setup drop down menus
	$('#menu ul ul li:has(ul) > a').addClass('parent');
	

	// Enable infiniteCarousel	
	$('#carousel').infiniteCarousel({
		transitionSpeed: 800,
		displayTime: 6000,
		displayThumbnails: false,
		displayProgressBar: false,
		imagePath: 'rw_common/themes/flex_1_ha/js/infinitecarousel/images/',
		inView: 3,
		advance: 3,
		textholderHeight : .10,
		padding:'10px'});

	$('.carousel1x1').infiniteCarousel({
		transitionSpeed: 800,
		displayTime: 6000,
		displayThumbnails: false,
		displayProgressBar: false,
		imagePath: 'rw_common/themes/flex_1_ha/js/infinitecarousel/images/',
		inView: 1,
		advance: 1,
		textholderHeight : .10,
		padding:'0px'});
  		
  	$("#commentForm").validate();
  				

jQuery(document).ready(function($){

	$("#demo img[title]").tooltip({ position: "center left", opacity: 0.7});
	$("#staff img[title]").tooltip({ position: "center left", opacity: 0.7});
	$(".payloom-show-details a[title]").tooltip({ position: "center left", opacity: 0.7});
	
});

jQuery(document).ready(function($){

	$('.slide-out-div').tabSlideOut({
		tabHandle: '.handle',                              //class of the element that will be your tab
		pathToTabImage: '../rw_common/themes/flex_1_ha/images/Buttons/attachmedallion_vBtn.png',          //path to the image for the tab *required*
		imageHeight: '198px',                               //height of tab image *required*
		imageWidth: '41px',                               //width of tab image *required*    
		tabLocation: 'right',                               //side of screen where tab lives, top, right, bottom, or left
		speed: 200,                                        //speed of animation
		action: 'click',                                   //options: 'click' or 'hover', action to trigger animation
		topPos: '50px',                                   //position from the top
		fixedPosition: true                               //options: true makes it stick(fixed position) on scroll
	});

});
  	// Enable External File Overlays
  	
jQuery(document).ready(function($){
	
		// if the function argument is given to overlay,
		// it is assumed to be the onBeforeLoad event listener
		$("a[rel]").overlay({
	
			mask: 'grey',
			top: '15%',
	
			onBeforeLoad: function() {
	
				// grab wrapper element inside content
				var wrap = this.getOverlay().find(".contentWrap");
	
				// load the page specified in the trigger
				wrap.load(this.getTrigger().attr("href"));
			}
	
		});
});

});
