// JavaScript Document

$(function() {
	$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$("ul.topnav li.thisNav .dropdown").hover(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	$(".popupNav").fancybox({
		'width'				: '20%',
		'height'			: '35%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	$('#slideshow1').cycle({ 
		prev:   '#prev', 
		next:   '#next', 
		pause:	1, 
		timeout: 8000 
	});
	$(".pics").hover(function(){
		$('#pauseNotice').fadeIn('fast', function() {
			// Animation complete
		});
	}, 
	function () {
		  $('#pauseNotice').fadeOut('fast', function() {
			// Animation complete
		  });
	});
	$("#getBookCake").hover(function(){
		$('#getBookCake').stop().animate({
			marginTop: '0'
		}, {
			duration: 500, 
			specialEasing: {
		}, 
			complete: function() {
				
			}
		});
	}, 
	function () {
		$('#getBookCake').stop().animate({
			marginTop: '-195'
		}, {
			duration: 500, 
			specialEasing: {
		}, 
			complete: function() {
				
			}
		});
	});
	$("#testimonials").hover(
	function () {
		$('#hideControls').fadeIn('slow', function() {
		// Animation complete
		});
	});
	$('#controlClickHere').click(function() {
		$('#testimonials').animate({
			marginTop: '0'
		}, {
			duration: 1000, 
			specialEasing: {
		}, 
			complete: function() {
				$("#controlClickHere").css({'display' : 'none'});
				$(".controlClose").css({'display' : 'block'});
				$('.hideControls').fadeIn('slow', function() {
					// Animation complete
				});
			}
		});
	});
	$('.controlClose').click(function() {
		$('#testimonials').animate({
			marginTop: '-370'
		}, {
			duration: 1000, 
			specialEasing: {
		}, 
			complete: function() {
				$(".controlClose").css({'display' : 'none'});
				$("#controlClickHere").css({'display' : 'block'});
				$('.hideControls').fadeOut('fast', function() {
					// Animation complete
				});
			}
		});
	});
	
	$("img.rHover").mouseover(function() { 
		var src = $(this).attr("src").match(/[^\.]+/) + "Hover.gif";
		$(this).attr("src", src);
	}).mouseout(function() {
		var src = $(this).attr("src").replace("Hover", "");
		$(this).attr("src", src);
	});
});
<!-- Original:  Eric King (eric_andrew_king@hotmail.com) -->
<!-- Web Site:  http://redrival.com/eak/ -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }}


<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function Start(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");}
// End -->

