/**
 * 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 c={'auto':function(a){return a!=undefined?d.auto=a:d.auto},'init':function(){return d.init()},'bind':function(a){return d.bind(a)},'unbind':function(a){return d.unbind(a)},'trigger':function(a,b){return d.trigger(a,b)},'active':function(){return d.active},'delay':function(a){return a?d.delay=a:d.delay},'start':function(){return d.start()},'stop':function(){return d.stop()},'current':function(){return d.current},'previous':function(){return d.previous}};$.jqem=c;var d={'$em':$(document.createElement('i')),'active':false,'canExp':undefined,'current':undefined,'delay':100,'iid':undefined,'previous':undefined,'auto':true,'init':init,'bind':bind,'unbind':unbind,'trigger':trigger,'update':function(){d.trigger(false);return'1em'},'start':start,'stop':stop};$(document).ready(function(){if(d.auto)init()});function init(){$('body').prepend(d.$em.css({'display':'block','left':'-1em','position':'absolute','visibility':'hidden','width':'1em'}));d.canExp=(d.$em.style!=undefined&&d.$em.style.setExpression!=undefined);d.start()};function bind(a){d.$em.bind('emchange',a)};function unbind(a){d.$em.unbind('emchange',a)};function trigger(a,b){if(a==undefined)a=false;if(a||d.$em.width()!=d.current){d.previous=d.current;d.current=d.$em.width();$.event.trigger('emchange',b)}};function start(){if(d.active)return;d.current=d.previous=d.$em.width();if(d.canExp){d.$em.style.setExpression('width','$.jqem.update();')}else{d.iid=window.setInterval(d.update,d.delay)}d.active=true};function stop(){if(!d.active)return;if(d.canExp){d.$em.style.removeExpression('width')}else{window.removeInterval(d.iid)}}}();