// 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; 
		}); 
	});

// set whole list item as link

$(document).ready(function(){
						   
	$("li.clickable_li").click(function(){
    	window.location=$(this).find("a").attr("href");return false;
	});

});

// qtip

$(document).ready(function()
{
   $('li.qtip a[title], td.qtip a[title], li.sidebar_right_adrotate a[title]').qtip({
      position: {
         corner: {
            target: 'topMiddle',
            tooltip: 'bottomMiddle'
         }
      },
      style: {
	      width: 170,
	      padding: 8,
	      background: '#888',
	      color: '#ffffff',
	      'font-size': 11,
	      textAlign: 'center',
	      border: {
	         width: 1,
	         radius: 5,
	         color: '#888'
	      },
	      tip: 'bottomMiddle'
      }
   });
   
});


// superfish

$(document).ready(function() { 
    $('ul.sf-menu').superfish({ 
        delay:       1000,                            // one second delay on mouseout 
        // animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
        // speed:       'fast',                          // faster animation speed 
        autoArrows:  false,                           // disable generation of arrow mark-up 
        dropShadows: false                            // disable drop shadows 
    }); 
}); 

// fancybox

jQuery(document).ready(function() {

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

	$("a.fbox_page").fancybox({
		'width'				: 700,
		'height'			: 600,
        'autoScale'     	: false,
        'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'type'				: 'iframe',
		'titleShow'  : false
	});


});

// countdown

jQuery(document).ready(function() {
	
    $('#header_countdown').tgcCountdown();
});

// sliding boxes

jQuery(function($){
				
	$('.events-cover').mosaic({
		animation	:	'slide',	//fade or slide
		// anchor_y	:	'bottom',		Vertical anchor position
		hover_y		:	'-100px'		//Vertical position on hover
	});

	$('.info-cover').mosaic({
		animation	:	'slide',	//fade or slide
		// anchor_y	:	'bottom',		Vertical anchor position
		hover_y		:	'-75px'		//Vertical position on hover
	});

});


// slide banners

$(document).ready(function(){
	$('#slides').bxSlider({
		alignment: 'horizontal',        // 'horizontal', 'vertical' - direction in which slides will move
		controls: false,                 // determines if default 'next'/'prev' controls are displayed
		speed: 800,                     // amount of time slide transition lasts (in milliseconds)
		pager: true,                    // determines if a numeric pager is displayed (1 2 3 4...)
		pager_short: false,             // determines if a 'short' numeric pager is displayed (1/4)
		pager_short_separator: ' / ',   // text to be used to separate the short pager
		margin: 0,                      // if 'horizontal', applies a right margin to each slide, if 'vertical' a
		                                // bottom margin is applied. example: margin: 50
		next_text: 'next',              // text to be displayed for the 'next' control
		next_image: '',                 // image to be used for the 'next' control
		prev_text: 'prev',              // text to be displayed for the 'prev' control
		prev_image: '',                 // image to be used for the 'prev' control
		auto: true,                    // determines if slides will move automatically
		pause: 5000,                    // time between each slide transition (auto mode only) 
		auto_direction: 'next',         // order in which slides will transition (auto mode only)
		auto_hover: true,               // determines if slideshow will pause while mouse is hovering over slideshow
		auto_controls: false,           // determines if 'start'/'stop' controls are displayed (auto mode only)
		ticker: false,                  // determines if slideshow will behave as a constant ticker
		ticker_controls: false,         // determines if 'start'/'stop' ticker controls are displayed (ticker mode only)
		ticker_direction: 'next',       // order in which slides will transition (ticker mode only)
		ticker_hover: true,             // determines if slideshow will pause while mouse is hovering over slideshow
		stop_text: 'stop',              // text to be displayed for the 'stop' control
		start_text: 'start',            // text to be displayed for the 'start' control
		wrapper_class: 'slides_wrap'  // class name to be used for the outer wrapper of the slideshow
	});
});
