// fancybox

jQuery(document).ready(function() {

	$("a.fbox").fancybox({
		'titleShow'		: false,
		'transitionIn'	: 'fade',
		'transitionOut'	: 'fade'	
	});
	

    $("a.fbox_movie").fancybox({
            'width'                 : 880,
            'height'                : 511,
            'autoScale'             : false,
            'transitionIn'          : 'none',
            'transitionOut'         : 'fade',
    		'scrolling'				: 'no',
            'type'                  : 'iframe'
    });



	$("a.guides").fancybox({
		'width'				: 600,
		'height'			: 600,
        'autoScale'     	: false,
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'easingIn'      : 'easeOutBack',
		'easingOut'     : 'easeInBack',
		'type'				: 'iframe'
	});
    
});

// bx-slider for home page banners

$(function(){
  $('#slides').bxSlider({
    easing: 'easeOutBounce',
	speed: 2000,                     // amount of time slide transition lasts (in milliseconds)
	auto: true,                    // determines if slides will move automatically
	pause: 5000,                    // time between each slide transition (auto mode only) 
	auto_hover: true               // determines if slideshow will pause while mouse is hovering over slideshow
  });
});


// back to top (css in footer section, DOM just before closing <body>)

	jQuery(document).ready(function(){
		var pxShow = 300;//height on which the button will show
		var fadeInTime = 1000;//how slow/fast you want the button to show
		var fadeOutTime = 1000;//how slow/fast you want the button to hide
		var scrollSpeed = 1000;//how slow/fast you want the button to scroll to top. can be a value, 'slow', 'normal' or 'fast'
		jQuery(window).scroll(function(){
			if(jQuery(window).scrollTop() >= pxShow){
				jQuery("#backtotop").fadeIn(fadeInTime);
			}else{
				jQuery("#backtotop").fadeOut(fadeOutTime);
			}
		});
		 
		jQuery('#backtotop a').click(function(){
			jQuery('html, body').animate({scrollTop:0}, scrollSpeed); 
			return false; 
		}); 
	});
	
// qTip

$(document).ready(function()
{
   $('a.qtip[title]').qtip({
      position: {
         corner: {
            target: 'topMiddle',
            tooltip: 'topMiddle'
         }
      },
      style: {
	      width: 125,
	      padding: 5,
	      background: '#c08958',
	      color: '#f8e2b4',
	      'font-size': 11,
	      'font-weight': 'normal',
	      textAlign: 'center',
	      border: {
	         width: 1,
	         radius: 7,
	         color: '#c08958'
	      },
	      tip: 'topMiddle'
      }
   });
   
   $('li.qtip_red a[title]').qtip({
      position: {
         corner: {
            target: 'topMiddle',
            tooltip: 'bottomMiddle'
         }
      },
      style: {
	      width: 125,
	      padding: 5,
	      background: '#cf4038',
	      color: '#f8e2b4',
	      'font-size': 11,
	      'font-weight': 'normal',
	      textAlign: 'center',
	      border: {
	         width: 1,
	         radius: 7,
	         color: '#cf4038'
	      },
	      tip: 'bottomMiddle'
      }

   });

   $('li.qtip_green a[title]').qtip({
      position: {
         corner: {
            target: 'topMiddle',
            tooltip: 'bottomMiddle'
         }
      },
      style: {
	      width: 125,
	      padding: 5,
	      background: '#727c1d',
	      color: '#f8e2b4',
	      'font-size': 11,
	      'font-weight': 'normal',
	      textAlign: 'center',
	      border: {
	         width: 1,
	         radius: 7,
	         color: '#727c1d'
	      },
	      tip: 'bottomMiddle'
      }

   });
   
});
