/*
 * jQEm v0.2 - Interact with the base 'em' unit.
 * - http://davecardwell.co.uk/javascript/jquery/plugins/jquery-em/0.2/
 *
 * Dave Cardwell <http://davecardwell.co.uk/>
 *
 * Built on the shoulders of giants:
 * - John Resig <http://jquery.com/>
 *
 * Copyright (c) 2006 Dave Cardwell, dual licensed under the MIT and GPL
 * licenses:
 * - http://www.opensource.org/licenses/mit-license.php
 * - http://www.gnu.org/licenses/gpl.txt
 */
new function(){var e={auto:function(i){return i!=undefined?a.auto=i:a.auto},init:function(){return a.init()},bind:function(i){return a.bind(i)},unbind:function(i){return a.unbind(i)},trigger:function(j,i){return a.trigger(j,i)},active:function(){return a.active},delay:function(i){return i?a.delay=i:a.delay},start:function(){return a.start()},stop:function(){return a.stop()},current:function(){return a.current},previous:function(){return a.previous}};$.jqem=e;var a={"$em":$(document.createElement("i")),active:false,canExp:undefined,current:undefined,delay:100,iid:undefined,previous:undefined,auto:true,init:f,bind:h,unbind:d,trigger:b,update:function(){a.trigger(false);return"1em"},start:g,stop:c};$(document).ready(function(){if(a.auto){f()}});function f(){$("body").prepend(a.$em.css({display:"block",left:"-1em",position:"absolute",visibility:"hidden",width:"1em"}));a.canExp=(a.$em.style!=undefined&&a.$em.style.setExpression!=undefined);a.start()}function h(i){a.$em.bind("emchange",i)}function d(i){a.$em.unbind("emchange",i)}function b(j,i){if(j==undefined){j=false}if(j||a.$em.width()!=a.current){a.previous=a.current;a.current=a.$em.width();$.event.trigger("emchange",i)}}function g(){if(a.active){return}a.current=a.previous=a.$em.width();if(a.canExp){a.$em.style.setExpression("width","$.jqem.update();")}else{a.iid=window.setInterval(a.update,a.delay)}a.active=true}function c(){if(!a.active){return}if(a.canExp){a.$em.style.removeExpression("width")}else{window.removeInterval(a.iid)}}}();
