// Document Ready
jQuery(document).ready(function() { 
        // superfish menus
		jQuery('ul.sf-menu, ul.sf-menu-side').superfish({ 
            delay:       300, // 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 
        }); 
		// open a link in a new window
		jQuery("a[href$='.pdf'], ._blank").click(function(){
			var newwindow = window.open(this.href, '_blank');
			newwindow.focus();
			return false;
		});

		//QC Form	
		jQuery(".qc-hidden").hide();                                 
                // Show the hidden fields
                jQuery("textarea,.submitBTN").focus(function() {                                   
                   jQuery(".qc-hidden").fadeIn("slow");
                });
                // If you click any of the defined elements below you will close the open fields. 
                jQuery("#left-column,#mast,#header,#top-navigation,#bottomRegion,#footer").click(function(){
                    jQuery(".qc-hidden").fadeOut();
                });
			//Read More link in Content - hide and show	
			jQuery('#text').hide();
			jQuery('a#toggle-text').click(function() {
			  jQuery('#text').toggle(400);
			  return false;
			});

		// accordion with special markup
		jQuery('#navigation').accordion({
			active: 0,
			header: '.head',
			navigation: false,
			event: 'mouseover',
			fillSpace: false,
			autoheight: false,
			animated: 'easeslide'
		});
		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		var accordions = jQuery('#navigation');
		
		jQuery('#switch select').change(function() {
			accordions.accordion("activate", this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			accordions.accordion("activate", -1);
		});
		jQuery('#switch2').change(function() {
			accordions.accordion("activate", this.value);
		});
		jQuery('#enable').click(function() {
			accordions.accordion("enable");
		});
		jQuery('#disable').click(function() {
			accordions.accordion("disable");
		});
		jQuery('#remove').click(function() {
			accordions.accordion("destroy");
			wizardButtons.unbind("click");
		});
		
		
		//Video located inside the Accordion menu
		jQuery(".mast-video-about-us1 a").attr({href: "video-about-us.html?keepThis=true&TB_iframe=true&height=460&width=425"});
		jQuery(".mast-video-about-us2 a").attr({href: "../video-about-us.html?keepThis=true&TB_iframe=true&height=460&width=425"});
		jQuery(".mast-video-az-colors1 a").attr({href: "video-Desert Smiles-az-colors.html?keepThis=true&TB_iframe=true&height=400&width=460"});
		jQuery(".mast-video-clouds1 a").attr({href: "../video-Desert Smiles-clouds.html?keepThis=true&TB_iframe=true&height=400&width=460"});
		jQuery(".mast-video-fish1 a").attr({href: "../video-Desert Smiles-fish.html?keepThis=true&TB_iframe=true&height=400&width=460"});
		jQuery(".mast-video-fish2 a").attr({href: "video-Desert Smiles-fish.html?keepThis=true&TB_iframe=true&height=400&width=460"});
		jQuery(".mast-video-swan1 a").attr({href: "video-Desert Smiles-swan.html?keepThis=true&TB_iframe=true&height=400&width=460"});
		jQuery(".mast-video-natural1 a").attr({href: "../video-Desert Smiles-natural.html?keepThis=true&TB_iframe=true&height=400&width=460"});
		jQuery(".video-cerec1 a").attr({href: "../video-cerec.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".video-cerec2 a").attr({href: "video-cerec.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".mast-video-ppm1 a").attr({href: "video-ppm.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".mast-video-ppm2 a").attr({href: "../video-ppm.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".video-gallery a").attr({href: "video-gallery.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".video-gallery2 a").attr({href: "../video-gallery.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".video-gallery3 a").attr({href: "../../video-gallery.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".mast-sleep-apnea1 a").attr({href: "video-snoring-sleep-apnea.html?keepThis=true&TB_iframe=true&height=365&width=425"});
		jQuery(".mast-video-testimonials1 a").attr({href: "../video-testimonials.html?keepThis=true&TB_iframe=true&height=465&width=425"});
		jQuery(".mast-video-testimonials2 a").attr({href: "../video-testimonials.html?keepThis=true&TB_iframe=true&height=465&width=425"});
		jQuery(".mast-video-sedation1 a").attr({href: "../video-sedation-dentistry.html?keepThis=true&TB_iframe=true&height=400&width=425"});
		jQuery(".mast-video-veneers1 a").attr({href: "../video-veneers.html?keepThis=true&TB_iframe=true&height=400&width=425"});
		jQuery(".mast-video-zoom1 a").attr({href: "../video-zoom.html?keepThis=true&TB_iframe=true&height=400&width=425"});
	
	// Fades 
	jQuery(".fade span").css("opacity","0");
		jQuery(".fade span").hover(
			function () {
			jQuery(this).stop().animate({
			opacity: 1
			}, "slow");
		}, 
		function () {
			jQuery(this).stop().animate({
			opacity: 0
			}, "slow");
		}
	);
		
		
		



});
