function disableEnterKey(e){
  var key;      
  if(window.event)
    key = window.event.keyCode; //IE
  else
    key = e.which; //firefox      
  return (key != 13);
}
function checkTextLength(elm, max, min){
  var len=$(elm).val().length;
  var f=$(elm).parents("form");
  if ( len <= max && len >= min ){
    f.find(":submit").removeAttr('disabled');
  }else{
    f.find(":submit").attr('disabled', 'disabled');
  }
}
function preload(arrayOfImages) {
    $(arrayOfImages).each(function(){
        $('<img/>')[0].src = this;
        // Alternatively you could use:
        // (new Image()).src = this;
    });
}
/*
 * ScrollToElement 1.0
 * Copyright (c) 2009 Lauri Huovila, Neovica Oy
 *  lauri.huovila@neovica.fi
 *  http://www.neovica.fi
 *  
 * Dual licensed under the MIT and GPL licenses.
 */

(function($) {
    $.scrollToElement = function( $element, speed ) {

        speed = speed || 750;

        $("html, body").animate({
            scrollTop: $element.offset().top,
            scrollLeft: $element.offset().left
        }, speed);
        return $element;
    };

    $.fn.scrollTo = function( speed ) {
        speed = speed || "normal";
        return $.scrollToElement( this, speed );
    };
})(jQuery);

