// fancybox

jQuery(document).ready(function() {

	$("a.fbox").fancybox({
		'titleShow'		: false,
		// 'titlePosition'	: 'over',
        'transitionIn'   : 'fade',
        'transitionOut'  : 'fade'
	});
	$("a.fbox_inside").fancybox({
		'titlePosition'	: 'inside',
        'transitionIn'   : 'fade',
        'transitionOut'  : 'fade'
	});

});

// tabs

$(function() {
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$("ul.tabs").tabs("div.panes > div", {
		/* tabs configuration goes here */
	
		// first configuration property
		// event: 'mouseover',
	
		// another property
		effect: 'fade',
		fadeInSpeed: 2000
		// fadeOutSpeed: 300
	
		// ... the rest of the configuration properties
	});

});

// superfish

$(document).ready(function(){ 
    $("ul.sf-menu").supersubs({ 
        minWidth:    12,   // minimum width of sub-menus in em units 
        maxWidth:    27,   // maximum width of sub-menus in em units 
        extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                           // due to slight rounding differences and font-family 
    }).superfish({ 
        delay:       1000,	// one second delay on mouseout 
        animation:   {opacity:'show'},  // fade-in and slide-down animation 
        // speed:       'fast',                           faster animation speed 
        autoArrows:  false,	// disable generation of arrow mark-up 
        dropShadows: true	// disable drop shadows 
    }); 
    // call supersubs first, then superfish, so that subs are 
	// not display:none when measuring. Call before initialising 
	// containing tabs for same reason. 
});

// bx-slider for home page banners

$(function(){

  $('#slides_home').bxSlider({ // homepage slider with arrow nav
    easing: 'easeInOutExpo',
    // mode: 'fade',
	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
  });

  $('#slides').bxSlider({ // arrow nav
    easing: 'easeInOutExpo',
    // mode: 'fade',
	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
  });
  
  $('#slides2').bxSlider({ // pipped sliders
    mode: 'fade',
	speed: 2000,                     // amount of time slide transition lasts (in milliseconds)
	auto: true,                    // determines if slides will move automatically
	pause: 10000,                    // time between each slide transition (auto mode only) 
	auto_hover: true,               // determines if slideshow will pause while mouse is hovering over slideshow
	pager: true,                    // determines if a numeric pager is displayed (1 2 3 4...)
	controls: false,                // determines if default 'next'/'prev' controls are displayed
	wrapperClass: 'bx-wrapper-sub'  // class name to be used for the outer wrapper of the slideshow
  });
});

// jcarousel

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        // Configuration goes here
    });
});

// sliding boxes

jQuery(function($){
				
	$('.fade').mosaic({
		speed : 750
	});

});



// qTip

$(document).ready(function()
{

   $('a.qtip_mouse[title],li.qtip_mouse a[title]').qtip({ // follow mouse
      position: {
      	 target: 'mouse',
         corner: {
            target: 'topMiddle',
            tooltip: 'bottomMiddle'
         }
      },
      style: {
	      padding: 5,
	      background: '#4a0402',
	      color: '#af301d',
	      'font-size': 12,
	      // 'font-weight': 'normal',
	      // 'text-transform': 'uppercase',
	      textAlign: 'center',
	      border: {
	         width: 1,
	         radius: 7,
	         color: '#4a0402'
	      },
	      tip: 'bottomMiddle'
      }
   });

   $('a.qtip_fixed[title]').qtip({ // fixed to link
      position: {
         corner: {
            target: 'topMiddle',
            tooltip: 'bottomMiddle'
         }
      },
      style: {
	      padding: 5,
	      background: '#4a0402',
	      color: '#af301d',
	      'font-size': 12,
	      // 'font-weight': 'normal',
	      // 'text-transform': 'uppercase',
	      textAlign: 'center',
	      border: {
	         width: 1,
	         radius: 7,
	         color: '#4a0402'
	      },
	      tip: 'bottomMiddle'
      }
   });

   $('li.qtip_socnet a[title],a.qtip_socnet[title]').qtip({ // follow mouse
      position: {
      	 target: 'mouse',
         corner: {
            target: 'topMiddle',
            tooltip: 'bottomMiddle'
         }
      },
      style: {
	      padding: 5,
	      background: '#4a0402',
	      color: '#af301d',
	      'font-size': 12,
	      // 'font-weight': 'normal',
	      // 'text-transform': 'uppercase',
	      textAlign: 'center',
	      border: {
	         width: 1,
	         radius: 1,
	         color: '#4a0402'
	      },
	      tip: 'bottomMiddle'
      }
   });
  
});

// opacify

jQuery(document).ready(function () {

	// opacify goes from solid to transparent
  jQuery(".opacify").fadeTo(0.7, 1);
  jQuery(".opacify").hover(
    function () {
      jQuery(this).fadeTo("fast", 0.7);
    },
    function () {
      jQuery(this).fadeTo("normal", 1);
    }
  );

	// opacify2 goes from transparent to solid
  jQuery(".opacify2").fadeTo(1, 0);
  jQuery(".opacify2").hover(
    function () {
      jQuery(this).fadeTo("fast", 1);
    },
    function () {
      jQuery(this).fadeTo("normal", 0);
    }
  );
  
});

