﻿function jgt_hide(x) {document.getElementById(x).style.visibility = 'hidden';}


function jgt_setupQtip()
{
   $('a[rel="modal"]:first').qtip(
   {
      content: {
         title: {
            text: '<span id="quickinfo_header"><center>&nbsp;&nbsp;Hours &amp; Locations&nbsp;&nbsp;</center></span>',
            button: '<img alt="[Close]" id="quickinfo_close" src="img/quickinfo_close.png" width="17" height="17" border="0"/>'
         },
		url: 'include/_quickinfo.html'
      },
      position: {
         target: $(document.getElementById("btn_quickstoreinfo")), // Position it via the document body...
         corner: {
         	target: 'rightBottom', // ...at the center of the viewport
         tooltip: 'leftBottom'}
      },
      show: {
         when: 'click', // Show it on click
         solo: true, // And hide all other tooltips
         effect:  {type: 'fade', length: 400 }
      },
      hide: {
      	when: 'unfocus',
		effect: { type: 'fade', length: 200 }
      },
      style: {
         width: { max: 550, min: 550 },
         padding: '14px',
         border: {
            width: 3,
            radius: 7,
            color: '#000000'
         },
         name: 'light'
      },
      api: {
         beforeShow: function()
         {
            // 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
   $('<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.2, // 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 jgt_setupInatQtip()
{
   $('a[rel="international"]:first').qtip(
   {
      content: {
         title: {
            text: '<span id="inat_header"><center>&nbsp;&nbsp;International Shipping&nbsp;&nbsp;</center></span>',
            button: '<img alt="[Close]" id="quickinfo_close" src="img/quickinfo_close.png" width="17" height="17" border="0"/>'
         },
		url: 'include/_international.html'
      },
      position: {
         target: $(document.getElementById("btn_international")), // Position it via the document body...
         corner: {
         	target: 'leftTop', // ...at the center of the viewport
         tooltip: 'rightTop'}
      },
      show: {
         when: 'click', // Show it on click
         solo: true, // And hide all other tooltips
         effect:  {type: 'fade', length: 400 }
      },
      hide: {
      	when: 'unfocus',
		effect: { type: 'fade', length: 200 }
      },
      style: {
         width: { max: 500, min: 500 },
         padding: '14px',
         border: {
            width: 3,
            radius: 7,
            color: '#000000'
         },
         name: 'light'
      },
      api: {
         beforeShow: function()
         {
            // 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 jgt_setupLinkQtip()
{
   $('a[rel="modal"]:first').qtip(
   {
      content: {
         title: {
            text: '<span id="quickinfo_header"><center>&nbsp;&nbsp;Hours &amp; Locations&nbsp;&nbsp;</center></span>',
            button: '<img alt="[Close]" id="quickinfo_close" src="img/quickinfo_close.png" width="17" height="17" border="0"/>'
         },
		url: 'include/_quickinfo.html'
      },
      position: {
         target: $(document.getElementById("link_quickInfoImg")), // Position it via the document body...
         corner: {
         	target: 'rightBottom', // ...at the center of the viewport
         tooltip: 'rightTop'}
      },
      show: {
         when: 'click', // Show it on click
         solo: true, // And hide all other tooltips
         effect: { type: 'fade', length: 800 }
      },
      hide: {
      	when: 'unfocus',
        effect: { type: 'fade', length: 400 }
      },
      style: {
         width: { max: 550, min: 550 },
         padding: '14px',
         border: {
            width: 3,
            radius: 7,
            color: '#000000'
         },
         name: 'light'
      },
      api: {
         beforeShow: function()
         {
            // 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
   $('<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.2, // 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
}
