{"size": 2846, "ext": "js", "max_stars_repo_path": "javascripts/src/effects.js", "max_stars_repo_name": "kongregate/tr8n", "max_stars_repo_stars_event_min_datetime": "2015-11-05T08:48:33.000Z", "max_stars_repo_stars_event_max_datetime": "2019-06-15T17:04:08.000Z", "max_issues_repo_path": "javascripts/src/effects.js", "max_issues_repo_name": "kongregate/tr8n", "max_issues_repo_issues_event_min_datetime": "2015-03-13T19:56:22.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-11T08:17:13.000Z", "max_forks_repo_path": "javascripts/effects.js", "max_forks_repo_name": "berk/tr8n", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 36.961038961, "max_line_length": 82, "alphanum_fraction": 0.6728742094}
/****************************************************************************
  Copyright (c) 2010-2012 Michael Berkovich, Ian McDaniel, tr8n.net

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
****************************************************************************/

Tr8n.Effects = {
  toggle: function(element_id) {
    if (Tr8n.element(element_id).style.display == "none")
      Tr8n.element(element_id).show();
    else
      Tr8n.element(element_id).hide();
  },
  hide: function(element_id) {
    Tr8n.element(element_id).style.display = "none";
  },
  show: function(element_id) {
    var style = (Tr8n.element(element_id).tagName == "SPAN") ? "inline" : "block";
    Tr8n.element(element_id).style.display = style;
  },
  blindUp: function(element_id) {
    Tr8n.Effects.hide(element_id);
  },
  blindDown: function(element_id) {
    Tr8n.Effects.show(element_id);
  },
  appear: function(element_id) {
    Tr8n.Effects.show(element_id);
  },
  fade: function(element_id) {
    Tr8n.Effects.hide(element_id);
  },
  submit: function(element_id) {
    Tr8n.element(element_id).submit();
  },
  focus: function(element_id) {
    Tr8n.element(element_id).focus();
  },
  animateHeight: function(element_id, height) {
   var obj = Tr8n.element(element_id);
   var obj_height = obj.clientHeight;
   if(obj_height >= height) return;

   obj.style.height = (obj_height + 20) + "px";
   setTimeout(function() {
       Tr8n.Effects.animateHeight(obj, height);
   }, 10); 
  },
  scrollTo: function(element_id) {
    var theElement = Tr8n.element(element_id);
    var selectedPosX = 0;
    var selectedPosY = 0;
    while(theElement != null){
      selectedPosX += theElement.offsetLeft;
      selectedPosY += theElement.offsetTop;
      theElement = theElement.offsetParent;
    }
    window.scrollTo(selectedPosX,selectedPosY);
  }
}