﻿$(document).ready(function() {
    $.getScript("/scripts/jquery.taconite.js");
    $.getScript("/scripts/json2-min.js");
    $.getScript("/scripts/jQuery.jCache.js");
    $.getScript("/scripts/jquery.corner.js");
    $.getScript("/scripts/jquery.autocomplete.js");
    $.getScript("/scripts/jquery.jgrowl_minimized.js");
    $.getScript("/scripts/jquery.simpletip.js");
    $.getScript("/scripts/jquery.jeditable.mini.js");
    $.getScript("/scripts/webcore.js");
    
});

// custom extensions
jQuery.fn.fadeToggle = function(speed, easing, callback) {
    return this.animate({ opacity: 'toggle' }, speed, easing, callback);
};

jQuery.fn.fancypanel = function() {
    $(this).corner("wicked 20px tr bl");
    $(this).corner("cool 20px br");
    $(this).corner("bevel 20px tl");
};


jQuery.extend({
   getScript: function(url, callback) {
      var head = document.getElementsByTagName("head")[0];
      var script = document.createElement("script");
      script.src = url;

      // Handle Script loading
      {
         var done = false;

         // Attach handlers for all browsers
         script.onload = script.onreadystatechange = function(){
            if ( !done && (!this.readyState ||
                  this.readyState == "loaded" || this.readyState == "complete") ) {
               done = true;
               if (callback)
                  callback();

               // Handle memory leak in IE
               script.onload = script.onreadystatechange = null;
            }
         };
      }

      head.appendChild(script);

      // We handle everything using the script element injection
      return undefined;
   }
});

