// From esc library version: 146M (Monday March 12 2007 @ 07:20)
if (typeof esc != 'object') esc = {}
esc.Object = new function()
{
	this.extend = function(target, source)
	{
		for (var name in source) target[name] = source[name]
		return target
	}
	this.abolish = function(target, source)
	{
		for(var name in source) if (target[name] === source[name]) delete target[name]
		return target
	}
	this.empty = function(target)
	{
		for(var prop in target) return false
		return true
	}
	this.any = function(target)
	{
		return ! this.empty(target)
	}
	this.pairs = function(target, func)
	{
		for(var name in target) func.call(target, name, target[name])
		return target
	}
	this.match = function(source, expression)
	{
		if (! expression)      expression = ''
		if (! expression.test) expression = new RegExp(expression)
		var matches = []
		for (var name in source) { if (expression.test(name)) matches.push(name) }
		return MatchResult(matches)
	}
	this.first = function(source, expression)
	{
		if (! expression)      expression = ''
		if (! expression.test) expression = new RegExp(expression)
		for (var name in source) { if (expression.test(name)) return name	}
		return null
	}
	this.pluck = function(source, name, alternate)
	{
		var plucked = source[name] || alternate || null
		delete source[name]
		return plucked
	}
	this.extend(Object, this)
}
esc.Function = new function()
{
	this.empty = function(){}
	this.Recurrence = function(func, frequency)
	{	
		this.beginning = new Date()
		this.interval = window.setInterval(func, frequency * 1000)
	}
	this.Recurrence.prototype.duration = function()
	{
		return ((new Date).getTime() - this.beginning.getTime()) / 1000
	}
	this.Recurrence.prototype.stop = function()
	{
		this.interval = window.clearInterval(this.interval)
		var duration = this.duration()
		return (this.stop = this.duration = function() { return duration })()
	}
	this.Options = function()
	{
		for (var source, i=0; source = arguments[i]; i++) Object.extend(this, source)
	}
	this.match = function(source, expression)
	{
		var matches = []
		for (var name in source) {
			if (expression === source[name]) matches.push(name)
			}
		return MatchResult(matches)
	}
	this.compose = function(source)
	{
		if (source.call) {
			var func = source
			source = {}
			func.call(source)
			}
		return source
	}
 	Object.extend(Function, this)
}
esc.Function.prototype = new function()
{
	this.empty = function(){ return (Function.empty === this) }
	this.test = Function.prototype.call
	this.shift = function()
	{
		var func = this
		return function()
			{
				var args = [].add(arguments)
				return func.apply(args.shift(), args)
			}
	}
	this.suck = this.unshift = function()
	{
		var func = this
		var args = arguments
		return function() { return func.apply(this, [].add(args).add(arguments)) }
	}
	this.pop = function()
	{
		var func = this
		return function()
			{
				var args = [].add(arguments)
				return func.apply(args.pop(), args)
			}
	}
	this.push = function()
	{
		var func = this
		var args = arguments
		return function() { return func.apply(this, [].add(arguments).add(args)) }
	}
	this.match = function(expression)
	{
		return Function.match(this, expression)
	}
	this.recur = function(frequency)
	{
		return new Function.Recurrence(this, frequency)
	}
	this.bind = function(target)
	{
		var func = this
		return function() { return func.apply(target, arguments) }
	}
	this.withDefaults = function(defaults)
	{
		var func = this
		return function() { return func.apply(this, [].add(arguments).add(defaults.slice(arguments.length))) }
	}
	this.withArguments = function(args)
	{
		var func = this
		return function() { return func.apply(this, args) }
	}
	this.withOptions = function(options, index)
	{
		var merge
		switch(index) {
		case -1: 
			merge = function() { this.push(new Function.Options(options, this.pop())) }
			break
		case undefined:
			index = 0
		default:
			merge = function() { this[index] = new Function.Options(options, this[index]) }
			}
		var func = this
		return function()
		{
			var args = [].add(arguments)
			merge.call(args)
			return func.apply(this, args)
		}
	}
	Object.extend(Function.prototype, this)
}
esc.String = {}
esc.String.prototype = new function()
{
	this.includes = function(string)
	{
		return (this.indexOf(string) > -1) ? true : false
	}
	this.trim = function()
	{
		return this.replace(/^\s*|\s*$/g, '')
	}
 	this.clean = function()
 	{
 		return this.replace(/\s\s/g, ' ').trim()
 	}
 	Object.extend(String.prototype, this)
}
esc.Array = {}
esc.Array.prototype = new function()
{
	this.suck = Array.prototype.unshift
	this.each = function(func)
	{
		for (var i=0, l=this.length; i<l; i++) func.call(this[i], i)
		return this
	}
	this.call = function(func)
	{
		for (var i=0, l=this.length; i<l; i++) func.call(this[i], i)
		return this
	}
	this.iterate = function(array, index, func)
	{
		if (arguments.length < 3) {
			if (arguments.length == 2) func = index
			else {
				func = array
				array = this			
				}
			index = 0
			}
		for (var i=index, l=array.length; i<l; i++) func.call(this, array[i], i)
		return this
	}
	this.add = function(array, i)
	{
		return this.iterate(array, i || 0, function(item) { this.push(item) })
	}
	this.first = function(func)
	{
		if (! func) return this[0]
		for (var result, i=0, l=this.length; i < l; i++) {
			if (result = func.call(this[i], i)) return result
			}
		return null
	}
	this.last = function(func)
	{
		if (! func) return this[this.length-1]
		for (var result, i=this.length, l=-1; i > l; i--) {
			if (result = func.call(this[i], i)) return result
			}
		return null
	}
	this.extend = function(source)
	{
		return this.each(function() { Object.extend(this, source) })
	}
	Object.extend(Array.prototype, this)
}
esc.Navigator = new function()
{
	var matches, ua = navigator.userAgent
  if      (ua.match('Opera'))    this.label = 'opera'
  else if (ua.match('MSIE 6'))   this.label = 'msie6'
  else if (ua.match('MSIE 7'))   this.label = 'msie7'
  else if (matches = ua.match('AppleWebKit/([0-9]*)')) this.label = (matches[1] > 419) ? 'applewebkit' : 'safari'
  else if (ua.match('Camino'))   this.label = 'camino'
  else if (ua.match('Gecko/20')) this.label = 'gecko'
	Object.extend(navigator, this)
}
MatchResult = function(matches)
{
	return (matches.length) ? matches : null
}
Extension = function(source)
{
	if (! source) return      Function.empty
	if (source.call) return   source
	if (source.extend) return function(){ source.extend(this) }
	return                    function(){ Object.extend(this, source) }
}
Happening = function(source, actionName, observer, reaction)
{
	if (typeof actionName != 'string') actionName = Function.match(source, actionName)[0]
	var reactionName = reaction || actionName
	var reaction = (typeof reactionName != 'function') ? function() { this[reactionName]() } : reactionName
	var happening = {}, happen = arguments.callee.happen
	if (! source.happenings) source.happenings = {}
	var happenings = source.happenings[actionName]
	if (! happenings) {
		happenings = source.happenings[actionName] = Object.extend([], {originalHandler:source[actionName]})
		happenings.action = (happenings.originalHandler) ? happenings.originalHandler : Function.empty
		source[actionName] = function()
			{ 
				happenings.action.apply(this, arguments)
				happenings.each(happen.withArguments(arguments)) 
			}
		}	
	happenings.push(happening)
	happening.ignore = function()
	{
		happenings.first(function(i){ if (this === happening) return happenings.splice(i, 1) })
		if (! happenings.length) {
			source[actionName] = happenings.originalHandler
			delete source.happenings[actionName]
			}
	}
	happening.reaction = reaction
	happening.observer = observer
	return happening
}
Happening.happen = function()
{
	this.reaction.apply(this.observer, arguments)
}
Happening.when = function(action, observer, reaction)
{
	if (! reaction && (typeof observer).match(/function|string/)) {
		return arguments.callee.call(this, action, this, observer)
		}
	else return Happening(this, action, observer, reaction)
}
Happening.observe = function(source, action, reaction)
{
	return Happening(source, action, this, reaction)
}
Constructor = function(inheritence, prototype)
{
	if (! prototype) prototype = inheritence, inheritence = undefined
	prototype = Function.compose(prototype)
	var constructor
	if ('constructor' in prototype) constructor = Object.pluck(prototype, 'constructor')
	else constructor = Function.empty
	var Constructor = function()
	{
		var object = new arguments.callee.Instance(arguments[0])
		constructor.apply(object, arguments)
		return object
	}
	Constructor.prototype = (inheritence) ? Object.extend(Inheritence(inheritence), prototype) : prototype
	Constructor.prototype.Constructor = Constructor
	Constructor.Instance = Instance(Constructor)
	return Object.extend(Constructor, arguments.callee.prototype)
}
Constructor.prototype = new function()
{
	this.extend = function(target)
	{
		return Object.extend(target, this.prototype)
	}
	this.implement = function(source)
	{
		this.yield.call(this.prototype, source)
		return this
	}
	this.yield = function(source)
	{
		if (source.call) source.call(this)
		else Object.extend(this, source)
		return this
	}
}
Instance = function(constructor, func)
{
	var instance = func || function(){}
	instance.prototype = constructor.prototype
	return instance
}
Inheritence = function(constructor)
{
	var prototype = (constructor.Instance) ? new constructor.Instance : new (Instance(constructor))
	var inheritence = [constructor]
	if (prototype.inheritence) inheritence.add(prototype.inheritence)
	else {
		prototype.applyInheritence = arguments.callee.prototype.applyInheritence
		}
	prototype.inheritence = inheritence
	return prototype
}
Inheritence.prototype.applyInheritence = function(args, index)
{
	return this.inheritence[index || 0].apply(this, args)
}
Expression = function(prototype)
{
	var expression = function(pattern, options)
	{
		if (! pattern) pattern = {}
		if (! (this instanceof arguments.callee)) {
			if (pattern.test) return pattern
			else return new arguments.callee(pattern, options)		
			}
		var source = pattern.source || this.parse(pattern, options)
		var expression = this.compile(source, options)
		expression.source = source
		return expression
	}
	expression.prototype = Function.compose(prototype)
	return expression
}
Flair = function(source)
{
	var options = arguments.callee.parse(source)
	var flair =   arguments.callee.construct(options.identifier, options.construct)
	return        arguments.callee.extend(flair, options.prototype, options.identifier)
}
Flair.prototype = Constructor.prototype
Flair.handles = new function()
{
	this.extend = function(extend, target, args)
	{
		Object.extend(target, this.prototype)
		extend.apply(target, args)
	}
	this.abolish = function(abolish, target, args)
	{
		abolish.apply(target, args)
		Object.abolish(target, this.prototype)
	}
}
Flair.parse = function(source)
{
	var prototype = Function.compose(source)
	var identifier = Object.pluck(prototype, 'identifier')
	var construct  = Object.pluck(prototype, 'construct')
	if (! identifier) {
		var matches = Object.match(prototype, /^[A-Z]/)
		if (matches) {
			identifier = matches[0]
			construct  = Object.pluck(prototype, identifier)
			}
		}
	if (! identifier) identifier = Object.first(prototype)
	if (! construct) construct = {}
	if (! construct.apply) construct = function(){ return this }.bind(construct)
	options = {}
	options.identifier = identifier
	options.prototype  = prototype
	options.construct  = construct
	return options
}
Flair.construct = function(identifier, construct)
{
	return function(target)
	{
		if (this instanceof arguments.callee) target = construct.apply(this, arguments)
		if (! target) target = this
		if (! target[identifier]) arguments.callee.extend(target, [].add(arguments, 1))
		return target
	}
}
Flair.extend = function(flair, prototype, identifier)
{
	Object.extend(flair, this.prototype)
	Object.pairs(this.handles, function(name, handle){
		var func = prototype[name] || Function.empty
		delete prototype[name]
		flair[name] = function(target, args)
			{
				handle.apply(this, [func, target, args])
				return target
			}
		})
	if (! prototype[identifier]) prototype[identifier] = flair
	flair.prototype = prototype
	return flair
}
Vector = new Constructor(function()
{
	this.x = null
	this.y = null
	this.constructor = function(vector)
	{
		if (vector) this.set(vector)
	}
	this.set = function(vector)
	{
		if (vector.length) {
			this.x = vector[0]
			this.y = vector[1]
			}	
		else {
			this.x = vector.x
			this.y = vector.y
			}
		return this
	}
	this.add = function(vector)
	{
		vector = this.Constructor(vector)
		this.x += this.vector.x
		this.y += this.vector.y
	  return this
	}
	this.subtract = function(vector)
	{
		vector = this.Constructor(vector)
		this.x -= this.vector.x
		this.y -= this.vector.y
	  return this
	}
	this.clone = function()
	{
	  return this.Constructor(this)
	}
	this.plus = function(vector)
	{
	  return this.Constructor([this.x + vector.x, this.y + vector.y])
	}
	this.minus = function(vector)
	{
	  return this.Constructor([this.x - vector.x, this.y - vector.y])
	}
	this.scale = function(scale)
	{
	  return this.Constructor([this.x * scale, this.y * scale])
	}
	this.round = function()
	{
	  return this.Constructor([Math.round(this.x), Math.round(this.y)])
	}
	this.negate = function()
	{
	  return this.Constructor([this.x *= -1, this.y *= -1])
	}
	this.toString = function()
	{
	  return 'Vector [ x:'+this.x+' y:'+this.y+' ]'
	}
})
Element = new Flair(function(){
	this.Element = function(node)
	{
		if (node.cloneNode) return node.cloneNode(true)
		else return document.createElement(node)
	}
	this.setAttributes = this.extend = function(attributes)
	{
		for (name in attributes) this.setAttribute(name, attributes[name])
		return this
	}
	this.observe = Happening.observe
	this.hasClass = function(className)
	{ 
		return this.className.match("\\b"+className+"\\b")
	}
	this.addClass = function(className)
	{
		if (! this.hasClass(className)) this.className += ' ' + className
		return this
	}
	this.removeClass = function(className)
	{
		if (this.hasClass(className)) this.className = this.className.replace(className, '').clean()
		return this
	}
})
Element.Collector = new function()
{
	this.extend = function (lib)
	{
		var func = function(pattern, source)
		{
			if (/^\$|#/.test(pattern)) this.find(pattern, source)
			else this.match(pattern, source)
		}
		Object.pairs(lib, func.bind(this))
		return this
	}
	this.find = function(id, source)
	{
		var elem = document.getElementById(id.match(/^(\$|#)?(.*)/)[2])
		if (elem) Element(elem), Extension(source).call(elem)
		return elem
	}
	this.match = function(pattern, source)
	{
		var expression = this.Expression(pattern, true)
		var extension = Extension(source)
		var elemExtension = function() { Element(this), extension(this) }
		var matches, elems = []
		for (var elem, i=0, nodeList=this.getElementsByTagName(expression.source.tagName || '*'); elem = nodeList[i]; i++) elems[i] = elem
		if (expression.empty()) matches = elems.each(elemExtension)
		else matches = [].iterate(elems, function(elem) { if (expression.test(elem)) this.push(elem), elemExtension.call(elem) })
		return MatchResult(matches)
	}
	this.match.one = function(direction, pattern, source)
	{
		var expression = this.Expression(pattern, true)
		var extension = Extension(source)
		var position = (direction > 0) ? 0 : this.getElementsByTagName(expression.source.tagName || '*').length-1
		for (var elem; elem=this.getElementsByTagName(expression.source.tagName || '*')[position]; position+=direction) {
			if (expression.test(elem)) {
				Element(elem), extension.call(elem)
				return elem
				}
			}
		return null
	}
	this.first = this.match.one.suck(+1)
	this.last  = this.match.one.suck(-1)
	this.getAssociateElement = function(chain, pattern, expression)
	{
		if (! expression) expression = this.Expression(pattern)
		var elem = this[chain[0]]
		var prop = chain[1] || chain[0]
		while(elem && elem.nodeType != 1) elem = elem[prop]
		if (! elem) return null
		else if (expression.test(elem)) return Element(elem)
		else return arguments.callee.call(elem, (chain[2] || chain), pattern, expression)
	}
	this.getParent   = this.getAssociateElement.suck(['parentNode'])
	this.getChild    = this.getAssociateElement.suck(['firstChild', 'nextSibling', ['nextSibling']])
	this.getNext     = this.getAssociateElement.suck(['nextSibling'])
	this.getPrevious = this.getAssociateElement.suck(['previousSibling'])
	this.Expression = Expression(function()
	{
		this.parse = function(pattern)
		{
			if (! pattern.split) return pattern
			var source = {}
			pattern = pattern.split('.')
			if (pattern[0].match(/^[a-z]/)) source.tagName = pattern.shift()
			if (pattern.length) source.className = pattern.shift()
			return source
		}
		this.compile = function(source, skipTagName)
		{
			var conditions = []
			for(var name in source) {
				switch(name) {
				case 'tagName':
					if (skipTagName) break
				case 'className':
					conditions.push(this[name+"Test"](source[name]))
					break
				default:
					conditions.push(this.attributeTest(name, source[name]))
					}
				}
			var expression
			switch(conditions.length) {
			case 0:
				expression = function(){ return true }, expression.empty = expression
				break
			case 1:
				expression = conditions[0]
				break
			default:
				expression = function()
					{ 
						var elem = this
						return ! conditions.first(function(){ if (! this.call(elem)) return true })
					}
				}
			expression.skipTagName = skipTagName
			return expression
		}
		this.classNameTest = function(condition)
		{
			condition = RegExp("\\b"+condition+"\\b")
			return function(){ return condition.test(this.className) }
		}
		this.tagNameTest = function(condition)
		{
			condition = RegExp("^"+condition+"$", 'i')
			return function(){ return condition.test(this.tagName) }
		}
		this.attributeTest = function(name, condition)
		{
			if (! condition.test) condition = RegExp("^"+condition+"$")
			return function(){ return condition.test(this.getAttribute(name) || '')}
		}
	})
	Element.implement(this)
}
HTTP = {}
HTTP.Query = Constructor(Array, function()
{
	this.add = function(name, value)
	{
		return this.push(encodeURIComponent(name)+'='+encodeURIComponent(value))
	}
	this.toString = function()
	{
		return this.join('&')
	}
})
HTTP.QueryString = function(source)
{
	var query = HTTP.Query()
	if (source) {
		if (source.Element) {
			source.match({name:/./}).each(function(){ query.add(this.name, this.value) })
			}
		else Object.pairs(source, query.add.bind(query))
		}
	return query.toString()
}
HTTP.Request = Constructor(function()
{
	this.constructor = function(method, url, options)
	{
		this.transport = this.Transport()
		this.method = method
		this.url = url
		Object.extend(this, options)
	}
	this.when = Happening.when
	this.send = function()
	{
		switch (this.method) {
		case 'put':
		case 'delete':
			this.body._method = this.method
		case 'post':
			this.transportMethod = 'post'
			this.body = HTTP.QueryString(this.body)
			break
		case 'get':
			this.transportMethod = 'get'
			this.url += (this.url.match(/\?/) ? '&' : '?') + HTTP.QueryString(this.body)
			this.body = null
			}
		this.transport.open(this.transportMethod, this.url, true)
		this.setHeaders()
		this.transport.onreadystatechange = this.stateChange.bind(this)
		this.transport.send(this.body)
		return this
	}
	this.complete = this.success = this.failure = Function.empty
	this.successful = function()
	{
    return this.transport.status >= 200 && this.transport.status < 300
	}
	this.stateChange = function()
	{
		if (this.transport.readyState == 4) {
			this.complete(this.transport)
			if (this.successful()) this.success(this.transport)
			else this.failure(this.transport)
			this.transport.onreadystatechange = Function.empty
			}
	}
	this.setHeaders = function()
	{
    this.transport.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*')
    if (this.transportMethod == 'post') {
      this.transport.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8')
      if (navigator.name == 'gecko') {
				if (navigator.userAgent.match('Gecko/200[45]')) {
					this.transport.setRequestHeader('Connection', 'close')
					}
				}
    	}
	}
	this.Transport = new function()
	{
		if (window.XMLHttpRequest) return function() { return new XMLHttpRequest() }
		if (window.ActiveXObject)  return function() { return new ActiveXObject('Microsoft.XMLHTTP') }
	}
})
HTTP.Head   = HTTP.Request.suck('head')
HTTP.Get    = HTTP.Request.suck('get')
HTTP.Post   = HTTP.Request.suck('post')
HTTP.Put    = HTTP.Request.suck('put')
HTTP.Delete = HTTP.Request.suck('delete')
StyleSheet = new Flair(function()
{
	this.StyleSheet = function(node, attributes)
	{
		attributes = new Function.Options(this.StyleSheet.attributes, attributes)
		if (node && node.toString) attributes.title = node, node = null
		return new Element(node || 'link', attributes)
	}
	this.enable = function()
	{
		this.StyleSheet.enable(this.getAttribute('title'))
		this.spying = function()
		{
			if (this.dom = this.getDom()) {
				this.spying.stop()
				delete this['spying']
				this.ondom()
				}
		}.bind(this).recur(0.1)
		return this
	}
	this.getDom = function()
	{
		var expression = new RegExp(this.getAttribute('href').split('?')[0])
		var finder = function(){ if (expression.test(this.href)) return this[StyleSheet.domProperty] }
		return [].first.call(document.styleSheets, finder)
	}
	this.ondom = Function.empty
	this.match = function(pattern)
	{
		var expression = new this.Expression(pattern)
		return [].iterate(this.dom, function(rule){ if (expression.test(rule)) this.push(rule) })
	}
	this.Expression = Expression(new function()
	{
		this.parse = function(pattern)
		{
			var source = []
			if (pattern.split) {
				var patterns = pattern.clean().split(' ')
				var lastOne = patterns.last()
				patterns.each(function(){
					var parts = this.split('.')
					var elem = {}
					if (/^#/.test(parts[0]))          elem.id = parts.shift().slice(1)
					else if (/^[a-z]/.test(parts[0])) elem.tagName = parts.shift()
					if (parts.length)                 elem.className = parts.shift()
					source.push(elem)
					})
				}
			return source
		}
		this.compile = function(source)
		{
			var proto = this
			var pattern = ''
			source.each(function(){ 
				for (var prop in this) pattern += proto[prop+"Test"](this[prop])
				pattern += (source.last() == this) ? proto.endTest() : proto.gapTest()
				})
			var regExp = new RegExp(pattern)
			return function(){ return regExp.test(this.selectorText) }
		}
		if (navigator.label == 'safari') {
			this.idTest = function(id){ return '\\*\\[ID"'+id+'"\\]' }
			this.tagNameTest = function(tagName){ return tagName.toUpperCase() }
			}
		else {
			this.idTest = function(id){ return '#'+id }
			this.tagNameTest = function(tagName){ return tagName }	
			}
		this.classNameTest = function(className){ return '\\.'+className	}
		this.gapTest = function(){ return '(\\.[_-a-zA-Z]+)? ' }
		this.endTest = function(){ return '(\\.[_-a-zA-Z]+)?$' }
	})
})
StyleSheet.yield(function()
{
	this.attributes = {rel:'alternate stylesheet', media:'screen', type:'text/css', charset:'utf-8'}
	this.domProperty = (navigator.label == 'msie') ? 'rules' : 'cssRules'
	this.enable = function(title)
	{
		return [].iterate(this.match(), function(link){
			link.disabled = true
			if (link.getAttribute("title") == title) {
				link.disabled = false
				this.push(link)
				}		
		})
	}
	this.pattern = {tagName:'link', rel:/style/i, title:/./}
	this.first = function(pattern){ return document.head.first(new Function.Options(this.pattern, pattern), this) }
	this.last  = function(pattern){ return document.head.last( new Function.Options(this.pattern, pattern), this) }
	this.match = function(pattern){ return document.head.match(new Function.Options(this.pattern, pattern), this) }
	this.push = function(stylesheet)
	{
		var before
		if (before = this.last().getNext()) document.head.insertBefore(stylesheet, before)
		else document.head.appendChild(stylesheet)
		return this
	}
	this.suck = function(stylesheet)
	{
		document.head.insertBefore(stylesheet, this.first())
		return this
	}
})
esc.Document = new Flair(function()
{
	this.extend	= function()
	{
		Object.extend(this, Element.Collector)
		if (! this.head) this.head = this.first('head')
		window.when('ondom', this)
	}
	this.ondom = function()
	{
		if (this.body) Element(this.body)
		else this.body = this.first('body')
		this.ondom = Function.empty
	}
})
esc.Window = new Flair(function()
{
	this.extend = new function()
	{
		switch(navigator.label) {
		case 'msie6':
		case 'msie7':
			return function()
			{
				this.when = this.when.bind(this)
				this.ondom = this.ondom.bind(this)
				
				document.write('<script id="__msie_dom_spy__" type="text/javascript" defer="true" src="javascript:void(0)"><\/script>')
				document.getElementById('__msie_dom_spy__').onreadystatechange = function() 
					{
						if (this.readyState.match(/complete/)) {
							this.parentNode.removeChild(this)
							window.ondom()
						}
					}
			}
		case 'safari':
	 		return function()
			{
				this.domSpying = function()
				{
					if ((document.styleSheets.length) && document.readyState.match(/loaded|complete/)) {
						this.domSpying.stop(), delete this.domSpying, this.ondom()
						}
				}.bind(this).recur(0.1)
			}
		default:
			return function()
			{
				var win = this
				document.addEventListener("DOMContentLoaded", function(){ win.ondom() }, false)
			}
		}
	}()
	this.when = Happening.when
	this.ondom = function()
	{
		this.onresize()
		this.when('ondom', 'onresize')
		this.when('ondom', 'focusLocationHashElement')
		this.ondom = Function.empty
	}
	this.onload = function()
	{
		this.ondom()
		this.onload = Function.empty
	}
	this.size = new Vector()
	this.onresize = function()
	{
		switch(navigator.label) {
		case "msie6":
			return function() { this.size.set([document.documentElement.clientWidth, document.documentElement.clientHeight]) }
		default:
			return function() { this.size.set([this.innerWidth, this.innerHeight]) }
			}
	}()
	this.blurElement = function(element)
	{
		element.removeClassName('focused')
		if (typeof element.blur == "function") element.blur()
	}
	this.focusElement = function(element, scroll)
	{
		if (this.focused_element) this.blurElement(this.focused_element)
		element.addClass('focused')
		if (typeof element.focus == "function") element.focus()
		if (scroll) {
			this.scrollTo(0, element.offsetTop - 64)
			}
		this.focused_element = element
	}
	this.focusLocationHashElement = function()
	{
		var elem = document.find(location.hash)
		if (elem) this.focusElement(elem, true)
	}
})
esc.Window(window), esc.Document(document)
// © 2005-2007 Craig Davey. Free software, no guarantees.
// License available at http://eigentone-solo.net/src#license