function initModalQtip()
{
	// Create the modal backdrop on document load so all modal tooltips can use it
   $('<div id="qtip-blanket">').css(
	{
         position: 'absolute',
         top: $(document).scrollTop(), // Use document scrollTop so it's on-screen even if the window is scrolled
         left: 0,
         height: $(document).height(), // Span the full document height...
         width: '100%', // ...and full width
         opacity: 0.7, // Make it slightly transparent
         backgroundColor: 'black',
         zIndex: 5000  // Make sure the zIndex is below 6000 to keep it below tooltips!
      }).appendTo(document.body) // Append to the document body
      .hide(); // Hide it initially
}

function showQuikPikTip()
{
	if($('#whats-qp')) 
	{
		$('#whats-qp').qtip(
		{
			content:
			'QuikPik numbers are a quick and easy way for book subscribers to ' +
			'easily find lodging listings. If you are not a book subscriber, then you ' +
			'can safely ignore the QuikPik feature.',
			
			position:
			{	
				corner:
				{
					target:'leftMiddle',
					tooltip:'middleRight'
				}
			},
			style:
			{
				tip:'rightTop',
				background:'#ffffcc',
				padding:10,
				border:
				{
					color:'#003300'
				}
			}
		});
	}	
}

function initIContactModal()
{
	$('#email-join-link').qtip(
   {
      content: {
         title: {
            text: 'Join our e-Mail List',
            button: 'Close'
         },
         url:'/modals/joinemail.cfm'
      },
      position: {
         target: $(document.body), // Position it via the document body...
         corner: 'center' // ...at the center of the viewport
      },
      show: {
         when: 'click', // Show it on click
         solo: true // And hide all other tooltips
      },
      hide: false,
      style: {
         width: { min: 450, max: 500 },
         padding: '14px',
         border: {
            width: 9,
            radius: 9,
            color: '#666666'
         },
         name: 'light'
      },
      api: {
         beforeShow: function()
         {
			$('#signUp').empty();
            // Fade in the modal "blanket" using the defined show speed
            $('#qtip-blanket').fadeIn(this.options.show.effect.length);
			
         },
         beforeHide: function()
         {
            // Fade out the modal "blanket" using the defined hide speed
            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
         }
      }
   })

}

function initTAFModal()
{
	$('#tellafriend-link').qtip(
   {
      content: {
         title: {
            text: 'Tell a Friend',
            button: 'Close'
         },
         url:'/referrals/index.cfm'
      },
      position: {
         target: $(document.body), // Position it via the document body...
         corner: 'center' // ...at the center of the viewport
      },
      show: {
         when: 'click', // Show it on click
         solo: true // And hide all other tooltips
      },
      hide: false,
      style: {
         width: { min: 450, max: 500 },
         padding: '14px',
         border: {
            width: 9,
            radius: 9,
            color: '#666666'
         },
         name: 'light'
      },
      api: {
         beforeShow: function()
         {
			$('#signUp').empty();
            // Fade in the modal "blanket" using the defined show speed
            $('#qtip-blanket').fadeIn(this.options.show.effect.length);
			
         },
         beforeHide: function()
         {
            // Fade out the modal "blanket" using the defined hide speed
            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
         }
      }
   })

}

function showTafQtip()
{
	//show the tell-a-friend pop-up if they have not seen it and they are a logged in user
	if((!taf_shown) && (show_taf==true)){
	 var taf_tip = $(document.body).qtip(
	  	{
	      content: {
	         title: {
	            text: 'Tell a Friend about ASU!',
	            button: 'Close'
	         },
	         url:'/referrals/modal.cfm'
	      },
	      position: {
	         target: $(document.body), // Position it via the document body...
	         corner: 'center' // ...at the center of the viewport
	      },
	      show: {
	         when: 'mouseenter', // Show it on mouse enter
	         solo: true // And hide all other tooltips
	      },
	      hide: false,
	      style: {
	         width: { min: 450, max: 500 },
	         padding: '14px',
	         border: {
	            width: 9,
	            radius: 10,
	            color: '#cc0000'
	         },
	         name: 'light'
	      },api: {
			onShow: function(){
				document.cookie = "taf_shown=true";// + new Date('January 1, 2038').toGMTString();
			},	
			onHide: function(){
				
				location.href='';
				} 
			}
		});

	//	show_taf = false;
//		document.cookie = "taf_shown=true";// + new Date('January 1, 2038').toGMTString();
	}
}


/*
function showModalQtip(content,objParams)
{
	$('#email-join-link').qtip(
						   {
						      content: {
						         title: {
						            text: 'Join our e-Mail List',
						            button: 'Close'
						         },
						         text: $('#signUp').html()
						      },
						      position: {
						         target: $(document.body), // Position it via the document body...
						         corner: 'center' // ...at the center of the viewport
						      },
						      show: {
						         when: 'click', // Show it on click
						         solo: true // And hide all other tooltips
						      },
						      hide: false,
						      style: {
						         width: { max: 350 },
						         padding: '14px',
						         border: {
						            width: 9,
						            radius: 9,
						            color: '#666666'
						         },
						         name: 'light'
						      },
						      api: {
						         beforeShow: function()
						         {
									$('#signUp').empty();
						            // Fade in the modal "blanket" using the defined show speed
						            $('#qtip-blanket').fadeIn(this.options.show.effect.length);

						         },
						         beforeHide: function()
						         {
						            // Fade out the modal "blanket" using the defined hide speed
						            $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
						         }
						      }
						   });

						   // Create the modal backdrop on document load so all modal tooltips can use it

}
*/