//This prototype is provided by the Mozilla foundation and
//is distributed under the MIT license.
//http://www.ibiblio.org/pub/Linux/LICENSES/mit.license
Function.prototype.forEach = function(object, block, context) {
  for (var key in object) {
    if (typeof this.prototype[key] == "undefined") {
      block.call(context, object[key], key, object);
    }
  }
};
if (!Array.prototype.forEach)
{
  Array.prototype.forEach = function(fun /*, thisp*/)
  {
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();

    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
    {
      if (i in this)
        fun.call(thisp, this[i], i, this);
    }
  };
}
var forEach = function(object, block, context) {
	  if (object) {
	    var resolve = Object; // default
	    if (object instanceof Function) {
	      // functions have a "length" property
	      resolve = Function;
	    } else if (object.forEach instanceof Function) {
	      // the object implements a custom forEach method so use that
	      object.forEach(block, context);
	      return;
	    } else if (typeof object.length == "number") {
	      // the object is array-like
	      resolve = Array;
	    }
	    resolve.forEach(object, block, context);
	  }
	};


//jkmegamenu.definemenu("anchorid", "menuid", "mouseover|click")
jkmegamenu.definemenu("cities_anchor", "cities_menu", "mouseover");
jkmegamenu.definemenu("tools_anchor", "tools_menu", "mouseover");
$(document).ready(function(){
	
	if ($('form#comment_form')[0]) {
		$('form#comment_form')[0].action='';
	}
    
    $('a.image_button').button().click(function () {
    	$('#image_container img')[0].src=this.href;
    	return false;
    });
    $('div.comment-pages a').button();
    $('a#show_comments').click(function () {
    	$('div.comments_list').slideToggle();
    	return false;
    });
});
