// Micro Methods
// @version 1.0.0, 2009-06-10 15:05:51 by inamorix
// @license The MIT-style license.
(function(){if(window.mm){return}var c=document,b=false,a={basedir:(function(d){return(d.nodeName=="SCRIPT")?d.src.replace(/\/[^\/]+$/,""):arguments.callee(d.lastChild||d.previousSibling)})(c.body||c),has:function(e,d){if(arguments.length<=1){return(typeof e!="undefined")}return !!e&&e.hasOwnProperty(d)},arr:function(g){for(var d=[],f=0,e=g.length;f<e;f++){d.push(g[f])}return d},bind:function(e){var d=this;return function(){return e.apply(d,[this].concat(d.arr(arguments)))}},each:function(){var f=this.arr(arguments);var j=f.pop();for(var e,h=0;e=f[h];h++){if(this.has(e,"length")){for(var g=0,d=e.length;g<d;g++){var k=e[g];if(j.apply(this,(j.length>=2)?[g,k]:[k])===false){return}}}else{for(var g in e){if(this.has(e,g)){var k=e[g];if(j.apply(this,(j.length>=2)?[g,k]:[k])===false){return}}}}}},map:function(){var d=[];var e=this.arr(arguments);var f=e.pop();this.each.apply(this,e.concat([function(g,i){var h=f.apply(this,(f.length>=2)?[g,i]:[i]);if(this.has(h)){d.push(h)}}]));return d},clone:function(e,d){var f=this.has(e,"length")?[]:{};this.each(e,function(g,h){f[g]=h});this.each(d,function(g,h){f[g]=h});return f},extend:function(d){var f=function(){};f.prototype=this;var e=new f;this.each(d,function(g,h){e[g]=h});e.superclass=this;return e},use:function(e){if(b){var d=c.createElement("script");d.type="text/javascript";d.src=e;c.getElementsByTagName("head")[0].appendChild(d)}else{c.write('<script type="text/javascript" src="'+e+'"><\/script>')}},ready:(function(){var f=[];var d=function(){b=true;a.each(f,function(g){g()})};if(!!(window.attachEvent&&!window.opera)){(function(){try{c.documentElement.doScroll("left");d()}catch(g){setTimeout(arguments.callee,0)}})()}else{if(/webkit\/(\d+)/i.test(navigator.userAgent)&&(RegExp.$1<525)){var e=setInterval(function(){if(/^(loaded|complete)$/.test(c.readyState)){clearInterval(e),d()}},0)}else{c.addEventListener("DOMContentLoaded",d,false)}}return function(g){g=this.bind(g);if(b){return g()}f.push(g)}})(),location:function(d){d=d||location.href;return(function(g,f,h,e,k,i,j){return{scheme:f,host:h,port:e,path:k,query:i,hash:j}}).apply(null,d.match(/^(https?):\/\/([^\/:]+):?([^\/]*)([^\?#]+)\??([^#]*)#?(.*)$/))},localtime:function(d,e){d=d||new Date;return{year:d.getFullYear(),mon:d.getMonth()+1,day:d.getDate(),hour:d.getHours(),min:d.getMinutes(),sec:d.getSeconds(),time:d.getTime(),format:e,toString:function(g){var f=this;if(g=g||f.format){return g.replace(/%([YmdHMS])/g,function(i,h){switch(h){case"Y":return f.year;case"m":return(f.mon<10?"0":"")+f.mon;case"d":return(f.day<10?"0":"")+f.day;case"H":return(f.hour<10?"0":"")+f.hour;case"M":return(f.min<10?"0":"")+f.min;case"S":return(f.sec<10?"0":"")+f.sec}})}return d.toGMTString()}}},cookie:function(e,f,d){if(arguments.length>=2){d=this.clone(d);if(!d.path){d.path="/"}if(f===null){d.days=-1}if(this.has(d.days)){var g=new Date;g.setTime(g.getTime()+(d.days*(1000*60*60*24)));d.expires=g.toGMTString();delete d.days}return c.cookie=e+"="+f+this.map(d,function(h,i){return"; "+h+"="+i}).join("")+";"}else{f=null;this.each(c.cookie.split(/;\s?/),function(h){if(h.match(/^([^=]+)=(.*)$/)&&RegExp.$1==e){f=RegExp.$2;return false}});return f}}};window.mm=a})();
