/*
 * Modernizr JavaScript library 1.0
 * http://modernizr.com/
 *
 * Copyright (c) 2009 Faruk Ates - http://farukat.es/
 * Licensed under the MIT license.
 * http://modernizr.com/license/
 *
 * Featuring major contributions by
 * Paul Irish  - http://paulirish.com
 * Ben Alman   - http://benalman.com/
 */
window.Modernizr=(function(){var D={},L=true,T=true,G=50,h=document,V=h.documentElement,M=h.createElement("modernizr"),g=M.style,R=h.createElement("input"),k="canvas",Q="canvastext",N="rgba",d="hsla",I="multiplebgs",t="borderimage",y="borderradius",r="boxshadow",P="opacity",x="cssanimations",J="csscolumns",a="cssgradients",l="cssreflections",e="csstransforms",s="csstransforms3d",S="csstransitions",A="fontface",E="geolocation",c="video",w="audio",q="inputtypes",H="background",b=H+"Color",B="canPlayType",o={},v={},n,K,O,F,j=[];function u(f){g.cssText=f}function z(i,f){i+=";";return u(i+"-webkit-"+i+"-moz-"+i+"-o-"+i+"-ms-"+i+(f||""))}function C(i,f){return i.indexOf(f)!==-1}function U(m,W){for(var f in m){if(g[m[f]]!==undefined&&(!W||W(m[f]))){return true}}}function p(W,m){var i=W.replace(/./,function(X){return X.toUpperCase()}),f=[W,"webkit"+i,"Moz"+i,"moz"+i,"o"+i,"ms"+i];return !!U(f,m)}o[k]=function(){return !!h.createElement(k).getContext};o[Q]=function(){return !!(o[k]()&&typeof h.createElement(k).getContext("2d").fillText=="function")};o[E]=function(){return !!navigator.geolocation};o[N]=function(){u(H+"-color:rgba(150,255,150,.5)");return C(g[b],N)};o[d]=function(){u(H+"-color:hsla(120,40%,100%,.5)");return C(g[b],N)};o[I]=function(){u(H+":url(m.png),url(a.png),#f99 url(m.png)");return/(url\s*\(.*?){3}/.test(g[H])};o[t]=function(){z("border-image:url(m.png) 1 1 stretch");return p("borderImage")};o[y]=function(){z("border-radius:10px");return p("borderRadius","",function(f){return C(f,"orderRadius")})};o[r]=function(){z("box-shadow:#000 1px 1px 3px");return p("boxShadow")};o[P]=function(){u("opacity:.5");return C(g[P],"0.5")};o[x]=function(){z('animation:"animate" 2s ease 2',"position:relative");return p("animationName")};o[J]=function(){z("column-count:3");return p("columnCount")};o[a]=function(){var i=H+"-image:",f="gradient(linear,left top,right bottom,from(#9f9),to(white));";u(i+f+i+"-webkit-"+f+i+"-moz-"+f+i+"-o-"+f+i+"-ms-"+f);return C(g.backgroundImage,"gradient")};o[l]=function(){z("box-reflect:right 1px");return p("boxReflect")};o[e]=function(){z("transform:rotate(3deg)");return !!U(["transformProperty","webkitTransform","MozTransform","mozTransform","oTransform","msTransform"])};o[s]=function(){z("perspective:500");return !!U(["perspectiveProperty","webkitPerspective","MozPerspective","mozPerspective","oPerspective","msPerspective"])};o[S]=function(){z("transition:all .5s linear");return p("transitionProperty")};o[A]=(function(){var i;if(!(!/*@cc_on@if(@_jscript_version>=5)!@end@*/0)){i=true}else{var ab=h.createElement("style"),W=h.createElement("span"),ac,X,Z=false,Y=h.body,aa,m;ab.textContent="@font-face{font-family:testfont;src:url('data:font/ttf;base64,AAEAAAAMAIAAAwBAT1MvMliohmwAAADMAAAAVmNtYXCp5qrBAAABJAAAANhjdnQgACICiAAAAfwAAAAEZ2FzcP//AAMAAAIAAAAACGdseWYv5OZoAAACCAAAANxoZWFk69bnvwAAAuQAAAA2aGhlYQUJAt8AAAMcAAAAJGhtdHgGDgC4AAADQAAAABRsb2NhAIQAwgAAA1QAAAAMbWF4cABVANgAAANgAAAAIG5hbWUgXduAAAADgAAABPVwb3N03NkzmgAACHgAAAA4AAECBAEsAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAACAAMDAAAAAAAAgAACbwAAAAoAAAAAAAAAAFBmRWQAAAAgqS8DM/8zAFwDMwDNAAAABQAAAAAAAAAAAAMAAAADAAAAHAABAAAAAABGAAMAAQAAAK4ABAAqAAAABgAEAAEAAgAuqQD//wAAAC6pAP///9ZXAwAAAAAAAAACAAAABgBoAAAAAAAvAAEAAAAAAAAAAAAAAAAAAAABAAIAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEACoAAAAGAAQAAQACAC6pAP//AAAALqkA////1lcDAAAAAAAAAAIAAAAiAogAAAAB//8AAgACACIAAAEyAqoAAwAHAC6xAQAvPLIHBADtMrEGBdw8sgMCAO0yALEDAC88sgUEAO0ysgcGAfw8sgECAO0yMxEhESczESMiARDuzMwCqv1WIgJmAAACAFUAAAIRAc0ADwAfAAATFRQWOwEyNj0BNCYrASIGARQGKwEiJj0BNDY7ATIWFX8aIvAiGhoi8CIaAZIoN/43KCg3/jcoAWD0JB4eJPQkHh7++EY2NkbVRjY2RgAAAAABAEH/+QCdAEEACQAANjQ2MzIWFAYjIkEeEA8fHw8QDxwWFhwWAAAAAQAAAAIAAIuYbWpfDzz1AAsEAAAAAADFn9IuAAAAAMWf0i797/8zA4gDMwAAAAgAAgAAAAAAAAABAAADM/8zAFwDx/3v/98DiAABAAAAAAAAAAAAAAAAAAAABQF2ACIAAAAAAVUAAAJmAFUA3QBBAAAAKgAqACoAWgBuAAEAAAAFAFAABwBUAAQAAgAAAAEAAQAAAEAALgADAAMAAAAQAMYAAQAAAAAAAACLAAAAAQAAAAAAAQAhAIsAAQAAAAAAAgAFAKwAAQAAAAAAAwBDALEAAQAAAAAABAAnAPQAAQAAAAAABQAKARsAAQAAAAAABgAmASUAAQAAAAAADgAaAUsAAwABBAkAAAEWAWUAAwABBAkAAQBCAnsAAwABBAkAAgAKAr0AAwABBAkAAwCGAscAAwABBAkABABOA00AAwABBAkABQAUA5sAAwABBAkABgBMA68AAwABBAkADgA0A/tDb3B5cmlnaHQgMjAwOSBieSBEYW5pZWwgSm9obnNvbi4gIFJlbGVhc2VkIHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgT3BlbiBGb250IExpY2Vuc2UuIEtheWFoIExpIGdseXBocyBhcmUgcmVsZWFzZWQgdW5kZXIgdGhlIEdQTCB2ZXJzaW9uIDMuYmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhTGlnaHRiYWVjMmE5MmJmZmU1MDMyIC0gc3Vic2V0IG9mIEZvbnRGb3JnZSAyLjAgOiBKdXJhIExpZ2h0IDogMjMtMS0yMDA5YmFlYzJhOTJiZmZlNTAzMiAtIHN1YnNldCBvZiBKdXJhIExpZ2h0VmVyc2lvbiAyIGJhZWMyYTkyYmZmZTUwMzIgLSBzdWJzZXQgb2YgSnVyYUxpZ2h0aHR0cDovL3NjcmlwdHMuc2lsLm9yZy9PRkwAQwBvAHAAeQByAGkAZwBoAHQAIAAyADAAMAA5ACAAYgB5ACAARABhAG4AaQBlAGwAIABKAG8AaABuAHMAbwBuAC4AIAAgAFIAZQBsAGUAYQBzAGUAZAAgAHUAbgBkAGUAcgAgAHQAaABlACAAdABlAHIAbQBzACAAbwBmACAAdABoAGUAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBzAGUALgAgAEsAYQB5AGEAaAAgAEwAaQAgAGcAbAB5AHAAaABzACAAYQByAGUAIAByAGUAbABlAGEAcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgAEcAUABMACAAdgBlAHIAcwBpAG8AbgAgADMALgBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQBMAGkAZwBoAHQAYgBhAGUAYwAyAGEAOQAyAGIAZgBmAGUANQAwADMAMgAgAC0AIABzAHUAYgBzAGUAdAAgAG8AZgAgAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAASgB1AHIAYQAgAEwAaQBnAGgAdAAgADoAIAAyADMALQAxAC0AMgAwADAAOQBiAGEAZQBjADIAYQA5ADIAYgBmAGYAZQA1ADAAMwAyACAALQAgAHMAdQBiAHMAZQB0ACAAbwBmACAASgB1AHIAYQAgAEwAaQBnAGgAdABWAGUAcgBzAGkAbwBuACAAMgAgAGIAYQBlAGMAMgBhADkAMgBiAGYAZgBlADUAMAAzADIAIAAtACAAcwB1AGIAcwBlAHQAIABvAGYAIABKAHUAcgBhAEwAaQBnAGgAdABoAHQAdABwADoALwAvAHMAYwByAGkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEwAAAAAAgAAAAAAAP+BADMAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQACAQIAEQt6ZXJva2F5YWhsaQ==')}";h.getElementsByTagName("head")[0].appendChild(ab);W.setAttribute("style","font:99px _,serif;position:absolute;visibility:hidden");if(!Y){Y=V.appendChild(h.createElement(A));Z=true}W.innerHTML="........";W.id="fonttest";Y.appendChild(W);ac=W.offsetWidth;W.style.font="99px testfont,_,serif";i=ac!==W.offsetWidth;var f=function(){i=Modernizr[A]=ac!==W.offsetWidth;V.className=V.className.replace(/(no-)?font.*?\b/,"")+(i?" ":" no-")+A;aa&&(m=true)&&aa(i);Z&&setTimeout(function(){Y.parentNode.removeChild(Y)},50)};setTimeout(f,G)}D._fontfaceready=function(ad){(m||i)?ad(i):(aa=ad)};return function(){return i||ac!==W.offsetWidth}})();o[c]=function(){return !!h.createElement(c)[B]};o[w]=function(){return !!h.createElement(w)[B]};for(F in o){if(o.hasOwnProperty(F)){j.push((!(D[F]=o[F]())&&T?"no-":"")+F)}}D[q]=function(m){for(var f in m){R.setAttribute("type",m[f]);v[m[f]]=!!(R.type!=="text")}return v}("search tel url email datetime date month week time datetime-local number range color".split(" "));u("");M=R=null;if(L&&!(!/*@cc_on!@*/0)){n="abbr article aside audio bb canvas datagrid datalist details dialog figure footer header mark menu meter nav output progress section time video".split(" ");O=n.length+1;while(--O){K=h.createElement(n[O])}K=null}D._enableHTML5=L;D._enableNoClasses=T;(function(f,i){f[i]=f[i].replace(/\bno-js\b/,"js")})(V,"className");V.className+=" "+j.join(" ");return D})();

/**
   *@copyright

The MIT License

Copyright (c) 2008 Rob Larsen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
React = {};
React.Data = {};
React.Behavior = (function(){
/**
   * Implements domContentLoaded across browser. 
   * @method _init         
   * @private
   */
function _init() {
	//Based on code by Dean Edwards with assistance from several others.
    if (arguments.callee.done) return;
    arguments.callee.done = true;
    if (_timer) clearInterval(_timer);
	_domLoad();
	
	// float images right on single post pages
	if( $$("#post #posts .entry img") ){
		var images = $$("#post #posts .entry img");
		if ( images.length > 0 ){
			for (var i=0; i<images.length; i++){	
				if (images[i].offsetWidth < 400){
					removeClass(images[i], "aligncenter");
					removeClass(images[i], "alignleft");
					addClass(images[i], "alignright");
				}
				else{
					removeClass(images[i], "alignright");
					removeClass(images[i], "alignleft");
					addClass(images[i], "aligncenter");
				}
			};
		}
	}
};
if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", _init, false);
};
//http://javascript.nwbox.com/IEContentLoaded/
//A much better solution than the script defer that Dean
//Edwards originally used.
/*@cc_on @*/
/*@if (@_win32)
(function () {
	try {
		document.documentElement.doScroll('left');
	} catch (e) {
		setTimeout(arguments.callee, 50);
		return;
	}
	// no errors, fire
	_init();
})();
/*@end @*/
//
if (/WebKit/i.test(navigator.userAgent)) { // sniff
    var _timer = setInterval(function() {
        if (/loaded|complete/.test(document.readyState)) {
            _init(); // call the onload handler
        }
    }, 10);
};
window.onload = _init;
/**
   * Returns the HTMLElement with the given ID (Wrapper for document.getElementById).
   * @method $         
   * @param id {String}the id attribute 
   * @return {HTMLElement | null} The HTMLElement with the id, or null if none found. 
   */

function $(id) {
	element = document.getElementById(id);
	return element;
};
/*!
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
/**
 * Returns an Array of matched elements based on CSS Selectors
 * @method $$         
 * @param selector {String} the CSS selector to search for. Supports many CSS3 selectors
 * @param context {Object} an optional context object to limit the search
 * defaults to document
 * @param results {Array} a optional existing Array of results
 *new results will be added to this array
 * @param seed {Object} An otional dom fragment to be searched
 * @return {Array} An Array of matched elements. 
 */
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
	done = 0,
	toString = Object.prototype.toString,
	hasDuplicate = false;

var Sizzle = function(selector, context, results, seed) {
	results = results || [];
	var origContext = context = context || document;

	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
		return [];
	}
	
	if ( !selector || typeof selector !== "string" ) {
		return results;
	}

	var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context),
		soFar = selector;
	
	// Reset the position of the chunker regexp (start from head)
	while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
		soFar = m[3];
		
		parts.push( m[1] );
		
		if ( m[2] ) {
			extra = m[3];
			break;
		}
	}

	if ( parts.length > 1 && origPOS.exec( selector ) ) {
		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
			set = posProcess( parts[0] + parts[1], context );
		} else {
			set = Expr.relative[ parts[0] ] ?
				[ context ] :
				Sizzle( parts.shift(), context );

			while ( parts.length ) {
				selector = parts.shift();

				if ( Expr.relative[ selector ] )
					selector += parts.shift();

				set = posProcess( selector, set );
			}
		}
	} else {
		// Take a shortcut and set the context if the root selector is an ID
		// (but not if it'll be faster if the inner selector is an ID)
		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
			var ret = Sizzle.find( parts.shift(), context, contextXML );
			context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
		}

		if ( context ) {
			var ret = seed ?
				{ expr: parts.pop(), set: makeArray(seed) } :
				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
			set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;

			if ( parts.length > 0 ) {
				checkSet = makeArray(set);
			} else {
				prune = false;
			}

			while ( parts.length ) {
				var cur = parts.pop(), pop = cur;

				if ( !Expr.relative[ cur ] ) {
					cur = "";
				} else {
					pop = parts.pop();
				}

				if ( pop == null ) {
					pop = context;
				}

				Expr.relative[ cur ]( checkSet, pop, contextXML );
			}
		} else {
			checkSet = parts = [];
		}
	}

	if ( !checkSet ) {
		checkSet = set;
	}

	if ( !checkSet ) {
		throw "Syntax error, unrecognized expression: " + (cur || selector);
	}

	if ( toString.call(checkSet) === "[object Array]" ) {
		if ( !prune ) {
			results.push.apply( results, checkSet );
		} else if ( context && context.nodeType === 1 ) {
			for ( var i = 0; checkSet[i] != null; i++ ) {
				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
					results.push( set[i] );
				}
			}
		} else {
			for ( var i = 0; checkSet[i] != null; i++ ) {
				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
					results.push( set[i] );
				}
			}
		}
	} else {
		makeArray( checkSet, results );
	}

	if ( extra ) {
		Sizzle( extra, origContext, results, seed );
		Sizzle.uniqueSort( results );
	}

	return results;
};

Sizzle.uniqueSort = function(results){
	if ( sortOrder ) {
		hasDuplicate = false;
		results.sort(sortOrder);

		if ( hasDuplicate ) {
			for ( var i = 1; i < results.length; i++ ) {
				if ( results[i] === results[i-1] ) {
					results.splice(i--, 1);
				}
			}
		}
	}

	return results;
};

Sizzle.matches = function(expr, set){
	return Sizzle(expr, null, null, set);
};

Sizzle.find = function(expr, context, isXML){
	var set, match;

	if ( !expr ) {
		return [];
	}

	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
		var type = Expr.order[i], match;
		
		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
			var left = match[1];
			match.splice(1,1);

			if ( left.substr( left.length - 1 ) !== "\\" ) {
				match[1] = (match[1] || "").replace(/\\/g, "");
				set = Expr.find[ type ]( match, context, isXML );
				if ( set != null ) {
					expr = expr.replace( Expr.match[ type ], "" );
					break;
				}
			}
		}
	}

	if ( !set ) {
		set = context.getElementsByTagName("*");
	}

	return {set: set, expr: expr};
};

Sizzle.filter = function(expr, set, inplace, not){
	var old = expr, result = [], curLoop = set, match, anyFound,
		isXMLFilter = set && set[0] && isXML(set[0]);

	while ( expr && set.length ) {
		for ( var type in Expr.filter ) {
			if ( (match = Expr.match[ type ].exec( expr )) != null ) {
				var filter = Expr.filter[ type ], found, item;
				anyFound = false;

				if ( curLoop == result ) {
					result = [];
				}

				if ( Expr.preFilter[ type ] ) {
					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );

					if ( !match ) {
						anyFound = found = true;
					} else if ( match === true ) {
						continue;
					}
				}

				if ( match ) {
					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
						if ( item ) {
							found = filter( item, match, i, curLoop );
							var pass = not ^ !!found;

							if ( inplace && found != null ) {
								if ( pass ) {
									anyFound = true;
								} else {
									curLoop[i] = false;
								}
							} else if ( pass ) {
								result.push( item );
								anyFound = true;
							}
						}
					}
				}

				if ( found !== undefined ) {
					if ( !inplace ) {
						curLoop = result;
					}

					expr = expr.replace( Expr.match[ type ], "" );

					if ( !anyFound ) {
						return [];
					}

					break;
				}
			}
		}

		// Improper expression
		if ( expr == old ) {
			if ( anyFound == null ) {
				throw "Syntax error, unrecognized expression: " + expr;
			} else {
				break;
			}
		}

		old = expr;
	}

	return curLoop;
};

var Expr = Sizzle.selectors = {
	order: [ "ID", "NAME", "TAG" ],
	match: {
		ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
		CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
		TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
		PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
	},
	leftMatch: {},
	attrMap: {
		"class": "className",
		"for": "htmlFor"
	},
	attrHandle: {
		href: function(elem){
			return elem.getAttribute("href");
		}
	},
	relative: {
		"+": function(checkSet, part, isXML){
			var isPartStr = typeof part === "string",
				isTag = isPartStr && !/\W/.test(part),
				isPartStrNotTag = isPartStr && !isTag;

			if ( isTag && !isXML ) {
				part = part.toUpperCase();
			}

			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
				if ( (elem = checkSet[i]) ) {
					while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}

					checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
						elem || false :
						elem === part;
				}
			}

			if ( isPartStrNotTag ) {
				Sizzle.filter( part, checkSet, true );
			}
		},
		">": function(checkSet, part, isXML){
			var isPartStr = typeof part === "string";

			if ( isPartStr && !/\W/.test(part) ) {
				part = isXML ? part : part.toUpperCase();

				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
					var elem = checkSet[i];
					if ( elem ) {
						var parent = elem.parentNode;
						checkSet[i] = parent.nodeName === part ? parent : false;
					}
				}
			} else {
				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
					var elem = checkSet[i];
					if ( elem ) {
						checkSet[i] = isPartStr ?
							elem.parentNode :
							elem.parentNode === part;
					}
				}

				if ( isPartStr ) {
					Sizzle.filter( part, checkSet, true );
				}
			}
		},
		"": function(checkSet, part, isXML){
			var doneName = done++, checkFn = dirCheck;

			if ( !/\W/.test(part) ) {
				var nodeCheck = part = isXML ? part : part.toUpperCase();
				checkFn = dirNodeCheck;
			}

			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
		},
		"~": function(checkSet, part, isXML){
			var doneName = done++, checkFn = dirCheck;

			if ( typeof part === "string" && !/\W/.test(part) ) {
				var nodeCheck = part = isXML ? part : part.toUpperCase();
				checkFn = dirNodeCheck;
			}

			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
		}
	},
	find: {
		ID: function(match, context, isXML){
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
				var m = context.getElementById(match[1]);
				return m ? [m] : [];
			}
		},
		NAME: function(match, context, isXML){
			if ( typeof context.getElementsByName !== "undefined" ) {
				var ret = [], results = context.getElementsByName(match[1]);

				for ( var i = 0, l = results.length; i < l; i++ ) {
					if ( results[i].getAttribute("name") === match[1] ) {
						ret.push( results[i] );
					}
				}

				return ret.length === 0 ? null : ret;
			}
		},
		TAG: function(match, context){
			return context.getElementsByTagName(match[1]);
		}
	},
	preFilter: {
		CLASS: function(match, curLoop, inplace, result, not, isXML){
			match = " " + match[1].replace(/\\/g, "") + " ";

			if ( isXML ) {
				return match;
			}

			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
				if ( elem ) {
					if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
						if ( !inplace )
							result.push( elem );
					} else if ( inplace ) {
						curLoop[i] = false;
					}
				}
			}

			return false;
		},
		ID: function(match){
			return match[1].replace(/\\/g, "");
		},
		TAG: function(match, curLoop){
			for ( var i = 0; curLoop[i] === false; i++ ){}
			return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
		},
		CHILD: function(match){
			if ( match[1] == "nth" ) {
				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
					match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);

				// calculate the numbers (first)n+(last) including if they are negative
				match[2] = (test[1] + (test[2] || 1)) - 0;
				match[3] = test[3] - 0;
			}

			// TODO: Move to normal caching system
			match[0] = done++;

			return match;
		},
		ATTR: function(match, curLoop, inplace, result, not, isXML){
			var name = match[1].replace(/\\/g, "");
			
			if ( !isXML && Expr.attrMap[name] ) {
				match[1] = Expr.attrMap[name];
			}

			if ( match[2] === "~=" ) {
				match[4] = " " + match[4] + " ";
			}

			return match;
		},
		PSEUDO: function(match, curLoop, inplace, result, not){
			if ( match[1] === "not" ) {
				// If we're dealing with a complex expression, or a simple one
				if ( chunker.exec(match[3]).length > 1 || /^\w/.test(match[3]) ) {
					match[3] = Sizzle(match[3], null, null, curLoop);
				} else {
					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
					if ( !inplace ) {
						result.push.apply( result, ret );
					}
					return false;
				}
			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
				return true;
			}
			
			return match;
		},
		POS: function(match){
			match.unshift( true );
			return match;
		}
	},
	filters: {
		enabled: function(elem){
			return elem.disabled === false && elem.type !== "hidden";
		},
		disabled: function(elem){
			return elem.disabled === true;
		},
		checked: function(elem){
			return elem.checked === true;
		},
		selected: function(elem){
			// Accessing this property makes selected-by-default
			// options in Safari work properly
			elem.parentNode.selectedIndex;
			return elem.selected === true;
		},
		parent: function(elem){
			return !!elem.firstChild;
		},
		empty: function(elem){
			return !elem.firstChild;
		},
		has: function(elem, i, match){
			return !!Sizzle( match[3], elem ).length;
		},
		header: function(elem){
			return /h\d/i.test( elem.nodeName );
		},
		text: function(elem){
			return "text" === elem.type;
		},
		radio: function(elem){
			return "radio" === elem.type;
		},
		checkbox: function(elem){
			return "checkbox" === elem.type;
		},
		file: function(elem){
			return "file" === elem.type;
		},
		password: function(elem){
			return "password" === elem.type;
		},
		submit: function(elem){
			return "submit" === elem.type;
		},
		image: function(elem){
			return "image" === elem.type;
		},
		reset: function(elem){
			return "reset" === elem.type;
		},
		button: function(elem){
			return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
		},
		input: function(elem){
			return /input|select|textarea|button/i.test(elem.nodeName);
		}
	},
	setFilters: {
		first: function(elem, i){
			return i === 0;
		},
		last: function(elem, i, match, array){
			return i === array.length - 1;
		},
		even: function(elem, i){
			return i % 2 === 0;
		},
		odd: function(elem, i){
			return i % 2 === 1;
		},
		lt: function(elem, i, match){
			return i < match[3] - 0;
		},
		gt: function(elem, i, match){
			return i > match[3] - 0;
		},
		nth: function(elem, i, match){
			return match[3] - 0 == i;
		},
		eq: function(elem, i, match){
			return match[3] - 0 == i;
		}
	},
	filter: {
		PSEUDO: function(elem, match, i, array){
			var name = match[1], filter = Expr.filters[ name ];

			if ( filter ) {
				return filter( elem, i, match, array );
			} else if ( name === "contains" ) {
				return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
			} else if ( name === "not" ) {
				var not = match[3];

				for ( var i = 0, l = not.length; i < l; i++ ) {
					if ( not[i] === elem ) {
						return false;
					}
				}

				return true;
			}
		},
		CHILD: function(elem, match){
			var type = match[1], node = elem;
			switch (type) {
				case 'only':
				case 'first':
					while ( (node = node.previousSibling) )  {
						if ( node.nodeType === 1 ) return false;
					}
					if ( type == 'first') return true;
					node = elem;
				case 'last':
					while ( (node = node.nextSibling) )  {
						if ( node.nodeType === 1 ) return false;
					}
					return true;
				case 'nth':
					var first = match[2], last = match[3];

					if ( first == 1 && last == 0 ) {
						return true;
					}
					
					var doneName = match[0],
						parent = elem.parentNode;
	
					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
						var count = 0;
						for ( node = parent.firstChild; node; node = node.nextSibling ) {
							if ( node.nodeType === 1 ) {
								node.nodeIndex = ++count;
							}
						} 
						parent.sizcache = doneName;
					}
					
					var diff = elem.nodeIndex - last;
					if ( first == 0 ) {
						return diff == 0;
					} else {
						return ( diff % first == 0 && diff / first >= 0 );
					}
			}
		},
		ID: function(elem, match){
			return elem.nodeType === 1 && elem.getAttribute("id") === match;
		},
		TAG: function(elem, match){
			return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
		},
		CLASS: function(elem, match){
			return (" " + (elem.className || elem.getAttribute("class")) + " ")
				.indexOf( match ) > -1;
		},
		ATTR: function(elem, match){
			var name = match[1],
				result = Expr.attrHandle[ name ] ?
					Expr.attrHandle[ name ]( elem ) :
					elem[ name ] != null ?
						elem[ name ] :
						elem.getAttribute( name ),
				value = result + "",
				type = match[2],
				check = match[4];

			return result == null ?
				type === "!=" :
				type === "=" ?
				value === check :
				type === "*=" ?
				value.indexOf(check) >= 0 :
				type === "~=" ?
				(" " + value + " ").indexOf(check) >= 0 :
				!check ?
				value && result !== false :
				type === "!=" ?
				value != check :
				type === "^=" ?
				value.indexOf(check) === 0 :
				type === "$=" ?
				value.substr(value.length - check.length) === check :
				type === "|=" ?
				value === check || value.substr(0, check.length + 1) === check + "-" :
				false;
		},
		POS: function(elem, match, i, array){
			var name = match[2], filter = Expr.setFilters[ name ];

			if ( filter ) {
				return filter( elem, i, match, array );
			}
		}
	}
};

var origPOS = Expr.match.POS;

for ( var type in Expr.match ) {
	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source );
}

var makeArray = function(array, results) {
	array = Array.prototype.slice.call( array, 0 );

	if ( results ) {
		results.push.apply( results, array );
		return results;
	}
	
	return array;
};

// Perform a simple check to determine if the browser is capable of
// converting a NodeList to an array using builtin methods.
try {
	Array.prototype.slice.call( document.documentElement.childNodes, 0 );

// Provide a fallback method if it does not work
} catch(e){
	makeArray = function(array, results) {
		var ret = results || [];

		if ( toString.call(array) === "[object Array]" ) {
			Array.prototype.push.apply( ret, array );
		} else {
			if ( typeof array.length === "number" ) {
				for ( var i = 0, l = array.length; i < l; i++ ) {
					ret.push( array[i] );
				}
			} else {
				for ( var i = 0; array[i]; i++ ) {
					ret.push( array[i] );
				}
			}
		}

		return ret;
	};
}

var sortOrder;

if ( document.documentElement.compareDocumentPosition ) {
	sortOrder = function( a, b ) {
		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
			if ( a == b ) {
				hasDuplicate = true;
			}
			return 0;
		}

		var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
		if ( ret === 0 ) {
			hasDuplicate = true;
		}
		return ret;
	};
} else if ( "sourceIndex" in document.documentElement ) {
	sortOrder = function( a, b ) {
		if ( !a.sourceIndex || !b.sourceIndex ) {
			if ( a == b ) {
				hasDuplicate = true;
			}
			return 0;
		}

		var ret = a.sourceIndex - b.sourceIndex;
		if ( ret === 0 ) {
			hasDuplicate = true;
		}
		return ret;
	};
} else if ( document.createRange ) {
	sortOrder = function( a, b ) {
		if ( !a.ownerDocument || !b.ownerDocument ) {
			if ( a == b ) {
				hasDuplicate = true;
			}
			return 0;
		}

		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
		aRange.selectNode(a);
		aRange.collapse(true);
		bRange.selectNode(b);
		bRange.collapse(true);
		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
		if ( ret === 0 ) {
			hasDuplicate = true;
		}
		return ret;
	};
}

// Check to see if the browser returns elements by name when
// querying by getElementById (and provide a workaround)
(function(){
	// We're going to inject a fake input element with a specified name
	var form = document.createElement("div"),
		id = "script" + (new Date).getTime();
	form.innerHTML = "<a name='" + id + "'/>";

	// Inject it into the root element, check its status, and remove it quickly
	var root = document.documentElement;
	root.insertBefore( form, root.firstChild );

	// The workaround has to do additional checks after a getElementById
	// Which slows things down for other browsers (hence the branching)
	if ( !!document.getElementById( id ) ) {
		Expr.find.ID = function(match, context, isXML){
			if ( typeof context.getElementById !== "undefined" && !isXML ) {
				var m = context.getElementById(match[1]);
				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
			}
		};

		Expr.filter.ID = function(elem, match){
			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
			return elem.nodeType === 1 && node && node.nodeValue === match;
		};
	}

	root.removeChild( form );
	root = form = null; // release memory in IE
})();

(function(){
	// Check to see if the browser returns only elements
	// when doing getElementsByTagName("*")

	// Create a fake element
	var div = document.createElement("div");
	div.appendChild( document.createComment("") );

	// Make sure no comments are found
	if ( div.getElementsByTagName("*").length > 0 ) {
		Expr.find.TAG = function(match, context){
			var results = context.getElementsByTagName(match[1]);

			// Filter out possible comments
			if ( match[1] === "*" ) {
				var tmp = [];

				for ( var i = 0; results[i]; i++ ) {
					if ( results[i].nodeType === 1 ) {
						tmp.push( results[i] );
					}
				}

				results = tmp;
			}

			return results;
		};
	}

	// Check to see if an attribute returns normalized href attributes
	div.innerHTML = "<a href='#'></a>";
	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
			div.firstChild.getAttribute("href") !== "#" ) {
		Expr.attrHandle.href = function(elem){
			return elem.getAttribute("href", 2);
		};
	}

	div = null; // release memory in IE
})();

if ( document.querySelectorAll ) (function(){
	var oldSizzle = Sizzle, div = document.createElement("div");
	div.innerHTML = "<p class='TEST'></p>";

	// Safari can't handle uppercase or unicode characters when
	// in quirks mode.
	if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
		return;
	}
	
	Sizzle = function(query, context, extra, seed){
		context = context || document;

		// Only use querySelectorAll on non-XML documents
		// (ID selectors don't work in non-HTML documents)
		if ( !seed && context.nodeType === 9 && !isXML(context) ) {
			try {
				return makeArray( context.querySelectorAll(query), extra );
			} catch(e){}
		}
		
		return oldSizzle(query, context, extra, seed);
	};

	for ( var prop in oldSizzle ) {
		Sizzle[ prop ] = oldSizzle[ prop ];
	}

	div = null; // release memory in IE
})();

if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
	var div = document.createElement("div");
	div.innerHTML = "<div class='test e'></div><div class='test'></div>";

	// Opera can't find a second classname (in 9.6)
	if ( div.getElementsByClassName("e").length === 0 )
		return;

	// Safari caches class attributes, doesn't catch changes (in 3.2)
	div.lastChild.className = "e";

	if ( div.getElementsByClassName("e").length === 1 )
		return;

	Expr.order.splice(1, 0, "CLASS");
	Expr.find.CLASS = function(match, context, isXML) {
		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
			return context.getElementsByClassName(match[1]);
		}
	};

	div = null; // release memory in IE
})();

function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
	var sibDir = dir == "previousSibling" && !isXML;
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
		var elem = checkSet[i];
		if ( elem ) {
			if ( sibDir && elem.nodeType === 1 ){
				elem.sizcache = doneName;
				elem.sizset = i;
			}
			elem = elem[dir];
			var match = false;

			while ( elem ) {
				if ( elem.sizcache === doneName ) {
					match = checkSet[elem.sizset];
					break;
				}

				if ( elem.nodeType === 1 && !isXML ){
					elem.sizcache = doneName;
					elem.sizset = i;
				}

				if ( elem.nodeName === cur ) {
					match = elem;
					break;
				}

				elem = elem[dir];
			}

			checkSet[i] = match;
		}
	}
}

function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
	var sibDir = dir == "previousSibling" && !isXML;
	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
		var elem = checkSet[i];
		if ( elem ) {
			if ( sibDir && elem.nodeType === 1 ) {
				elem.sizcache = doneName;
				elem.sizset = i;
			}
			elem = elem[dir];
			var match = false;

			while ( elem ) {
				if ( elem.sizcache === doneName ) {
					match = checkSet[elem.sizset];
					break;
				}

				if ( elem.nodeType === 1 ) {
					if ( !isXML ) {
						elem.sizcache = doneName;
						elem.sizset = i;
					}
					if ( typeof cur !== "string" ) {
						if ( elem === cur ) {
							match = true;
							break;
						}

					} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
						match = elem;
						break;
					}
				}

				elem = elem[dir];
			}

			checkSet[i] = match;
		}
	}
}

var contains = document.compareDocumentPosition ?  function(a, b){
	return a.compareDocumentPosition(b) & 16;
} : function(a, b){
	return a !== b && (a.contains ? a.contains(b) : true);
};

var isXML = function(elem){
	return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
		!!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
};

var posProcess = function(selector, context){
	var tmpSet = [], later = "", match,
		root = context.nodeType ? [context] : context;

	// Position selectors must be done after the filter
	// And so must :not(positional) so we move all PSEUDOs to the end
	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
		later += match[0];
		selector = selector.replace( Expr.match.PSEUDO, "" );
	}

	selector = Expr.relative[selector] ? selector + "*" : selector;

	for ( var i = 0, l = root.length; i < l; i++ ) {
		Sizzle( selector, root[i], tmpSet );
	}

	return Sizzle.filter( later, tmpSet );
};

// EXPOSE

var $$ = Sizzle;
/**
  * Returns an Array of elements matching the given className
  * @method getElementsByClass         
  * @param className {String}the class to search for
  * @param node {HTMLElement}an optional HTML Node to set context. If not supplied document is used.
  * @return {Array} An Array of matching HTMLElements 
  */
function getElementsByClass(className,context) {
//uses native where applicable.
    var classElements = [];
	var i;
	if ( context == null ) {
        context = document;
	}
    if ( context.getElementsByClassName ) {
		var tempCollection = context.getElementsByClassName(className);
		for (i = 0; i < tempCollection.length ; i++) {
			classElements.push(tempCollection[i])
		}
	}
	else {
		var elements = context.getElementsByTagName("*");
		var test = elements.length;
		var pattern = new RegExp("(^|\\s)"+className+"(\\s|$)");
		for (var i = 0; i < test; i++) {
			if ( pattern.test(elements[i].className) ) {
				classElements.push(elements[i]);
			}
		}
	}
	return classElements;
};
/**
  * Returns  the first non-text child node of an element.
  * @method getFirstChild         
  * @param element {Object} The reference element 
  * @return {Object} The first non-text child node of the referenced element  
  */
function getFirstChild(element) {
    element = element.firstChild;
    return element && element.nodeType != 1 ? getNextSibling(element) : element;
};
/**
  * Returns  the previous non-text sibling of an element.
  * @method getPreviousSibling         
  * @param element {Object} The reference element 
  * @return {Object} the previous non-text sibling of the referenced element  
  */
function getPreviousSibling(element) {
    do {
        element = element.previousSibling;
    } while ( element && element.nodeType != 1 );
    return element;
};
/**
  * Returns  the next non-text sibling of an element.
  * @method getNextSibling         
  * @param element {Object} The reference element 
  * @return {Object} the Next non-text sibling of the referenced element  
  */
function getNextSibling(element) {
    do {
        element = element.nextSibling;
    } while ( element && element.nodeType != 1 );
    return element;
};
/**
  * Returns  the last non-text child node of an element.
  * @method getFirstChild         
  * @param element {Object} The reference element 
  * @return {Object} The last non-text child node of the referenced element  
  */
function getLastChild(element) {
   element = element.lastChild;
    return element && element.nodeType != 1 ? getPreviousSibling(element) : element;
};

/**
 * Add an event listener to an element
 * @method addEvent
 * @param element {Object} the object or element the listener is subscribed
 * to.
 * @param type {String} the type of event- "click", "mouseover," etc.
 * @param handler {Function} the subscribed function
 */
function addEvent(element, type, handler) {
// written by Dean Edwards, 2005
// with input from Tino Zijdel, Matthias Miller, Diego Perini
// http://dean.edwards.name/weblog/2005/10/add-event/
	if (!handler.$$guid) handler.$$guid = addEvent.guid++;
	if (!element.events) element.events = {};
	var handlers = element.events[type];
	if (!handlers) {
		handlers = element.events[type] = {};
		if (element["on" + type]) {
			handlers[0] = element["on" + type];
		}
	}
	handlers[handler.$$guid] = handler;
	element["on" + type] = handleEvent;
};
addEvent.guid = 1;
/**
 * Remove an event listener from an element
 * @method removeEvent
 * @param element {Object} the object or element the listener is subscribed
 * to.
 * @param type {String} the type of event- "click", "mouseover," etc.
 * @param handler {Function} the subscribed function
 */
function removeEvent(element, type, handler) {
	if (element.events && element.events[type]) {
		delete element.events[type][handler.$$guid];
	}
};
/**
 * Helper function for addEvent
 * @method handleEvent
 * @param event  (Event) the event to be handled
 * @private
 */
function handleEvent(event) {
	var returnValue = true;
	event = event || fixEvent(window.event);
	var handlers = this.events[event.type];
	for (var i in handlers) {
		this.$$handleEvent = handlers[i];
		if (this.$$handleEvent(event) === false) {
			returnValue = false;
		}
	}
	return returnValue;
};
/**
 * Adds w3c methods to cancel events to stop event propagation
 * @method fixEvent
 * @param event (Event) the event to be handled
 * @private
 */
function fixEvent(event) {
	event.preventDefault = fixEvent.preventDefault;
	event.stopPropagation = fixEvent.stopPropagation;
	return event;
};
fixEvent.preventDefault = function() {
	this.returnValue = false;
};
fixEvent.stopPropagation = function() {
	this.cancelBubble = true;
};
/**
 * @param onComplete	{Function} A function to be called when the request finishes 
 * (after success and error callbacks are executed). The function gets passed the  XMLHttpRequest object
 * @param dataType	{String} The type of data that you're expecting back from the server. The options are:
   * "xml": An XML document
   * "html": Returns HTML as plain text; 
   * "script": Evaluates the response as JavaScript and returns it as plain text.
   * "text": A plain text string.
 * @param onError	{Function} A function to be called if the request fails. 
 * @param onSuccess	{Function}	A function to be called if the request succeeds. 
 * @param timeout	{Number} Set a local timeout (in milliseconds) for the request. 
 * @param type	{String} The type of request to make ("POST" or "GET")
 * @param url {String}	The URL to request
 */
function ajax( options ) {
    options = {
        type: options.type || "POST",
        url: options.url || "",
        timeout: options.timeout || 5000,
        onComplete: options.onComplete || function(){},
        onError: options.onError || function(){},
        onSuccess: options.onSuccess || function(){},
        data: options.data || ""
    };
	if ( typeof XMLHttpRequest == "undefined" )
    	XMLHttpRequest = function(){
        	return new ActiveXObject(
            	navigator.userAgent.indexOf("MSIE 5") >= 0 ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP"
        );
    };
	var xml = new XMLHttpRequest();
    xml.open(options.type, options.url, true);
    var requestDone = false;
    setTimeout(function(){
         requestDone = true;
    }, options.timeout);
    xml.onreadystatechange = function(){
        if ( xml.readyState == 4 && !requestDone ) {
            if ( httpSuccess( xml ) ) {
                options.onSuccess( httpData( xml, options.data ) );
            } else {
                options.onError();
            }
            options.onComplete();
            xml = null;
        }
    };
    xml.send(null);
    function httpSuccess(r) {
        try {
            return !r.status && location.protocol == "file:" ||
                ( r.status >= 200 && r.status < 300 ) ||
                r.status == 304 ||
                navigator.userAgent.indexOf("Safari") >= 0 && typeof r.status == "undefined";
        } catch(e){}
        return false;
    }
    function httpData(r,type) {
    	switch (type) {
			case  "xml" :
				data=r.responseXML;
				break;
			case "script" :
				data=eval(r.responseText);
				break;
			case "text" :
				data=r.responseText;
				break;				
			default:
				data=r.responseText;
				break;				
			}
       return data;
    }
};
/**
 * Add a class to an element
 * @method addClass
 * @param element (Object) the target HTMLelement
 * @param className (String) the class to be added
 */
function addClass(element, className) {
    if (!hasClass(element, className)) {
      element.className += (element.className ? " " : "") + className;
    }
};
/**
 * Tests for the presence of a CSS Clas on an element
 * @method hasClass
 * @param element (Object) the target HTMLelement
 * @param className (String) the class to be added
 * @return {Boolean} true or false depending on the presence of the class
 */
function hasClass(element, className) {
    var regexp = new RegExp("(^|\\s)" + className + "(\\s|$)");
    return regexp.test(element.className);
};
/**
 * Removes a class from an element
 * @method removeClass
 * @param element (Object) the target HTMLelement
 * @param className (String) the class to be removedd
 */
function removeClass(element, className) {
    var regexp = new RegExp("(^|\\s)" + className + "(\\s|$)", "g");
    element.className = element.className.replace(regexp, "$2").trim();
};
/**
 * toggles a class on/off
 * @method toggleClass
 * @param element (Object) the target HTMLelement
 * @param className (String)  the class to be toggled
 */
function toggleClass(element, className) {
    if (hasClass(element, className)) {
      removeClass(element, className);
    } else {
      addClass(element, className);
    }
};
/**
 * removes and element from the DOM
 * @method remove
 * @param element (Object) the target HTMLelement
 * @return {Object} a reference to the removed object
 */
function remove(element){
	return element.parentNode.removeChild(element);
};
/**
 * insert an element after reference element.
 * @method insertAfter
 * @param element (Object) the node to be inserted into the document
 * @param reference (Object) the referece node
 */
function insertAfter(element, reference) {
      reference.parentNode.insertBefore(element, reference.nextSibling);
};
/**
 * retrieves the x and y oordinates of an element
 * @method findPos
 * @param element (Object) the target HTMLelement
 * @return {Array} an Array containing the [x,y] coordinates of the element
 */
function findPos(element) {
	var curleft = curtop = 0;
	if (element.offsetParent) {
		curleft = element.offsetLeft;
		curtop = element.offsetTop;
		while (element = element.offsetParent) {
			curleft += element.offsetLeft;
			curtop += element.offsetTop;
		}
	}
	return [curleft,curtop];
};
/**
 * retrieves the x and y oordinates of an element
 * @method getXY
 * @param element (Object) the target HTMLelement
 * @return {Array} an Array containing the [x,y] coordinates of the element
 */
function getText(element) {
    var t = "";
	element = element.childNodes || e;
	for ( var i = 0; i < element.length; i++ ) {
        t += element[i].nodeType != 1 ?
            element[i].nodeValue : getText(element[i].childNodes);
    }
    return t;
};
/**
 * @private
 */
function _domLoad(){
	if (React.Data.domLoad) {
	  var test = React.Data.domLoad.length;
	  var todo = React.Data.domLoad;
	  for (var i=0; i< test; i++) {
		  todo[i]();
	  }
	  React.Data.domLoad = [];
	}
}
/**
 * Mechanism for cleanly adding function to the domcontenloaded event (or equiv)
 * @method domLoaded
 * @param func (Function) the function to be executed
 */
function domLoad(func) {
	if (!React.Data.domLoad) {
		React.Data.domLoad = [];
	}
	React.Data.domLoad.push(func);
}


//string extensions. 
//Otpimized code from Steven Levithan
//http://blog.stevenlevithan.com/archives/faster-trim-javascript
if(!String.prototype.trim) {
	String.prototype.trim = function() {
	  string = this.replace(/^\s+/, '');
	  for (var i = string.length - 1; i >= 0; i--) {
		  if (/\S/.test(string.charAt(i))) {
			  str = string.substring(0, i + 1);
			  break;
		  }
	  }
	  return string;
  }
}
//Array extensions
if(!Array.prototype.push) {
	Array.prototype.push = function(){
		for(var i=0;i<arguments.length;i++){
			this[this.length]=arguments[i]
		};
		return this.length;
	}
};
if(!Array.prototype.inArray) {
	Array.prototype.inArray = function (value) {
		var i;
		for (i=0;i< this.length;i++) {
			if (this[i] === value) {
				return true;
			}
		}
		return false;
	}
};
	return {
//EXPOSE PUBLIC METHODS
		$ : function(id){ return $(id) },
		$$ : function(selector, context, results, seed){ return $$(selector, context, results, seed) },
		getElementsByClass : function(theClass, context ){  return getElementsByClass( theClass, context ) },
		getFirstChild : function(element){  return getFirstChild(element) },
		getPreviousSibling : function(element){  return getPreviousSibling(element) },
		getNextSibling : function(element){  return getNextSibling(element) },
		getLastChild : function(element){  return getLastChild(element) },
		addEvent : function(element, type, handler){  return addEvent(element, type, handler) },
		removeEvent : function(element, type, handler){  return removeEvent(element, type, handler) },
		ajax: function( options ){  ajax( options ) },
		addClass: function(element, className){  addClass(element, className) },
		hasClass: function(element, className){  return hasClass(element, className) },
		removeClass: function(element, className){ removeClass(element, className) },
		toggleClass: function(element, className){  toggleClass(element, className) },
		remove : function(element){  remove(element) },
		insertAfter : function(element, reference){ insertAfter( element, reference ) },
		findPos : function(element){  return findPos(element) },
		getText : function(element) { return (element) },
		domLoad : function( func ){ domLoad( func ) }
	};
})();

//awidernet.com

var R = React.Behavior;

function supportsInputPlaceholder() {
	var i = document.createElement('input');
	return 'placeholder' in i;
} 
R.domLoad( function(){
	if (supportsInputPlaceholder()){
		var placeholderInputs = R.getElementsByClass("placeholder");
		var phLength = placeholderInputs.length;
		var val;
		for(i=0; i < phLength; i++){
			val = placeholderInputs[i].value;
			placeholderInputs[i].removeAttribute("value");
			placeholderInputs[i].placeholder = val;
		}
	}
	if ( R.$("s") ) {
		R.addEvent(R.$("s"),"focus",clearText);
	}
	if ( R.$("s-2") ) {
		R.addEvent(R.$("s-2"),"focus",clearText);
	}
	clearEmptyNav();
	/*@cc_on @*/
	/*@if (@_win32)
// With pages containing articles or article-like elements
	var articleSet = R.$$("#main article,  #posts > .meta-data, #no-results, #posts .author");
	var articleSetLength = articleSet.length;
	if(articleSetLength > 0){
		var temp;
		var firstChild;
		for(i = 0; i < articleSetLength; i++){
			temp = document.createElement("div");
			temp.className = "box-segment top";
			articleSet[i].parentNode.insertBefore(temp,articleSet[i]);
			temp = document.createElement("div");
			temp.className = "box-segment bottom";
			R.insertAfter(temp, articleSet[i] );
		}	  
	}
// In a page containing blog comments...
	var blogLines = R.getElementsByClass("comment-body", R.$("comment-container"));
	var blLength = blogLines.length;
	if(blLength > 0){
		var temp;
		// Add the solid line at the end of the blog comments			
		temp = document.createElement("img");
		temp.className = "lastLine";
		temp.src = ""+___baseURL+"/_assets/styles/images/solid-line.gif";		
		var blogListSet = R.getElementsByClass("commentlist", R.$("comment-container"));
		var lastLI = R.getLastChild(blogListSet[0]);
		R.insertAfter(temp, lastLI);

// Add the dotted lines at the end of each blog comment			
		for(i = 0; i < blLength; i++){
			temp = document.createElement("img");
			temp.className = "blogLine";
			temp.src = ""+___baseURL+"/_assets/styles/images/dashed-line.gif";
			R.insertAfter(temp, blogLines[i]);
		}
// Add the bubble icon after each comment reply link			
		var replyLinkSet = R.getElementsByClass("comment-reply-link", R.$("comment-container"));
		var rlLength = replyLinkSet.length;
		for(i = 0; i < rlLength; i++){
			temp = document.createElement("img");
			temp.className = "comment-reply-icon";
			temp.src = ""+___baseURL+"/_assets/styles/images/reply-bubble.gif";
			R.insertAfter(temp, replyLinkSet[i]);
		}	

// Add the author icon before the author link in each comment by the author			
		var byPostAuthorSet = R.getElementsByClass("vcard", R.$("comment-container"));
		var bpaLength = byPostAuthorSet.length;
		for(i = 0; i < bpaLength; i++){
			if(R.hasClass(byPostAuthorSet[i].parentNode.parentNode, "bypostauthor")){
				temp = document.createElement("img");
				temp.className = "post-author-icon";
				temp.src = ""+___baseURL+"/_assets/styles/images/author.gif";
				byPostAuthorSet[i].parentNode.insertBefore(temp, byPostAuthorSet[i]);
			}
		}
	}

// In a page containing a definition list, remove the bottom border from the last definition in a definition list
  var defList = R.$("posts").getElementsByTagName("dd");
	  if(defList.length > 0){
		var lastDef = defList[defList.length - 1];
		lastDef.style.border = "none";				
  }
	/*@end @*/  

});

function clearText(){
	this.value='';
	R.removeEvent(this, "focus", clearText);
};

function clearEmptyNav(){
	var navs = R.$$(".article-navigation div");
	var test = navs.length;
	for (var i = 0; i < test; i++){
		if ( navs[i].childNodes.length === 0) {
			R.remove(navs[i]);	
		};
	}
}
