






$(document).ready(function() {

		$("ul.MainNav").superfish({
			delay:         700,                // 700 the delay in milliseconds that the mouse can remain outside a submenu without it closing 
			animation:     {opacity:'show',height:'show'},   // an object equivalent to first parameter of jQuery’s .animate() method 
			speed:         700,           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
			autoArrows:    true                // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
		});



		$("ul.ProcDropdown").superfish({
			delay:         700,                // 700 the delay in milliseconds that the mouse can remain outside a submenu without it closing 
			animation:     {opacity:'show'},   // an object equivalent to first parameter of jQuery’s .animate() method 
			speed:         700,           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
			autoArrows:    true                // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
		});

/* 
============================================================
=================== Light box - FancyBox ===================
============================================================

Files Required: 
jquery-1.3.2.min.js
jquery.fancybox-1.3.1.js


-------------------------------------------------- */
	
	$('a[href*="images/"]').fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'speedIn'		:	600, 
			'speedOut'		:	200 
		});
	
	
	
	$("a.iframe").fancybox({
					'width'				: '75%',
					'height'			: '75%',
					'autoScale'			: false,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic',
					'type'				: 'iframe'
				});
		
	$("a.Inline").fancybox({
					'autoDimensions'    : true,
					'autoScale'			: true,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic'
				});
	
	
	
	

	
/* 
============================================================
============ Image Slideshow- Fading In and Out ============ 
============================================================

Files Required: 
jquery-1.3.2.min.js
jquery.cycle.all.js

-------------------------------------------------- */
	
	$(".magazines").cycle({ 
		fx: "fade",			/* controls transition effect -- see below for more effects */
		timeout: 3000,		/* milliseconds between slide transitions  */	
		speed:  1000,		/* controls speed of transition */	
		pause: 1
	
	});
	
	$(".associations").cycle({ 
		fx: "fade",			/* controls transition effect -- see below for more effects */
		timeout: 3000,		/* milliseconds between slide transitions  */	
		speed:  1000,		/* controls speed of transition */	
		pause: 1
	
	});
	
	$(".bna").cycle({ 
		fx: "fade",			/* controls transition effect -- see below for more effects */
		timeout: 3000,		/* milliseconds between slide transitions  */	
		speed:  1000,		/* controls speed of transition */	
		pause: 1
	
	});



/* 
============================================================
========================== Tabs ============================
============================================================

-------------------------------------------------- */
	
	var ts = $('.TabSection');	
	var tl = $('.TabLinks a'); var tlFirst = tl.filter(':first-child');
	var tc = $('.TabContent');	
	var tls = 'tabSelected'; var tlsClass = '.'+tls; 
	var tds = 'tabDivs';
	var dur = 400;
	
	tc.css({'position':'relative'});
	tl.each(function(){
			href = $(this).attr('href');
			$(href).hide().css({'position': 'absolute', 'top':'0', 'left':'0'}).addClass(tds);
			$(this).filter(':last-child').addClass('Last');
		});
	tl.parent().append('<br class="Clear" />');
	
	if(tlFirst){
		tlFirst.each(function(){
			href = $(this).attr('href');
			tlFirst.addClass(tls);
			$(href).show();
		});
		
	}
	
	
	tl.click(function(){
			selected = $(this).siblings(tlsClass);
			selectHref= selected.attr('href');
			thisHref = $(this).attr('href');
			
			selected.removeClass(tls);
			$(selectHref).fadeOut(dur);
			$(this).addClass(tls);
			$(thisHref).delay(dur/1.5).fadeIn(dur);
			
			if ($(this).hasClass(tls)){return false;}//Stops jumping
		});
	



/* 
============================================================
======================= ScrollingTo ========================
============================================================

-------------------------------------------------- */

	
	$('.MiniNav a').ScrollingTo();
	$('.Top').ScrollingTop();
	
	

/* 
============================================================
========================== Misc ============================
============================================================

-------------------------------------------------- */

	/* DropDown List Arrows */
	$('.ProcDropdown ul div li').prepend('<span>&raquo;</span>');	
	$('.ProcDropdown ul div li:nth-child(3n+0)').addClass('Last').after('<br clear="all" />');
	$('.ProcDropdown ul h3:first').addClass('First');
	
	
	
	
	//Search Button Value set to nothing
	$('.search_button').val('');
	
	
	
	
	// Testimonial Sorting
	$('#DoubleColT').children('.TestimonialBox:even').addClass('TestimonialLeft');
	$('#DoubleColT').children('.TestimonialBox:odd').addClass('TestimonialRight').after('<br class="Clear" /><hr/>');
	

});	// End Document.ready function





$(window).load(function (){

	/* 
	============================================================
	======================= Reflections ========================
	============================================================
	
	-------------------------------------------------- */


	$("#PatientList img").reflect({
		opacity:0.2,height:0.5
	}).parent().css({'float':'left','padding-right':'15px'});

	$('#PatientList li').contents().filter(function(){return this.nodeType == 3;}).wrap('<span />').end().end().append('<br class="Clear"/>');

		$("img.ImplantStyles").reflect({
		opacity:0.5,height:0.2
	});

    $("img.ImplantStyles2").reflect({
		opacity:0.5,height:0.5
	});


});



