// @auth ghunt
// @name search.js
// @desc search the site using the text input on the top right
// @change
//   2011-10-07 ghunt
//     created the file
//   2011-11-03 cvo
//     changed var url to account for iFrame

jQuery(document).ready(function() {
  jQuery('#search').keyup(function(e) {
    if(e.keyCode == 13)
      doSearch();
  });
  
  jQuery('#doSearch').click(function() {
    doSearch();
  });
});

function doSearch() {
  var j = jQuery.noConflict();
  var query = j('#search').val();
  query = j.trim(query);
  var url = 'http://shop.samsonite.com/s?searchKeywords=' + query;
  window.parent.location = url;
}
