
/*
========================================================
============ Forms- Validator and functions ============ 
========================================================

Files Required: None
Forms should be mapped in http://admin.plasticsurgerystudios.com/

-------------------------------------------------- */

// CLEAR FORM FUNCTION

function clearText(thefield) {
if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} function replaceText(thefield) {
if (thefield.value=="") { thefield.value = thefield.defaultValue }
}






$(document).ready(function() {
						   

	
	/* 
	============================================================
	============ Multi-Tiered Dropdowns - Superfish ============ 
	============================================================
	*/
	$("form.qContact").validationEngine({
			validationEventTriggers:"blur"
	});


	$("ul.Nav").superfish({
						delay:         1000,                // 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:         'normal',           // 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
	
	Just add the class of fancybox, iframe or inline to any element.
	-------------------------------------------------- */
	
	$("a.fancybox").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'    : false,
					'autoScale'			: false,
					'transitionIn'		: 'elastic',
					'transitionOut'		: 'elastic'
				});
	
	$(".Fade").cycle({ 
		fx: "fade",			/* controls transition effect -- see below for more effects */
		speed:  3500,		/* controls speed of transition */	
		pause: 1

	});

	$(".Shuffle").cycle({ 
		fx: "zoom",			/* controls transition effect -- see below for more effects */
		speed:  4500, 		/* controls speed of transition */	
		pause: 1
	});
/* 
	============================================================
	================= Vertical Scroll ========================== 
	============================================================
	
	Files Required: None
	
	-------------------------------------------------- */

	$('ul.scroll a , p.scroll a').bind('click',function(event){
		var $anchor = $(this);

		$('html, body').stop().animate({
			scrollTop: $($anchor.attr('href')).offset().top
		}, 1500,'easeInOutExpo');
		/*
		if you don't want to use the easing effects:
		$('html, body').stop().animate({
			scrollTop: $($anchor.attr('href')).offset().top
		}, 1000);
		*/
		event.preventDefault();
	});
		
	


        $("ul#Nav").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 
        });




	
});/*END DOCUMENT READY*/		
	
		
		
		
