function showHideDropMenu(id){
	var e = document.getElementById(id);
	if (e.className == 'over'){
		e.className = '';
	}
	else {
		e.className = 'over';
	}
}

function checkEnter(e, buttonId){
	var cCode;
	if ( e && e.which ) {
		cCode = e.which;
	}
	else {
		cCode = e.keyCode;
	}
	if ( cCode == 13 ) {
		document.getElementById(buttonId).click();
		return false;
	}
	else {
		return true;
	}
}

function selectTab(tabName)
{
    
    var selected = 0;

    for (i=0;i<tabs.length;i++)
    {
        $(tabs[i][0]).style.display = 'none';
        $(tabs[i][0] + '-tab').removeClassName('active');
        
        if (tabName == tabs[i][0])
            selected = i;
    }

    $(tabName).style.display = 'block';
    $(tabName + '-tab').addClassName('active');
    
    if (tabs[selected][1] && tabs[selected][2] && tabs[selected][3])
        window.gmap.map.setCenter(new GLatLng(tabs[selected][1], tabs[selected][2]), tabs[selected][3]);
}

function search(query, target){
	window.location = target + encodeURIComponent(query); 
	return false;
}

Effect.Scroll = Class.create();
Object.extend(Object.extend(Effect.Scroll.prototype, Effect.Base.prototype), {
  initialize: function(element) {
    this.element = $(element);
    var options = Object.extend({
      x:    0,
      y:    0,
      mode: 'absolute'
    } , arguments[1] || {}  );
    this.start(options);
  },
  setup: function() {
    if (this.options.continuous && !this.element._ext ) {
      this.element.cleanWhitespace();
      this.element._ext=true;
      this.element.appendChild(this.element.firstChild);
    }
   
    this.originalLeft=this.element.scrollLeft;
    this.originalTop=this.element.scrollTop;
   
    if(this.options.mode == 'absolute') {
      this.options.x -= this.originalLeft;
      this.options.y -= this.originalTop;
    } else {
   
    }
  },
  update: function(position) {   
    this.element.scrollLeft = this.options.x * position + this.originalLeft;
    this.element.scrollTop  = this.options.y * position + this.originalTop;
  }
});
