$(document).ready(function(){
						   
///////////////////// HIDE ELEMENTS

//$('id,class,element').hide();

//////////////////// QTIPS TOOLTIPS

// find all links with 'target="_blank' and add qTip tooltips

$('.external-link').qtip({
   content: 'This link opens a third party website in a new window.  <em>Indian Affairs is not responsible for content on third party websites.</em>',
   position: { adjust: { screen: true }, type: 'absolute', 
      corner: {
         target: 'bottomLeft'
      } },
  style: { 
      width: 200,
      padding: 5,
      color: '#333',
      textAlign: 'left',
      border: {
         width: 2,
         radius: 4
      },
      tip: 'topLeft',
      name: 'blue'
   }
});

$('.internal-link').qtip({
   content: 'This link will launch Indian Affairs content in a new window.',
   position: { adjust: { screen: true }, type: 'absolute', 
      corner: {
         target: 'bottomLeft'
      } },
   style: { 
      width: 150,
      padding: 5,
      color: '#999',
      textAlign: 'left',
      border: {
         width: 2,
         radius: 4,
         color: '#ccc'
      },
      tip: 'topLeft',
      name: 'light'
   }
});

// find all links with 'target="_blank' and add qTip tooltips
//
//$('a[arget="_blank"]').qtip({
//   content: 'This link opens in a new window and <b>may leave</b> the Indian Affairs website.  Indian Affairs is not responsible for content on third party websites.',
//   position: { adjust: { screen: true }, type: 'absolute' },
//   style: { 
//      width: 300,
//      padding: 5,
//      color: '#333',
//      textAlign: 'left',
//      border: {
//         width: 3,
//         radius: 5
//      },
//      tip: 'topLeft',
//      name: 'blue'
//   }
//});

//////////////////// SHOW/HIDE FADE DIVS

// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='Read More.';
var hideText='Hide.';

// initialise the visibility check
var is_visible = false;

// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.toggle').prev().append(' (<a href="#" class="toggleLink">'+showText+'</a>)');

// hide all of the elements with a class of 'toggle'
$('.toggle').hide();

// capture clicks on the toggle links
$('a.toggleLink').click(function() {

// switch visibility
is_visible = !is_visible;

// change the link depending on whether the element is shown or hidden
$(this).html( (!is_visible) ? showText : hideText);

// toggle the display - uncomment the next line for a basic "accordion" style
//$('.toggle').hide();$('a.toggleLink').html(showText);
$(this).parent().next('.toggle').toggle('slow');

// change the link text depending on whether the element is shown or hidden
//if ($(this).text()==showText) {
//$(this).text(hideText);
//$(this).parent().next('.toggle').slideDown('slow');
//}
//else {
//$(this).text(showText);
//$(this).parent().next('.toggle').slideUp('slow');
//};

// return false so any link destination is not followed
return false;

});

});

