(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];           
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];
            
           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);
(function($) {$.fn.limitTextArea = function (max, settings) { max = max || 100; settings = $.extend({ container: "<span></span>", classname: "charcounter", format: "(%1 characters remaining)", pulse: true, delay: 0, placeCounterOnNewline: false }, settings); var p, timeout; function count(el, container) { el = $(el); if (el.val().length > max) { el.val(el.val().substring(0, max)); if (settings.pulse && !p) { pulse(container, true); }; }; if (settings.delay > 0) { if (timeout) { window.clearTimeout(timeout); } timeout = window.setTimeout(function () { container.html(settings.format.replace(/%1/, (max - el.val().length))); }, settings.delay); } else { container.html(settings.format.replace(/%1/, (max - el.val().length))); } }; function pulse(el, again) { if (p) { window.clearTimeout(p); p = null; }; el.animate({ opacity: 0.1 }, 100, function () { $(this).animate({ opacity: 1.0 }, 100); }); if (again) { p = window.setTimeout(function () { pulse(el) }, 200); }; }; return this.each(function () { var container; if( !settings.container.match(/^<.+>$/) ){ container = $(settings.container); } else  { container = $(settings.container).insertAfter(this).addClass(settings.classname); if( settings.placeCounterOnNewline )  {  $(this).after('<br />'); } } $(this).bind("keydown", function () { count(this, container); }).bind("keypress", function () { count(this, container); }).bind("keyup", function () { count(this, container); }).bind("focus", function () { count(this, container); }).bind("mouseover", function () { count(this, container); }).bind("mouseout", function () { count(this, container); }).bind("paste", function () { var me = this; setTimeout(function () { count(me, container); }, 10); }); if (this.addEventListener) { this.addEventListener('input', function () { count(this, container); }, false); }; count(this, container); } ); }; })(jQuery);
jQuery.create = function(elType,id) { var el = document.createElement(elType); el.setAttribute('id',id); return el; };
jQuery.fn.appendChild = function(el) {};
jQuery.clearFileFields = function(f){	var _resetBuffer = []; $(':input').each(function(){  _resetBuffer[_resetBuffer.length] = { 'id': $(this).attr('id'), 'value': $(this).val(), 'type': $(this).attr('type') };    }); document.forms[f].reset(); $.each(_resetBuffer,function(){  if( this.type != 'file' )  { $( '#'+ this.id).val( this.value);  } }); }

