// autocomplete
$(document).ready(function()
{
  $("#answer_Q_zip_A_2").autocomplete('http://www.zubat.net/jsp/autocomplete/zip.jsp',
  {
	dataType:"jsonp",
    width:280,
    max:1000,
    itemsType:"zip",
    zipSelectorId:"answer_Q_zip_A_2",
    inputElementId1:"answer_Q_zip_A_1",
    inputElementId2:"answer_Q_zip_A_2",
    highlight: function(value, term)
    {
      return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "i"), "<strong>$1</strong>");
    }
  });
  
  $("#answer_Q_zip_A_4").autocomplete('http://www.zubat.net/jsp/autocomplete/zip.jsp',
  {
	dataType:"jsonp",
    width:280,
    max:1000,
    itemsType:"zip",
    zipSelectorId:"answer_Q_zip_A_4",
    inputElementId1:"answer_Q_zip_A_3",
    inputElementId2:"answer_Q_zip_A_4",
    highlight: function(value, term)
    {
      return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "i"), "<strong>$1</strong>");
    }
  });

});

