/* This can change per site*/

/* the next line is an example of how you can override default options globally (currently commented out) ... */

 // $.fn.cluetip.defaults.tracking = true;
  // $.fn.cluetip.defaults.width = 'auto';
$(document).ready(function() {

 // $.cluetip.setup({insertionType: 'insertBefore', insertionElement: 'div:first'});
 // $.fn.cluetip.defaults.ajaxSettings.beforeSend = function(ct) {
 //     console.log(this);
 // };

//default theme
  $('a.title').cluetip({splitTitle: '|'});
  $('a.basic').cluetip();
  $('a.custom-width').cluetip({width: '700px', showTitle: false});
  $('h4').cluetip({attribute: 'id', hoverClass: 'highlight'});
  $('#sticky').cluetip({sticky: true, closePosition: 'title', arrows: true });
  $('#examples a:eq(5)').cluetip({
    hoverClass: 'highlight',
    sticky: true,
    closePosition: 'bottom',
    closeText: '<img src="cross.png" alt="close" width="16" height="16" />',
    truncate: 60
  });
  $('.clickme_local').cluetip({local:true, clone:true, activation: 'click', sticky: true, width: 660, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});

$('.clickme_local_300').cluetip({local:true, activation: 'click', sticky: true, width: 300, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});

  $('a.load-local').cluetip({local:true, hideLocal: true, sticky: true, arrows: true, cursor: 'pointer'});
  $('#clickme').cluetip({activation: 'click', sticky: true, width: 650});
  $('.clickme2').cluetip({activation: 'click', sticky: true, width: 660, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
  $('.clickme2_local').cluetip({local:true, activation: 'click', sticky: true, width: 660, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});

  $('.clickme2_local2').cluetip({local:true, activation: 'click', sticky: true, width: 660, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true, onShow: function($cluetip, $cluetipInner) {
      var selected = $('#Test select').val();
      $cluetipInner.find('select').val(selected);
    }});

	// var selected = $('#Test select').val();
	//       $cluetipInner.find('select').val(selected);

$('.clickme2_200').cluetip({activation: 'click', sticky: true, width: 200, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
$('.clickme2_300').cluetip({activation: 'click', sticky: true, width: 300, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
$('.clickme2_400').cluetip({activation: 'click', sticky: true, width: 400, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
$('.clickme2_500').cluetip({activation: 'click', sticky: true, width: 500, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
$('.clickme2_600').cluetip({activation: 'click', sticky: true, width: 600, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
$('.clickme2_700').cluetip({activation: 'click', sticky: true, width: 700, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
$('.clickme2_800').cluetip({activation: 'click', sticky: true, width: 800, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});
$('.clickme2_900').cluetip({activation: 'click', sticky: true, width: 900, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />', draggable: true});

  $('ol:first a:last').cluetip({tracking: true});
  $('.click_hover').cluetip({activation: 'click', activation: 'hover', sticky: true, width: 650, cluetipClass: 'jtip',closeText: '<img src="/images/icons_red/cancel.png" alt="close" width="16" height="16" />'});

// jTip theme
  $('a.jt:eq(0)').cluetip({
    cluetipClass: 'jtip', 
    arrows: true, 
    dropShadow: false,
    sticky: true,
    mouseOutClose: true,
    closePosition: 'title',
    closeText: '<img src="cross.png" alt="close" />'
  });
  $('a.jt:eq(1)').cluetip({cluetipClass: 'jtip', arrows: true, dropShadow: false, hoverIntent: false});
  $('span[title]').css({borderBottom: '1px solid #900'}).cluetip({splitTitle: '|', arrows: true, dropShadow: false, cluetipClass: 'jtip'});

  $('a.jt:eq(2)').cluetip({
    cluetipClass: 'jtip', 
    arrows: true, 
    dropShadow: false, 
    height: '150px', 
    sticky: true,
    positionBy: 'bottomTop'    
  });

  $('a.jt:eq(3)').cluetip({local: true, hideLocal: false});
  
  $('a.jt:eq(4)').cluetip({
    cluetipClass: 'jtip', arrows: true, 
    dropShadow: false, 
    onActivate: function(e) {
      var cb = $('#cb')[0];
      return !cb || cb.checked;
    }
  });

// Rounded Corner theme
  $('ol.rounded a:eq(0)').cluetip({splitTitle: '|', dropShadow: false, cluetipClass: 'rounded', showtitle: false});
  $('ol.rounded a:eq(1)').cluetip({cluetipClass: 'rounded', dropShadow: false, showtitle: false, positionBy: 'mouse'});
  $('ol.rounded a:eq(2)').cluetip({cluetipClass: 'rounded', dropShadow: false, showtitle: false, positionBy: 'bottomTop', topOffset: 70});
  $('ol.rounded a:eq(3)').cluetip({cluetipClass: 'rounded', dropShadow: false, sticky: true, ajaxCache: false, arrows: true});
  $('ol.rounded a:eq(4)').cluetip({cluetipClass: 'rounded', dropShadow: false});    
});

//unrelated to clueTip -- just for the demo page...

$(document).ready(function() {
  $('div.html, div.jquery').next().css('display', 'none').end().click(function() {
    $(this).next().toggle('fast');
  });
  
  $('a.false').click(function() {
    return false;
  });
});
  




