$(document).ready(function(){
  
  $("input#searchField").focus(function(){
    
    if($(this).val() == "search")    
      $(this).val("");
    
  }).keydown(function(event){
   
    if(event.keyCode == 13)
      $("#bt_search").click();
  }); 
  
  $("#bt_search").click(function(){
    window.location = "/search?q=" + $("#searchField").val();
    return false;
  });
  
  
  
  $('ul.accordion').accordion({
    active: ".selected",
    autoHeight: false,
    header: ".opener",
    collapsible: true,
    event: "click"
  });


  $("h1").each(function(){
    var h = $(this);
    var text = h.text().replace("&", "%26");
    //h.attr("style", background);
  });
  
  $("h2.gfx").each(function(){
    var h = $(this);
    var text = h.text().replace("&", "%26");
    //h.attr("style", background);
  });
  
  
  
//   $(".test-your-needs-questions li input").checkbox({empty: '/images/custom/empty.png'});

  
  
  
  var peeps = 0; 
  $("#bird").click(function(){
    
    peeps++;
    if(peeps == 10){
        var img = "background-image: url(/images/bird"  + Math.floor(Math.random()*4) + ".gif);";
        $("#bird").attr("style", img);   
        peeps = 0;
    }
  });
  
  
  $("li.bottom_follow-us").mouseover(function(){
    $("#bird").attr("style", "background-image: url('/images/bird1.gif');");
  });            

  
});

function markerHtml(provider){
  var markerHtml = "<a style='display: block; width: 120px; height: 120px;' href='" + provider[3] + "'><img src='" + image + "' /></a>";
  return markerHtml;     
}

