//javascript for Dream Retreats

jQuery(document).ready(function($) {
	jQuery('.ngg-galleryoverview').append('<p>Go back to main <a href="http://dream-retreats.com/gallery">Gallery</a></p>'); 
	jQuery('a.fixedTip').aToolTip({  
		fixed: true  
	});
	//rotator
	jQuery('#header #rotator').cycle({ 
    		fx:    'fade', 
    		speed:  3500,
    		pause:  1,
    		timeout:  7000
 	});
 	//ask Todd Form
 	jQuery("#ask-todd").validate({
 		errorLabelContainer: "#ask-todd-errors",
		wrapper: "li",
		rules: {
			name: "required",
			message: "required",
     		email: {
       			required: true,
       			email: true
     		}	
   		},
   		submitHandler: function(form) {
   			jQuery(form).ajaxSubmit();
   			jQuery('#ask-todd').fadeOut(400, function() {
   				jQuery('#thankyou').fadeIn(400);
   			}); 
   		},
   		messages: {
   			name: {
   				required: "Name is required"
   			},
   			email: {
   				required: "Email is required",
   				email: "Email is invalid"
   			},
   			message: {
   				required: "Please enter a question"
   			}
   		}
	});//end of ask todd form

	$.fn.qtip.styles.mystyle = { // Last part is the name of the style
   		width: 150,
   		background: '#1a0c01',
   		color: '#fbefdf',
   		textAlign: 'center',
   		border: {
      		width: 0,
      		radius: 3,
      		color: '#7f6d47',
   		},
   		tip: 'topRight',
   		//name: 'dark' // Inherit the rest of the attributes from the preset dark style
	};
	
	jQuery('ul.social li a.facebook').qtip({
   		content: 'Follow Us on Facebook',
   		style: 'mystyle', // The name of the newly created custom style above
   		position: {
      		corner: {
         			target: 'bottomLeft',
         			tooltip: 'topRight'
      		}
   		},
   		show: 'mouseover',
   		hide: 'mouseout'
	});

	jQuery('ul.social li a.twitter').qtip({
   		content: 'Follow Us on Twitter',
   		style: 'mystyle', // The name of the newly created custom style above
   		position: {
      		corner: {
         			target: 'bottomLeft',
         			tooltip: 'topRight'
      		}
   		},
   		show: 'mouseover',
   		hide: 'mouseout'
	});

	jQuery('ul.social li a.rss').qtip({
   		content: 'Get automatic updates with landscape tips and tricks',
   		style: 'mystyle', // The name of the newly created custom style above
   		position: {
      		corner: {
         			target: 'bottomLeft',
         			tooltip: 'topRight'
      		}
   		},
   		show: 'mouseover',
   		hide: 'mouseout'
	});


	

});//thats all doc ready

