$(function(){
  // load thickbox dependencies
  $("head").append('<link rel="stylesheet" type="text/css" href="/styles/thickbox.css" />');

// Hiding various divs  
  $("#video01").css({'display':'none'});
  $("#video02").css({'display':'none'});
  $("#video03").css({'display':'none'});
  $("#request").css({'display':'none'});
  $(".full").css({'display':'none'});

// For survey form
  var blanktext = '';
// Question #1, find what you were looking for?
  $('#find-no-extra').css("display","none");
  $('#find-no').click(function() {
   $('#find-no-extra').show();
  });
  $('#find-yes').click(function() {
   $('#find-no-extra').hide().val(blanktext);
  });

// Question #7, learn about MTS?
  $('#learn_about_extra').css("display","none");
  $('#learn_about-5').click(function() {
   $('#learn_about_extra').show();
  });
  $('#learn_about-1,#learn_about-2,#learn_about-3,#learn_about-4').click(function() {
   $('#learn_about_extra').hide();
   $('learn_about_other').val(blanktext);
  });

// Question #8, find what you were looking for?
  $('#prev_use_extra').css("display","none");
  $('#prev_use-3').click(function() {
   $('#prev_use_extra').show();
  });
  $('#prev_use-2,#prev_use-1').click(function() {
   $('#prev_use_extra').hide().val(blanktext);
  });

// For Pharmacy request form
  $('#samples-extra').css("display","none");
  $('#samples').click(function() {
   $('#samples-extra').toggle();
  });

// For returns form
  $('#why_return_other-extra').css("display","none");
  $("#why_return").change(function() {
    var str = "";
    $("select option:selected").each(function () { str = $(this).val(); });
    if (str == 'other') { $('#why_return_other-extra').css("display","block"); }
    else { $('#why_return_other-extra').hide();$('#why_return_other').val(blanktext); }
  }).trigger('change');
  

 
  // Add icons to pdf and wma links
  $("a[href$='.pdf']").addClass("pdf").attr("target", "_blank");
  $("a[href$='.wma']").addClass("wma").attr("target", "_blank");

  //Add external link icon to external links - 
  //You might also want to set the _target attribute to blank
//  $('a').not('a.thickbox').filter(function() {
    //Compare the anchor tag's host name with location's host name
//    return this.hostname && this.hostname !== location.hostname;
//    }).addClass("external").attr("target", "_blank");
//  });


  
});
