// Login section
$(document).ready(function() {
	$("#searchTxt").focus(
		function() {
			$(this).attr("value","");
	});
	
	$('input[name="cgi"]')[1].checked = true;
	
	// qTip tooltip styles
	$.fn.qtip.styles.FStip = {
	  width: 90,
      padding: 4,
      background: '#efeff0',
      fontSize: '9px',
      color: '#333333',
      textAlign: 'center',
      tip: 'topMiddle',
      border: {width: 3,radius: 3,color:'#d0d6df'}
    }
	
    // APPLY QTIP TOOLTIPS
    // elearning button
    $('.hSkillport').qtip({
      content: 'Learn online with these resources.',
      show: 'mouseover',
      hide: 'mouseout',
      
      position: {
        corner: {target:'bottomMiddle',tooltip:'topMiddle'}
      },
      style: 'FStip'
	});

    // help button
    $('.hHelp').qtip({
      content: 'Need help? Visit the Mines Help Center.',
      show: 'mouseover',
      hide: 'mouseout',
      
      position: {
        corner: {target:'bottomMiddle',tooltip:'topMiddle'}
      },
      style: 'FStip'
	});

    // blackboard button
    $('.hBBoard').qtip({
      content: 'Get started with the Blackboard academic suite.',
      show: 'mouseover',
      hide: 'mouseout',
      
      position: {
        corner: {target:'bottomMiddle',tooltip:'topMiddle'}
      },
      style: 'FStip'
	});

    // email button
    $('.hWebmail').qtip({
      content: 'Log in to your Mines email account.',
      show: 'mouseover',
      hide: 'mouseout',
      
      position: {
        corner: {target:'bottomMiddle',tooltip:'topMiddle'}
      },
      style: 'FStip'
	});

    // trailhead button
    $('.hTrailhead').qtip({
      content: 'Access your Mines Trailhead account.',
      show: 'mouseover',
      hide: 'mouseout',
      
      position: {
        corner: {target:'bottomMiddle',tooltip:'topMiddle'}
      },
      style: 'FStip'
	});

});

$(function(){
    $('#cgi1').click(function() {
        $('#searchTxt').attr('name', 'qt');
        $(this).parent().parent().attr('action', 'http://www.is.mines.edu/dirsearch/dirsearch.asp');
    });

    $('#cgi2').click(function() {
    	$('#searchTxt').attr('name', 'q');
        $(this).parent().parent().attr('action', 'http://sponge.mines.edu/search');
    });
});