/// <reference path="jquery.js"/>

//Commented out due to ie6 problems. The search is working just fine without it.

/*
function productSearch(){
  var searchterm = $("#searchstr").val();

  if(searchterm != "" && searchterm != "Søg"){
    document.location.href = "/Produkter/Search.aspx?searchstr=" + searchterm;
  }
  return false;
}
*/

$(document).ready(function() {
/*
  $("#searchstr").keydown(function(e){
    if (e.keyCode == 13) {
      productSearch();
      return false;
    }
  });

  $("button#search-button").bind("click", function(){
    //productSearch();
  });
*/
// this should be refactored to another file (Lars Buur - 25.jan 09)


$(".zipcode-lookup").blur(function(){
	
	var targetfield = $(this).attr('lookuptarget');
	
	$.get("/?altTemplate=AjaxProxy&ajax-lookupzip=" + this.value,
	  function(data){
	  	$('#' + targetfield).val(jQuery.trim(data));
	  });
	}
);

});
