/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
// "static" var declaration
var MSG_TYPE_POSITIVE = 1;
var MSG_TYPE_NEUTRAL = 2;
var MSG_TYPE_NEGATIVE = 3;

var lastFunctionMap = 0;
var filterTarget = "lot/list/";
var keywords = '';
var excludes = '';
var categoryFilters = new Array();
var houseFilters = new Array();
var timeFilters = new Array();
var clearAdv = false;
var priceFromSearch = '';
var priceToSearch = '';
var dateFromSearch = '';
var dateToSearch = '';
var categoryHitCount = {};
var houseHitCount = {};


// extend array prototype with in_array search function
Array.prototype.in_array = function(needle) {
   for(var i=0; i < this.length; i++) if(this[ i] === needle) return true;
   return false;
}
function findHash(hash, table) {
   for (var h in table) {
      if (h == hash) return true;
   }
   return false;
}

function get_calendar(y, m)
{
   $("#calendar_exp").load("util/calendar/?y=" + y + "&m=" + m);
}

function contentLoadWithHistory()
{
   if ($(this).attr('target') == "")
   {
      $.historyLoad($(this).attr('href'));
      return false;
   }
   
}

function resetScroll()
{
   window.scrollTo(0, 0);
}

// removes error labels after validation errors
function removeErrorLabels()
{
   $('.validation_error').remove();
}

		
function setErrorLabels(errors)
{
   var error_msg = '';
   $.each(errors, function(i,v){
      $('.error_'+i).append('<span class="validation_error nobr">' + v + '</span>');
      error_msg += v + '\n<br />';
   });
   return error_msg;
}
function setSuccessLabel(msg)
{
   $('span.success_msg').html(msg+'<br /><br />');
}

