$(document).ready(function() {
   // Create the qTip only if it wasn't hidden previously
   if($.cookie('qtip_hidden') !== "true") {
      $('.selector').qtip({
         content: {
		 	    text: 'Using our Pet Sitter Locator!',
		 	    title: {
		 	 	text: 'Find Your Pet Sitter',
		 	 	button: 'Close'
		 	 	   }
		},
         show: {
            when: false,
            ready: true
         },
         hide: {
	    when: { event: 'click' },
	    effect: { type: 'slide' }
	 },
	 style: {
		border: {
			width: 3,
			radius: 6
			},
		name: 'green',
		padding: '7px 13px',
		width: {
			max: 210,
			min: 0
		       },
	tip: true
	},
		position: {
		   corner: {
		      target: 'topMiddle',
		      tooltip: 'bottomMiddle'
		   }
},
         api: {
            onRender: function() {
               // Hide the tooltip when it is clicked
               this.elements.tooltip.click(this.hide)
            },
            onHide: function() {
               // Set a state cookie
               $.cookie('qtip_hidden', true, { path: '/', expires: 10 });

               // Destroy me since I have no futher use!
               this.destroy();
            }
         }
      })
   }
});