/*
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * This is the integration file for JavaScript.
 *
 * It defines the FCKeditor class that can be used to create editor
 * instances in a HTML page in the client side. For server side
 * operations, use the specific integration system.
 */

// FCKeditor Class
var FCKeditor = function( instanceName, width, height, toolbarSet, value )
{
	// Properties
	this.InstanceName	= instanceName ;
	this.Width			= width			|| '100%' ;
	this.Height			= height		|| '200' ;
	this.ToolbarSet		= toolbarSet	|| 'Default' ;
	this.Value			= value			|| '' ;
	this.BasePath		= FCKeditor.BasePath ;
	this.CheckBrowser	= true ;
	this.DisplayErrors	= true ;

	this.Config			= new Object() ;

	// Events
	this.OnError		= null ;	// function( source, errorNumber, errorDescription )
}

/**
 * This is the default BasePath used by all editor instances.
 */
FCKeditor.BasePath = '/fckeditor/' ;

/**
 * The minimum height used when replacing textareas.
 */
FCKeditor.MinHeight = 200 ;

/**
 * The minimum width used when replacing textareas.
 */
FCKeditor.MinWidth = 750 ;

FCKeditor.prototype.Version			= '2.6' ;
FCKeditor.prototype.VersionBuild	= '18638' ;

FCKeditor.prototype.Create = function()
{
	document.write( this.CreateHtml() ) ;
}

FCKeditor.prototype.CreateHtml = function()
{
	// Check for errors
	if ( !this.InstanceName || this.InstanceName.length == 0 )
	{
		this._ThrowError( 701, 'You must specify an instance name.' ) ;
		return '' ;
	}

	var sHtml = '' ;

	if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
	{
		sHtml += '<input type="hidden" id="' + this.InstanceName + '" name="' + this.InstanceName + '" value="' + this._HTMLEncode( this.Value ) + '" style="display:none" />' ;
		sHtml += this._GetConfigHtml() ;
		sHtml += this._GetIFrameHtml() ;
	}
	else
	{
		var sWidth  = this.Width.toString().indexOf('%')  > 0 ? this.Width  : this.Width  + 'px' ;
		var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ;
		sHtml += '<textarea name="' + this.InstanceName + '" rows="4" cols="40" style="width:' + sWidth + ';height:' + sHeight + '">' + this._HTMLEncode( this.Value ) + '<\/textarea>' ;
	}

	return sHtml ;
}

FCKeditor.prototype.ReplaceTextarea = function()
{
	if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
	{
		// We must check the elements firstly using the Id and then the name.
		var oTextarea = document.getElementById( this.InstanceName ) ;
		var colElementsByName = document.getElementsByName( this.InstanceName ) ;
		var i = 0;
		while ( oTextarea || i == 0 )
		{
			if ( oTextarea && oTextarea.tagName.toLowerCase() == 'textarea' )
				break ;
			oTextarea = colElementsByName[i++] ;
		}

		if ( !oTextarea )
		{
			alert( 'Error: The TEXTAREA with id or name set to "' + this.InstanceName + '" was not found' ) ;
			return ;
		}

		oTextarea.style.display = 'none' ;
		this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ;
		this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ;
	}
}

FCKeditor.prototype._InsertHtmlBefore = function( html, element )
{
	if ( element.insertAdjacentHTML )	// IE
		element.insertAdjacentHTML( 'beforeBegin', html ) ;
	else								// Gecko
	{
		var oRange = document.createRange() ;
		oRange.setStartBefore( element ) ;
		var oFragment = oRange.createContextualFragment( html );
		element.parentNode.insertBefore( oFragment, element ) ;
	}
}

FCKeditor.prototype._GetConfigHtml = function()
{
	var sConfig = '' ;
	for ( var o in this.Config )
	{
		if ( sConfig.length > 0 ) sConfig += '&amp;' ;
		sConfig += encodeURIComponent( o ) + '=' + encodeURIComponent( this.Config[o] ) ;
	}

	return '<input type="hidden" id="' + this.InstanceName + '___Config" value="' + sConfig + '" style="display:none" />' ;
}

FCKeditor.prototype._GetIFrameHtml = function()
{
	var sFile = 'fckeditor.html' ;

	try
	{
		if ( (/fcksource=true/i).test( window.top.location.search ) )
			sFile = 'fckeditor.original.html' ;
	}
	catch (e) { /* Ignore it. Much probably we are inside a FRAME where the "top" is in another domain (security error). */ }

	var sLink = this.BasePath + 'editor/' + sFile + '?InstanceName=' + encodeURIComponent( this.InstanceName ) ;
	if (this.ToolbarSet) sLink += '&amp;Toolbar=' + this.ToolbarSet ;

	return '<iframe id="' + this.InstanceName + '___Frame" src="' + sLink + '" width="' + this.Width + '" height="' + this.Height + '" frameborder="0" scrolling="no"></iframe>' ;
}

FCKeditor.prototype._IsCompatibleBrowser = function()
{
	return FCKeditor_IsCompatibleBrowser() ;
}

FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription )
{
	this.ErrorNumber		= errorNumber ;
	this.ErrorDescription	= errorDescription ;

	if ( this.DisplayErrors )
	{
		document.write( '<div style="COLOR: #ff0000">' ) ;
		document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ;
		document.write( '</div>' ) ;
	}

	if ( typeof( this.OnError ) == 'function' )
		this.OnError( this, errorNumber, errorDescription ) ;
}

FCKeditor.prototype._HTMLEncode = function( text )
{
	if ( typeof( text ) != "string" )
		text = text.toString() ;

	text = text.replace(
		/&/g, "&amp;").replace(
		/"/g, "&quot;").replace(
		/</g, "&lt;").replace(
		/>/g, "&gt;") ;

	return text ;
}

;(function()
{
	var textareaToEditor = function( textarea )
	{
		var editor = new FCKeditor( textarea.name ) ;

		editor.Width = Math.max( textarea.offsetWidth, FCKeditor.MinWidth ) ;
		editor.Height = Math.max( textarea.offsetHeight, FCKeditor.MinHeight ) ;

		return editor ;
	}

	/**
	 * Replace all <textarea> elements available in the document with FCKeditor
	 * instances.
	 *
	 *	// Replace all <textarea> elements in the page.
	 *	FCKeditor.ReplaceAllTextareas() ;
	 *
	 *	// Replace all <textarea class="myClassName"> elements in the page.
	 *	FCKeditor.ReplaceAllTextareas( 'myClassName' ) ;
	 *
	 *	// Selectively replace <textarea> elements, based on custom assertions.
	 *	FCKeditor.ReplaceAllTextareas( function( textarea, editor )
	 *		{
	 *			// Custom code to evaluate the replace, returning false if it
	 *			// must not be done.
	 *			// It also passes the "editor" parameter, so the developer can
	 *			// customize the instance.
	 *		} ) ;
	 */
	FCKeditor.ReplaceAllTextareas = function()
	{
		var textareas = document.getElementsByTagName( 'textarea' ) ;

		for ( var i = 0 ; i < textareas.length ; i++ )
		{
			var editor = null ;
			var textarea = textareas[i] ;
			var name = textarea.name ;

			// The "name" attribute must exist.
			if ( !name || name.length == 0 )
				continue ;

			if ( typeof arguments[0] == 'string' )
			{
				// The textarea class name could be passed as the function
				// parameter.

				var classRegex = new RegExp( '(?:^| )' + arguments[0] + '(?:$| )' ) ;

				if ( !classRegex.test( textarea.className ) )
					continue ;
			}
			else if ( typeof arguments[0] == 'function' )
			{
				// An assertion function could be passed as the function parameter.
				// It must explicitly return "false" to ignore a specific <textarea>.
				editor = textareaToEditor( textarea ) ;
				if ( arguments[0]( textarea, editor ) === false )
					continue ;
			}

			if ( !editor )
				editor = textareaToEditor( textarea ) ;

			editor.ReplaceTextarea() ;
		}
	}
})() ;

function FCKeditor_IsCompatibleBrowser()
{
	var sAgent = navigator.userAgent.toLowerCase() ;

	// Internet Explorer 5.5+
	if ( /*@cc_on!@*/false && sAgent.indexOf("mac") == -1 )
	{
		var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
		return ( sBrowserVersion >= 5.5 ) ;
	}

	// Gecko (Opera 9 tries to behave like Gecko at this point).
	if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 && !( typeof(opera) == 'object' && opera.postError ) )
		return true ;

	// Opera 9.50+
	if ( window.opera && window.opera.version && parseFloat( window.opera.version() ) >= 9.5 )
		return true ;

	// Adobe AIR
	// Checked before Safari because AIR have the WebKit rich text editor
	// features from Safari 3.0.4, but the version reported is 420.
	if ( sAgent.indexOf( ' adobeair/' ) != -1 )
		return ( sAgent.match( / adobeair\/(\d+)/ )[1] >= 1 ) ;	// Build must be at least v1

	// Safari 3+
	if ( sAgent.indexOf( ' applewebkit/' ) != -1 )
		return ( sAgent.match( / applewebkit\/(\d+)/ )[1] >= 522 ) ;	// Build must be at least 522 (v3)

	return false ;
}


/*
 * jQuery JavaScript Library v1.3
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009)
 * Revision: 6104
 */
(function(){var l=this,g,x=l.jQuery,o=l.$,n=l.jQuery=l.$=function(D,E){return new n.fn.init(D,E)},C=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;n.fn=n.prototype={init:function(D,G){D=D||document;if(D.nodeType){this[0]=D;this.length=1;this.context=D;return this}if(typeof D==="string"){var F=C.exec(D);if(F&&(F[1]||!G)){if(F[1]){D=n.clean([F[1]],G)}else{var H=document.getElementById(F[3]);if(H){if(H.id!=F[3]){return n().find(D)}var E=n(H);E.context=document;E.selector=D;return E}D=[]}}else{return n(G).find(D)}}else{if(n.isFunction(D)){return n(document).ready(D)}}if(D.selector&&D.context){this.selector=D.selector;this.context=D.context}return this.setArray(n.makeArray(D))},selector:"",jquery:"1.3",size:function(){return this.length},get:function(D){return D===g?n.makeArray(this):this[D]},pushStack:function(E,G,D){var F=n(E);F.prevObject=this;F.context=this.context;if(G==="find"){F.selector=this.selector+(this.selector?" ":"")+D}else{if(G){F.selector=this.selector+"."+G+"("+D+")"}}return F},setArray:function(D){this.length=0;Array.prototype.push.apply(this,D);return this},each:function(E,D){return n.each(this,E,D)},index:function(D){return n.inArray(D&&D.jquery?D[0]:D,this)},attr:function(E,G,F){var D=E;if(typeof E==="string"){if(G===g){return this[0]&&n[F||"attr"](this[0],E)}else{D={};D[E]=G}}return this.each(function(H){for(E in D){n.attr(F?this.style:this,E,n.prop(this,D[E],F,H,E))}})},css:function(D,E){if((D=="width"||D=="height")&&parseFloat(E)<0){E=g}return this.attr(D,E,"curCSS")},text:function(E){if(typeof E!=="object"&&E!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(E))}var D="";n.each(E||this,function(){n.each(this.childNodes,function(){if(this.nodeType!=8){D+=this.nodeType!=1?this.nodeValue:n.fn.text([this])}})});return D},wrapAll:function(D){if(this[0]){var E=n(D,this[0].ownerDocument).clone();if(this[0].parentNode){E.insertBefore(this[0])}E.map(function(){var F=this;while(F.firstChild){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(D){return this.each(function(){n(this).contents().wrapAll(D)})},wrap:function(D){return this.each(function(){n(this).wrapAll(D)})},append:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.appendChild(D)}})},prepend:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.insertBefore(D,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this)})},after:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this.nextSibling)})},end:function(){return this.prevObject||n([])},push:[].push,find:function(D){if(this.length===1&&!/,/.test(D)){var F=this.pushStack([],"find",D);F.length=0;n.find(D,this[0],F);return F}else{var E=n.map(this,function(G){return n.find(D,G)});return this.pushStack(/[^+>] [^+>]/.test(D)?n.unique(E):E,"find",D)}},clone:function(E){var D=this.map(function(){if(!n.support.noCloneEvent&&!n.isXMLDoc(this)){var H=this.cloneNode(true),G=document.createElement("div");G.appendChild(H);return n.clean([G.innerHTML])[0]}else{return this.cloneNode(true)}});var F=D.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(E===true){this.find("*").andSelf().each(function(H){if(this.nodeType==3){return}var G=n.data(this,"events");for(var J in G){for(var I in G[J]){n.event.add(F[H],J,G[J][I],G[J][I].data)}}})}return D},filter:function(D){return this.pushStack(n.isFunction(D)&&n.grep(this,function(F,E){return D.call(F,E)})||n.multiFilter(D,n.grep(this,function(E){return E.nodeType===1})),"filter",D)},closest:function(D){var E=n.expr.match.POS.test(D)?n(D):null;return this.map(function(){var F=this;while(F&&F.ownerDocument){if(E?E.index(F)>-1:n(F).is(D)){return F}F=F.parentNode}})},not:function(D){if(typeof D==="string"){if(f.test(D)){return this.pushStack(n.multiFilter(D,this,true),"not",D)}else{D=n.multiFilter(D,this)}}var E=D.length&&D[D.length-1]!==g&&!D.nodeType;return this.filter(function(){return E?n.inArray(this,D)<0:this!=D})},add:function(D){return this.pushStack(n.unique(n.merge(this.get(),typeof D==="string"?n(D):n.makeArray(D))))},is:function(D){return !!D&&n.multiFilter(D,this).length>0},hasClass:function(D){return !!D&&this.is("."+D)},val:function(J){if(J===g){var D=this[0];if(D){if(n.nodeName(D,"option")){return(D.attributes.value||{}).specified?D.value:D.text}if(n.nodeName(D,"select")){var H=D.selectedIndex,K=[],L=D.options,G=D.type=="select-one";if(H<0){return null}for(var E=G?H:0,I=G?H+1:L.length;E<I;E++){var F=L[E];if(F.selected){J=n(F).val();if(G){return J}K.push(J)}}return K}return(D.value||"").replace(/\r/g,"")}return g}if(typeof J==="number"){J+=""}return this.each(function(){if(this.nodeType!=1){return}if(n.isArray(J)&&/radio|checkbox/.test(this.type)){this.checked=(n.inArray(this.value,J)>=0||n.inArray(this.name,J)>=0)}else{if(n.nodeName(this,"select")){var M=n.makeArray(J);n("option",this).each(function(){this.selected=(n.inArray(this.value,M)>=0||n.inArray(this.text,M)>=0)});if(!M.length){this.selectedIndex=-1}}else{this.value=J}}})},html:function(D){return D===g?(this[0]?this[0].innerHTML:null):this.empty().append(D)},replaceWith:function(D){return this.after(D).remove()},eq:function(D){return this.slice(D,+D+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(D){return this.pushStack(n.map(this,function(F,E){return D.call(F,E,F)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=n.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild,D=this.length>1?I.cloneNode(true):I;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),G>0?D.cloneNode(true):I)}}if(F){n.each(F,y)}}return this;function K(N,O){return M&&n.nodeName(N,"table")&&n.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};n.fn.init.prototype=n.fn;function y(D,E){if(E.src){n.ajax({url:E.src,async:false,dataType:"script"})}else{n.globalEval(E.text||E.textContent||E.innerHTML||"")}if(E.parentNode){E.parentNode.removeChild(E)}}function e(){return +new Date}n.extend=n.fn.extend=function(){var I=arguments[0]||{},G=1,H=arguments.length,D=false,F;if(typeof I==="boolean"){D=I;I=arguments[1]||{};G=2}if(typeof I!=="object"&&!n.isFunction(I)){I={}}if(H==G){I=this;--G}for(;G<H;G++){if((F=arguments[G])!=null){for(var E in F){var J=I[E],K=F[E];if(I===K){continue}if(D&&K&&typeof K==="object"&&!K.nodeType){I[E]=n.extend(D,J||(K.length!=null?[]:{}),K)}else{if(K!==g){I[E]=K}}}}}return I};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,p=document.defaultView||{},r=Object.prototype.toString;n.extend({noConflict:function(D){l.$=o;if(D){l.jQuery=x}return n},isFunction:function(D){return r.call(D)==="[object Function]"},isArray:function(D){return r.call(D)==="[object Array]"},isXMLDoc:function(D){return D.documentElement&&!D.body||D.tagName&&D.ownerDocument&&!D.ownerDocument.body},globalEval:function(F){F=n.trim(F);if(F){var E=document.getElementsByTagName("head")[0]||document.documentElement,D=document.createElement("script");D.type="text/javascript";if(n.support.scriptEval){D.appendChild(document.createTextNode(F))}else{D.text=F}E.insertBefore(D,E.firstChild);E.removeChild(D)}},nodeName:function(E,D){return E.nodeName&&E.nodeName.toUpperCase()==D.toUpperCase()},each:function(F,J,E){var D,G=0,H=F.length;if(E){if(H===g){for(D in F){if(J.apply(F[D],E)===false){break}}}else{for(;G<H;){if(J.apply(F[G++],E)===false){break}}}}else{if(H===g){for(D in F){if(J.call(F[D],D,F[D])===false){break}}}else{for(var I=F[0];G<H&&J.call(I,G,I)!==false;I=F[++G]){}}}return F},prop:function(G,H,F,E,D){if(n.isFunction(H)){H=H.call(G,E)}return typeof H==="number"&&F=="curCSS"&&!b.test(D)?H+"px":H},className:{add:function(D,E){n.each((E||"").split(/\s+/),function(F,G){if(D.nodeType==1&&!n.className.has(D.className,G)){D.className+=(D.className?" ":"")+G}})},remove:function(D,E){if(D.nodeType==1){D.className=E!==g?n.grep(D.className.split(/\s+/),function(F){return !n.className.has(E,F)}).join(" "):""}},has:function(E,D){return n.inArray(D,(E.className||E).toString().split(/\s+/))>-1}},swap:function(G,F,H){var D={};for(var E in F){D[E]=G.style[E];G.style[E]=F[E]}H.call(G);for(var E in F){G.style[E]=D[E]}},css:function(F,D,H){if(D=="width"||D=="height"){var J,E={position:"absolute",visibility:"hidden",display:"block"},I=D=="width"?["Left","Right"]:["Top","Bottom"];function G(){J=D=="width"?F.offsetWidth:F.offsetHeight;var L=0,K=0;n.each(I,function(){L+=parseFloat(n.curCSS(F,"padding"+this,true))||0;K+=parseFloat(n.curCSS(F,"border"+this+"Width",true))||0});J-=Math.round(L+K)}if(n(F).is(":visible")){G()}else{n.swap(F,E,G)}return Math.max(0,J)}return n.curCSS(F,D,H)},curCSS:function(H,E,F){var K,D=H.style;if(E=="opacity"&&!n.support.opacity){K=n.attr(D,"opacity");return K==""?"1":K}if(E.match(/float/i)){E=v}if(!F&&D&&D[E]){K=D[E]}else{if(p.getComputedStyle){if(E.match(/float/i)){E="float"}E=E.replace(/([A-Z])/g,"-$1").toLowerCase();var L=p.getComputedStyle(H,null);if(L){K=L.getPropertyValue(E)}if(E=="opacity"&&K==""){K="1"}}else{if(H.currentStyle){var I=E.replace(/\-(\w)/g,function(M,N){return N.toUpperCase()});K=H.currentStyle[E]||H.currentStyle[I];if(!/^\d+(px)?$/i.test(K)&&/^\d/.test(K)){var G=D.left,J=H.runtimeStyle.left;H.runtimeStyle.left=H.currentStyle.left;D.left=K||0;K=D.pixelLeft+"px";D.left=G;H.runtimeStyle.left=J}}}}return K},clean:function(E,J,H){J=J||document;if(typeof J.createElement==="undefined"){J=J.ownerDocument||J[0]&&J[0].ownerDocument||document}if(!H&&E.length===1&&typeof E[0]==="string"){var G=/^<(\w+)\s*\/?>$/.exec(E[0]);if(G){return[J.createElement(G[1])]}}var F=[],D=[],K=J.createElement("div");n.each(E,function(O,Q){if(typeof Q==="number"){Q+=""}if(!Q){return}if(typeof Q==="string"){Q=Q.replace(/(<(\w+)[^>]*?)\/>/g,function(S,T,R){return R.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?S:T+"></"+R+">"});var N=n.trim(Q).toLowerCase();var P=!N.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!N.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||N.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!N.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!N.indexOf("<td")||!N.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!N.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!n.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];K.innerHTML=P[1]+Q+P[2];while(P[0]--){K=K.lastChild}if(!n.support.tbody){var M=!N.indexOf("<table")&&N.indexOf("<tbody")<0?K.firstChild&&K.firstChild.childNodes:P[1]=="<table>"&&N.indexOf("<tbody")<0?K.childNodes:[];for(var L=M.length-1;L>=0;--L){if(n.nodeName(M[L],"tbody")&&!M[L].childNodes.length){M[L].parentNode.removeChild(M[L])}}}if(!n.support.leadingWhitespace&&/^\s/.test(Q)){K.insertBefore(J.createTextNode(Q.match(/^\s*/)[0]),K.firstChild)}Q=n.makeArray(K.childNodes)}if(Q.nodeType){F.push(Q)}else{F=n.merge(F,Q)}});if(H){for(var I=0;F[I];I++){if(n.nodeName(F[I],"script")&&(!F[I].type||F[I].type.toLowerCase()==="text/javascript")){D.push(F[I].parentNode?F[I].parentNode.removeChild(F[I]):F[I])}else{if(F[I].nodeType===1){F.splice.apply(F,[I+1,0].concat(n.makeArray(F[I].getElementsByTagName("script"))))}H.appendChild(F[I])}}return D}return F},attr:function(I,F,J){if(!I||I.nodeType==3||I.nodeType==8){return g}var G=!n.isXMLDoc(I),K=J!==g;F=G&&n.props[F]||F;if(I.tagName){var E=/href|src|style/.test(F);if(F=="selected"&&I.parentNode){I.parentNode.selectedIndex}if(F in I&&G&&!E){if(K){if(F=="type"&&n.nodeName(I,"input")&&I.parentNode){throw"type property can't be changed"}I[F]=J}if(n.nodeName(I,"form")&&I.getAttributeNode(F)){return I.getAttributeNode(F).nodeValue}if(F=="tabIndex"){var H=I.getAttributeNode("tabIndex");return H&&H.specified?H.value:I.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:g}return I[F]}if(!n.support.style&&G&&F=="style"){return n.attr(I.style,"cssText",J)}if(K){I.setAttribute(F,""+J)}var D=!n.support.hrefNormalized&&G&&E?I.getAttribute(F,2):I.getAttribute(F);return D===null?g:D}if(!n.support.opacity&&F=="opacity"){if(K){I.zoom=1;I.filter=(I.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(J)+""=="NaN"?"":"alpha(opacity="+J*100+")")}return I.filter&&I.filter.indexOf("opacity=")>=0?(parseFloat(I.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}F=F.replace(/-([a-z])/ig,function(L,M){return M.toUpperCase()});if(K){I[F]=J}return I[F]},trim:function(D){return(D||"").replace(/^\s+|\s+$/g,"")},makeArray:function(F){var D=[];if(F!=null){var E=F.length;if(E==null||typeof F==="string"||n.isFunction(F)||F.setInterval){D[0]=F}else{while(E){D[--E]=F[E]}}}return D},inArray:function(F,G){for(var D=0,E=G.length;D<E;D++){if(G[D]===F){return D}}return -1},merge:function(G,D){var E=0,F,H=G.length;if(!n.support.getAll){while((F=D[E++])!=null){if(F.nodeType!=8){G[H++]=F}}}else{while((F=D[E++])!=null){G[H++]=F}}return G},unique:function(J){var E=[],D={};try{for(var F=0,G=J.length;F<G;F++){var I=n.data(J[F]);if(!D[I]){D[I]=true;E.push(J[F])}}}catch(H){E=J}return E},grep:function(E,I,D){var F=[];for(var G=0,H=E.length;G<H;G++){if(!D!=!I(E[G],G)){F.push(E[G])}}return F},map:function(D,I){var E=[];for(var F=0,G=D.length;F<G;F++){var H=I(D[F],F);if(H!=null){E[E.length]=H}}return E.concat.apply([],E)}});var B=navigator.userAgent.toLowerCase();n.browser={version:(B.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(B),opera:/opera/.test(B),msie:/msie/.test(B)&&!/opera/.test(B),mozilla:/mozilla/.test(B)&&!/(compatible|webkit)/.test(B)};n.each({parent:function(D){return D.parentNode},parents:function(D){return n.dir(D,"parentNode")},next:function(D){return n.nth(D,2,"nextSibling")},prev:function(D){return n.nth(D,2,"previousSibling")},nextAll:function(D){return n.dir(D,"nextSibling")},prevAll:function(D){return n.dir(D,"previousSibling")},siblings:function(D){return n.sibling(D.parentNode.firstChild,D)},children:function(D){return n.sibling(D.firstChild)},contents:function(D){return n.nodeName(D,"iframe")?D.contentDocument||D.contentWindow.document:n.makeArray(D.childNodes)}},function(D,E){n.fn[D]=function(F){var G=n.map(this,E);if(F&&typeof F=="string"){G=n.multiFilter(F,G)}return this.pushStack(n.unique(G),D,F)}});n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(D,E){n.fn[D]=function(){var F=arguments;return this.each(function(){for(var G=0,H=F.length;G<H;G++){n(F[G])[E](this)}})}});n.each({removeAttr:function(D){n.attr(this,D,"");if(this.nodeType==1){this.removeAttribute(D)}},addClass:function(D){n.className.add(this,D)},removeClass:function(D){n.className.remove(this,D)},toggleClass:function(E,D){if(typeof D!=="boolean"){D=!n.className.has(this,E)}n.className[D?"add":"remove"](this,E)},remove:function(D){if(!D||n.filter(D,[this]).length){n("*",this).add([this]).each(function(){n.event.remove(this);n.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){n(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(D,E){n.fn[D]=function(){return this.each(E,arguments)}});function j(D,E){return D[0]&&parseInt(n.curCSS(D[0],E,true),10)||0}var h="jQuery"+e(),u=0,z={};n.extend({cache:{},data:function(E,D,F){E=E==l?z:E;var G=E[h];if(!G){G=E[h]=++u}if(D&&!n.cache[G]){n.cache[G]={}}if(F!==g){n.cache[G][D]=F}return D?n.cache[G][D]:G},removeData:function(E,D){E=E==l?z:E;var G=E[h];if(D){if(n.cache[G]){delete n.cache[G][D];D="";for(D in n.cache[G]){break}if(!D){n.removeData(E)}}}else{try{delete E[h]}catch(F){if(E.removeAttribute){E.removeAttribute(h)}}delete n.cache[G]}},queue:function(E,D,G){if(E){D=(D||"fx")+"queue";var F=n.data(E,D);if(!F||n.isArray(G)){F=n.data(E,D,n.makeArray(G))}else{if(G){F.push(G)}}}return F},dequeue:function(G,F){var D=n.queue(G,F),E=D.shift();if(!F||F==="fx"){E=D[0]}if(E!==g){E.call(G)}}});n.fn.extend({data:function(D,F){var G=D.split(".");G[1]=G[1]?"."+G[1]:"";if(F===g){var E=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(E===g&&this.length){E=n.data(this[0],D)}return E===g&&G[1]?this.data(G[0]):E}else{return this.trigger("setData"+G[1]+"!",[G[0],F]).each(function(){n.data(this,D,F)})}},removeData:function(D){return this.each(function(){n.removeData(this,D)})},queue:function(D,E){if(typeof D!=="string"){E=D;D="fx"}if(E===g){return n.queue(this[0],D)}return this.each(function(){var F=n.queue(this,D,E);if(D=="fx"&&F.length==1){F[0].call(this)}})},dequeue:function(D){return this.each(function(){n.dequeue(this,D)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.1
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var N=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,I=0,F=Object.prototype.toString;var E=function(ae,S,aa,V){aa=aa||[];S=S||document;if(S.nodeType!==1&&S.nodeType!==9){return[]}if(!ae||typeof ae!=="string"){return aa}var ab=[],ac,Y,ah,ag,Z,R,Q=true;N.lastIndex=0;while((ac=N.exec(ae))!==null){ab.push(ac[1]);if(ac[2]){R=RegExp.rightContext;break}}if(ab.length>1&&G.match.POS.exec(ae)){if(ab.length===2&&G.relative[ab[0]]){var U="",X;while((X=G.match.POS.exec(ae))){U+=X[0];ae=ae.replace(G.match.POS,"")}Y=E.filter(U,E(/\s$/.test(ae)?ae+"*":ae,S))}else{Y=G.relative[ab[0]]?[S]:E(ab.shift(),S);while(ab.length){var P=[];ae=ab.shift();if(G.relative[ae]){ae+=ab.shift()}for(var af=0,ad=Y.length;af<ad;af++){E(ae,Y[af],P)}Y=P}}}else{var ai=V?{expr:ab.pop(),set:D(V)}:E.find(ab.pop(),ab.length===1&&S.parentNode?S.parentNode:S);Y=E.filter(ai.expr,ai.set);if(ab.length>0){ah=D(Y)}else{Q=false}while(ab.length){var T=ab.pop(),W=T;if(!G.relative[T]){T=""}else{W=ab.pop()}if(W==null){W=S}G.relative[T](ah,W,M(S))}}if(!ah){ah=Y}if(!ah){throw"Syntax error, unrecognized expression: "+(T||ae)}if(F.call(ah)==="[object Array]"){if(!Q){aa.push.apply(aa,ah)}else{if(S.nodeType===1){for(var af=0;ah[af]!=null;af++){if(ah[af]&&(ah[af]===true||ah[af].nodeType===1&&H(S,ah[af]))){aa.push(Y[af])}}}else{for(var af=0;ah[af]!=null;af++){if(ah[af]&&ah[af].nodeType===1){aa.push(Y[af])}}}}}else{D(ah,aa)}if(R){E(R,S,aa,V)}return aa};E.matches=function(P,Q){return E(P,null,null,Q)};E.find=function(V,S){var W,Q;if(!V){return[]}for(var R=0,P=G.order.length;R<P;R++){var T=G.order[R],Q;if((Q=G.match[T].exec(V))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){Q[1]=(Q[1]||"").replace(/\\/g,"");W=G.find[T](Q,S);if(W!=null){V=V.replace(G.match[T],"");break}}}}if(!W){W=S.getElementsByTagName("*")}return{set:W,expr:V}};E.filter=function(S,ac,ad,T){var Q=S,Y=[],ah=ac,V,ab;while(S&&ac.length){for(var U in G.filter){if((V=G.match[U].exec(S))!=null){var Z=G.filter[U],R=null,X=0,aa,ag;ab=false;if(ah==Y){Y=[]}if(G.preFilter[U]){V=G.preFilter[U](V,ah,ad,Y,T);if(!V){ab=aa=true}else{if(V===true){continue}else{if(V[0]===true){R=[];var W=null,af;for(var ae=0;(af=ah[ae])!==g;ae++){if(af&&W!==af){R.push(af);W=af}}}}}}if(V){for(var ae=0;(ag=ah[ae])!==g;ae++){if(ag){if(R&&ag!=R[X]){X++}aa=Z(ag,V,X,R);var P=T^!!aa;if(ad&&aa!=null){if(P){ab=true}else{ah[ae]=false}}else{if(P){Y.push(ag);ab=true}}}}}if(aa!==g){if(!ad){ah=Y}S=S.replace(G.match[U],"");if(!ab){return[]}break}}}S=S.replace(/\s*,\s*/,"");if(S==Q){if(ab==null){throw"Syntax error, unrecognized expression: "+S}else{break}}Q=S}return ah};var G=E.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\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(P){return P.getAttribute("href")}},relative:{"+":function(T,Q){for(var R=0,P=T.length;R<P;R++){var S=T[R];if(S){var U=S.previousSibling;while(U&&U.nodeType!==1){U=U.previousSibling}T[R]=typeof Q==="string"?U||false:U===Q}}if(typeof Q==="string"){E.filter(Q,T,true)}},">":function(U,Q,V){if(typeof Q==="string"&&!/\W/.test(Q)){Q=V?Q:Q.toUpperCase();for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){var S=T.parentNode;U[R]=S.nodeName===Q?S:false}}}else{for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){U[R]=typeof Q==="string"?T.parentNode:T.parentNode===Q}}if(typeof Q==="string"){E.filter(Q,U,true)}}},"":function(S,Q,U){var R="done"+(I++),P=O;if(!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("parentNode",Q,R,S,T,U)},"~":function(S,Q,U){var R="done"+(I++),P=O;if(typeof Q==="string"&&!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("previousSibling",Q,R,S,T,U)}},find:{ID:function(Q,R){if(R.getElementById){var P=R.getElementById(Q[1]);return P?[P]:[]}},NAME:function(P,Q){return Q.getElementsByName?Q.getElementsByName(P[1]):null},TAG:function(P,Q){return Q.getElementsByTagName(P[1])}},preFilter:{CLASS:function(S,Q,R,P,U){S=" "+S[1].replace(/\\/g,"")+" ";for(var T=0;Q[T];T++){if(U^(" "+Q[T].className+" ").indexOf(S)>=0){if(!R){P.push(Q[T])}}else{if(R){Q[T]=false}}}return false},ID:function(P){return P[1].replace(/\\/g,"")},TAG:function(Q,P){for(var R=0;!P[R];R++){}return M(P[R])?Q[1]:Q[1].toUpperCase()},CHILD:function(P){if(P[1]=="nth"){var Q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(P[2]=="even"&&"2n"||P[2]=="odd"&&"2n+1"||!/\D/.test(P[2])&&"0n+"+P[2]||P[2]);P[2]=(Q[1]+(Q[2]||1))-0;P[3]=Q[3]-0}P[0]="done"+(I++);return P},ATTR:function(Q){var P=Q[1];if(G.attrMap[P]){Q[1]=G.attrMap[P]}if(Q[2]==="~="){Q[4]=" "+Q[4]+" "}return Q},PSEUDO:function(T,Q,R,P,U){if(T[1]==="not"){if(T[3].match(N).length>1){T[3]=E(T[3],null,null,Q)}else{var S=E.filter(T[3],Q,R,true^U);if(!R){P.push.apply(P,S)}return false}}else{if(G.match.POS.test(T[0])){return true}}return T},POS:function(P){P.unshift(true);return P}},filters:{enabled:function(P){return P.disabled===false&&P.type!=="hidden"},disabled:function(P){return P.disabled===true},checked:function(P){return P.checked===true},selected:function(P){P.parentNode.selectedIndex;return P.selected===true},parent:function(P){return !!P.firstChild},empty:function(P){return !P.firstChild},has:function(R,Q,P){return !!E(P[3],R).length},header:function(P){return/h\d/i.test(P.nodeName)},text:function(P){return"text"===P.type},radio:function(P){return"radio"===P.type},checkbox:function(P){return"checkbox"===P.type},file:function(P){return"file"===P.type},password:function(P){return"password"===P.type},submit:function(P){return"submit"===P.type},image:function(P){return"image"===P.type},reset:function(P){return"reset"===P.type},button:function(P){return"button"===P.type||P.nodeName.toUpperCase()==="BUTTON"},input:function(P){return/input|select|textarea|button/i.test(P.nodeName)}},setFilters:{first:function(Q,P){return P===0},last:function(R,Q,P,S){return Q===S.length-1},even:function(Q,P){return P%2===0},odd:function(Q,P){return P%2===1},lt:function(R,Q,P){return Q<P[3]-0},gt:function(R,Q,P){return Q>P[3]-0},nth:function(R,Q,P){return P[3]-0==Q},eq:function(R,Q,P){return P[3]-0==Q}},filter:{CHILD:function(P,S){var V=S[1],W=P.parentNode;var U="child"+W.childNodes.length;if(W&&(!W[U]||!P.nodeIndex)){var T=1;for(var Q=W.firstChild;Q;Q=Q.nextSibling){if(Q.nodeType==1){Q.nodeIndex=T++}}W[U]=T-1}if(V=="first"){return P.nodeIndex==1}else{if(V=="last"){return P.nodeIndex==W[U]}else{if(V=="only"){return W[U]==1}else{if(V=="nth"){var Y=false,R=S[2],X=S[3];if(R==1&&X==0){return true}if(R==0){if(P.nodeIndex==X){Y=true}}else{if((P.nodeIndex-X)%R==0&&(P.nodeIndex-X)/R>=0){Y=true}}return Y}}}}},PSEUDO:function(V,R,S,W){var Q=R[1],T=G.filters[Q];if(T){return T(V,S,R,W)}else{if(Q==="contains"){return(V.textContent||V.innerText||"").indexOf(R[3])>=0}else{if(Q==="not"){var U=R[3];for(var S=0,P=U.length;S<P;S++){if(U[S]===V){return false}}return true}}}},ID:function(Q,P){return Q.nodeType===1&&Q.getAttribute("id")===P},TAG:function(Q,P){return(P==="*"&&Q.nodeType===1)||Q.nodeName===P},CLASS:function(Q,P){return P.test(Q.className)},ATTR:function(T,R){var P=G.attrHandle[R[1]]?G.attrHandle[R[1]](T):T[R[1]]||T.getAttribute(R[1]),U=P+"",S=R[2],Q=R[4];return P==null?false:S==="="?U===Q:S==="*="?U.indexOf(Q)>=0:S==="~="?(" "+U+" ").indexOf(Q)>=0:!R[4]?P:S==="!="?U!=Q:S==="^="?U.indexOf(Q)===0:S==="$="?U.substr(U.length-Q.length)===Q:S==="|="?U===Q||U.substr(0,Q.length+1)===Q+"-":false},POS:function(T,Q,R,U){var P=Q[2],S=G.setFilters[P];if(S){return S(T,R,Q,U)}}}};for(var K in G.match){G.match[K]=RegExp(G.match[K].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var D=function(Q,P){Q=Array.prototype.slice.call(Q);if(P){P.push.apply(P,Q);return P}return Q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(J){D=function(T,S){var Q=S||[];if(F.call(T)==="[object Array]"){Array.prototype.push.apply(Q,T)}else{if(typeof T.length==="number"){for(var R=0,P=T.length;R<P;R++){Q.push(T[R])}}else{for(var R=0;T[R];R++){Q.push(T[R])}}}return Q}}(function(){var Q=document.createElement("form"),R="script"+(new Date).getTime();Q.innerHTML="<input name='"+R+"'/>";var P=document.documentElement;P.insertBefore(Q,P.firstChild);if(!!document.getElementById(R)){G.find.ID=function(T,U){if(U.getElementById){var S=U.getElementById(T[1]);return S?S.id===T[1]||S.getAttributeNode&&S.getAttributeNode("id").nodeValue===T[1]?[S]:g:[]}};G.filter.ID=function(U,S){var T=U.getAttributeNode&&U.getAttributeNode("id");return U.nodeType===1&&T&&T.nodeValue===S}}P.removeChild(Q)})();(function(){var P=document.createElement("div");P.appendChild(document.createComment(""));if(P.getElementsByTagName("*").length>0){G.find.TAG=function(Q,U){var T=U.getElementsByTagName(Q[1]);if(Q[1]==="*"){var S=[];for(var R=0;T[R];R++){if(T[R].nodeType===1){S.push(T[R])}}T=S}return T}}P.innerHTML="<a href='#'></a>";if(P.firstChild.getAttribute("href")!=="#"){G.attrHandle.href=function(Q){return Q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var P=E;E=function(T,S,Q,R){S=S||document;if(!R&&S.nodeType===9){try{return D(S.querySelectorAll(T),Q)}catch(U){}}return P(T,S,Q,R)};E.find=P.find;E.filter=P.filter;E.selectors=P.selectors;E.matches=P.matches})()}if(document.documentElement.getElementsByClassName){G.order.splice(1,0,"CLASS");G.find.CLASS=function(P,Q){return Q.getElementsByClassName(P[1])}}function L(Q,W,V,Z,X,Y){for(var T=0,R=Z.length;T<R;T++){var P=Z[T];if(P){P=P[Q];var U=false;while(P&&P.nodeType){var S=P[V];if(S){U=Z[S];break}if(P.nodeType===1&&!Y){P[V]=T}if(P.nodeName===W){U=P;break}P=P[Q]}Z[T]=U}}}function O(Q,V,U,Y,W,X){for(var S=0,R=Y.length;S<R;S++){var P=Y[S];if(P){P=P[Q];var T=false;while(P&&P.nodeType){if(P[U]){T=Y[P[U]];break}if(P.nodeType===1){if(!X){P[U]=S}if(typeof V!=="string"){if(P===V){T=true;break}}else{if(E.filter(V,[P]).length>0){T=P;break}}}P=P[Q]}Y[S]=T}}}var H=document.compareDocumentPosition?function(Q,P){return Q.compareDocumentPosition(P)&16}:function(Q,P){return Q!==P&&(Q.contains?Q.contains(P):true)};var M=function(P){return P.documentElement&&!P.body||P.tagName&&P.ownerDocument&&!P.ownerDocument.body};n.find=E;n.filter=E.filter;n.expr=E.selectors;n.expr[":"]=n.expr.filters;E.selectors.filters.hidden=function(P){return"hidden"===P.type||n.css(P,"display")==="none"||n.css(P,"visibility")==="hidden"};E.selectors.filters.visible=function(P){return"hidden"!==P.type&&n.css(P,"display")!=="none"&&n.css(P,"visibility")!=="hidden"};E.selectors.filters.animated=function(P){return n.grep(n.timers,function(Q){return P===Q.elem}).length};n.multiFilter=function(R,P,Q){if(Q){R=":not("+R+")"}return E.matches(R,P)};n.dir=function(R,Q){var P=[],S=R[Q];while(S&&S!=document){if(S.nodeType==1){P.push(S)}S=S[Q]}return P};n.nth=function(T,P,R,S){P=P||1;var Q=0;for(;T;T=T[R]){if(T.nodeType==1&&++Q==P){break}}return T};n.sibling=function(R,Q){var P=[];for(;R;R=R.nextSibling){if(R.nodeType==1&&R!=Q){P.push(R)}}return P};return;l.Sizzle=E})();n.event={add:function(H,E,G,J){if(H.nodeType==3||H.nodeType==8){return}if(H.setInterval&&H!=l){H=l}if(!G.guid){G.guid=this.guid++}if(J!==g){var F=G;G=this.proxy(F);G.data=J}var D=n.data(H,"events")||n.data(H,"events",{}),I=n.data(H,"handle")||n.data(H,"handle",function(){return typeof n!=="undefined"&&!n.event.triggered?n.event.handle.apply(arguments.callee.elem,arguments):g});I.elem=H;n.each(E.split(/\s+/),function(L,M){var N=M.split(".");M=N.shift();G.type=N.slice().sort().join(".");var K=D[M];if(n.event.specialAll[M]){n.event.specialAll[M].setup.call(H,J,N)}if(!K){K=D[M]={};if(!n.event.special[M]||n.event.special[M].setup.call(H,J,N)===false){if(H.addEventListener){H.addEventListener(M,I,false)}else{if(H.attachEvent){H.attachEvent("on"+M,I)}}}}K[G.guid]=G;n.event.global[M]=true});H=null},guid:1,global:{},remove:function(J,G,I){if(J.nodeType==3||J.nodeType==8){return}var F=n.data(J,"events"),E,D;if(F){if(G===g||(typeof G==="string"&&G.charAt(0)==".")){for(var H in F){this.remove(J,H+(G||""))}}else{if(G.type){I=G.handler;G=G.type}n.each(G.split(/\s+/),function(L,N){var P=N.split(".");N=P.shift();var M=RegExp("(^|\\.)"+P.slice().sort().join(".*\\.")+"(\\.|$)");if(F[N]){if(I){delete F[N][I.guid]}else{for(var O in F[N]){if(M.test(F[N][O].type)){delete F[N][O]}}}if(n.event.specialAll[N]){n.event.specialAll[N].teardown.call(J,P)}for(E in F[N]){break}if(!E){if(!n.event.special[N]||n.event.special[N].teardown.call(J,P)===false){if(J.removeEventListener){J.removeEventListener(N,n.data(J,"handle"),false)}else{if(J.detachEvent){J.detachEvent("on"+N,n.data(J,"handle"))}}}E=null;delete F[N]}}})}for(E in F){break}if(!E){var K=n.data(J,"handle");if(K){K.elem=null}n.removeData(J,"events");n.removeData(J,"handle")}}},trigger:function(H,J,G,D){var F=H.type||H;if(!D){H=typeof H==="object"?H[h]?H:n.extend(n.Event(F),H):n.Event(F);if(F.indexOf("!")>=0){H.type=F=F.slice(0,-1);H.exclusive=true}if(!G){H.stopPropagation();if(this.global[F]){n.each(n.cache,function(){if(this.events&&this.events[F]){n.event.trigger(H,J,this.handle.elem)}})}}if(!G||G.nodeType==3||G.nodeType==8){return g}H.result=g;H.target=G;J=n.makeArray(J);J.unshift(H)}H.currentTarget=G;var I=n.data(G,"handle");if(I){I.apply(G,J)}if((!G[F]||(n.nodeName(G,"a")&&F=="click"))&&G["on"+F]&&G["on"+F].apply(G,J)===false){H.result=false}if(!D&&G[F]&&!H.isDefaultPrevented()&&!(n.nodeName(G,"a")&&F=="click")){this.triggered=true;try{G[F]()}catch(K){}}this.triggered=false;if(!H.isPropagationStopped()){var E=G.parentNode||G.ownerDocument;if(E){n.event.trigger(H,J,E,true)}}},handle:function(J){var I,D;J=arguments[0]=n.event.fix(J||l.event);var K=J.type.split(".");J.type=K.shift();I=!K.length&&!J.exclusive;var H=RegExp("(^|\\.)"+K.slice().sort().join(".*\\.")+"(\\.|$)");D=(n.data(this,"events")||{})[J.type];for(var F in D){var G=D[F];if(I||H.test(G.type)){J.handler=G;J.data=G.data;var E=G.apply(this,arguments);if(E!==g){J.result=E;if(E===false){J.preventDefault();J.stopPropagation()}}if(J.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(G){if(G[h]){return G}var E=G;G=n.Event(E);for(var F=this.props.length,I;F;){I=this.props[--F];G[I]=E[I]}if(!G.target){G.target=G.srcElement||document}if(G.target.nodeType==3){G.target=G.target.parentNode}if(!G.relatedTarget&&G.fromElement){G.relatedTarget=G.fromElement==G.target?G.toElement:G.fromElement}if(G.pageX==null&&G.clientX!=null){var H=document.documentElement,D=document.body;G.pageX=G.clientX+(H&&H.scrollLeft||D&&D.scrollLeft||0)-(H.clientLeft||0);G.pageY=G.clientY+(H&&H.scrollTop||D&&D.scrollTop||0)-(H.clientTop||0)}if(!G.which&&((G.charCode||G.charCode===0)?G.charCode:G.keyCode)){G.which=G.charCode||G.keyCode}if(!G.metaKey&&G.ctrlKey){G.metaKey=G.ctrlKey}if(!G.which&&G.button){G.which=(G.button&1?1:(G.button&2?3:(G.button&4?2:0)))}return G},proxy:function(E,D){D=D||function(){return E.apply(this,arguments)};D.guid=E.guid=E.guid||D.guid||this.guid++;return D},special:{ready:{setup:A,teardown:function(){}}},specialAll:{live:{setup:function(D,E){n.event.add(this,E[0],c)},teardown:function(F){if(F.length){var D=0,E=RegExp("(^|\\.)"+F[0]+"(\\.|$)");n.each((n.data(this,"events").live||{}),function(){if(E.test(this.type)){D++}});if(D<1){n.event.remove(this,F[0],c)}}}}}};n.Event=function(D){if(!this.preventDefault){return new n.Event(D)}if(D&&D.type){this.originalEvent=D;this.type=D.type;this.timeStamp=D.timeStamp}else{this.type=D}if(!this.timeStamp){this.timeStamp=e()}this[h]=true};function k(){return false}function t(){return true}n.Event.prototype={preventDefault:function(){this.isDefaultPrevented=t;var D=this.originalEvent;if(!D){return}if(D.preventDefault){D.preventDefault()}D.returnValue=false},stopPropagation:function(){this.isPropagationStopped=t;var D=this.originalEvent;if(!D){return}if(D.stopPropagation){D.stopPropagation()}D.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(E){var D=E.relatedTarget;while(D&&D!=this){try{D=D.parentNode}catch(F){D=this}}if(D!=this){E.type=E.data;n.event.handle.apply(this,arguments)}};n.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(E,D){n.event.special[D]={setup:function(){n.event.add(this,E,a,D)},teardown:function(){n.event.remove(this,E,a)}}});n.fn.extend({bind:function(E,F,D){return E=="unload"?this.one(E,F,D):this.each(function(){n.event.add(this,E,D||F,D&&F)})},one:function(F,G,E){var D=n.event.proxy(E||G,function(H){n(this).unbind(H,D);return(E||G).apply(this,arguments)});return this.each(function(){n.event.add(this,F,D,E&&G)})},unbind:function(E,D){return this.each(function(){n.event.remove(this,E,D)})},trigger:function(D,E){return this.each(function(){n.event.trigger(D,E,this)})},triggerHandler:function(D,F){if(this[0]){var E=n.Event(D);E.preventDefault();E.stopPropagation();n.event.trigger(E,F,this[0]);return E.result}},toggle:function(F){var D=arguments,E=1;while(E<D.length){n.event.proxy(F,D[E++])}return this.click(n.event.proxy(F,function(G){this.lastToggle=(this.lastToggle||0)%E;G.preventDefault();return D[this.lastToggle++].apply(this,arguments)||false}))},hover:function(D,E){return this.mouseenter(D).mouseleave(E)},ready:function(D){A();if(n.isReady){D.call(document,n)}else{n.readyList.push(D)}return this},live:function(F,E){var D=n.event.proxy(E);D.guid+=this.selector+F;n(document).bind(i(F,this.selector),this.selector,D);return this},die:function(E,D){n(document).unbind(i(E,this.selector),D?{guid:D.guid+this.selector+E}:null);return this}});function c(G){var D=RegExp("(^|\\.)"+G.type+"(\\.|$)"),F=true,E=[];n.each(n.data(this,"events").live||[],function(H,I){if(D.test(I.type)){var J=n(G.target).closest(I.data)[0];if(J){E.push({elem:J,fn:I})}}});n.each(E,function(){if(!G.isImmediatePropagationStopped()&&this.fn.call(this.elem,G,this.fn.data)===false){F=false}});return F}function i(E,D){return["live",E,D.replace(/\./g,"`").replace(/ /g,"|")].join(".")}n.extend({isReady:false,readyList:[],ready:function(){if(!n.isReady){n.isReady=true;if(n.readyList){n.each(n.readyList,function(){this.call(document,n)});n.readyList=null}n(document).triggerHandler("ready")}}});var w=false;function A(){if(w){return}w=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);n.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);n.ready()}});if(document.documentElement.doScroll&&!l.frameElement){(function(){if(n.isReady){return}try{document.documentElement.doScroll("left")}catch(D){setTimeout(arguments.callee,0);return}n.ready()})()}}}n.event.add(l,"load",n.ready)}n.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(E,D){n.fn[D]=function(F){return F?this.bind(D,F):this.trigger(D)}});n(l).bind("unload",function(){for(var D in n.cache){if(D!=1&&n.cache[D].handle){n.event.remove(n.cache[D].handle.elem)}}});(function(){n.support={};var E=document.documentElement,F=document.createElement("script"),J=document.createElement("div"),I="script"+(new Date).getTime();J.style.display="none";J.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var G=J.getElementsByTagName("*"),D=J.getElementsByTagName("a")[0];if(!G||!G.length||!D){return}n.support={leadingWhitespace:J.firstChild.nodeType==3,tbody:!J.getElementsByTagName("tbody").length,objectAll:!!J.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(D.getAttribute("style")),hrefNormalized:D.getAttribute("href")==="/a",opacity:D.style.opacity==="0.5",cssFloat:!!D.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};F.type="text/javascript";try{F.appendChild(document.createTextNode("window."+I+"=1;"))}catch(H){}E.insertBefore(F,E.firstChild);if(l[I]){n.support.scriptEval=true;delete l[I]}E.removeChild(F);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function(){n.support.noCloneEvent=false;J.detachEvent("onclick",arguments.callee)});J.cloneNode(true).fireEvent("onclick")}n(function(){var K=document.createElement("div");K.style.width="1px";K.style.paddingLeft="1px";document.body.appendChild(K);n.boxModel=n.support.boxModel=K.offsetWidth===2;document.body.removeChild(K)})})();var v=n.support.cssFloat?"cssFloat":"styleFloat";n.props={"for":"htmlFor","class":"className","float":v,cssFloat:v,styleFloat:v,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};n.fn.extend({_load:n.fn.load,load:function(F,I,J){if(typeof F!=="string"){return this._load(F)}var H=F.indexOf(" ");if(H>=0){var D=F.slice(H,F.length);F=F.slice(0,H)}var G="GET";if(I){if(n.isFunction(I)){J=I;I=null}else{if(typeof I==="object"){I=n.param(I);G="POST"}}}var E=this;n.ajax({url:F,type:G,dataType:"html",data:I,complete:function(L,K){if(K=="success"||K=="notmodified"){E.html(D?n("<div/>").append(L.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(D):L.responseText)}if(J){E.each(J,[L.responseText,K,L])}}});return this},serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?n.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(D,E){var F=n(this).val();return F==null?null:n.isArray(F)?n.map(F,function(H,G){return{name:E.name,value:H}}):{name:E.name,value:F}}).get()}});n.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(D,E){n.fn[E]=function(F){return this.bind(E,F)}});var q=e();n.extend({get:function(D,F,G,E){if(n.isFunction(F)){G=F;F=null}return n.ajax({type:"GET",url:D,data:F,success:G,dataType:E})},getScript:function(D,E){return n.get(D,null,E,"script")},getJSON:function(D,E,F){return n.get(D,E,F,"json")},post:function(D,F,G,E){if(n.isFunction(F)){G=F;F={}}return n.ajax({type:"POST",url:D,data:F,success:G,dataType:E})},ajaxSetup:function(D){n.extend(n.ajaxSettings,D)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(L){L=n.extend(true,L,n.extend(true,{},n.ajaxSettings,L));var V,E=/=\?(&|$)/g,Q,U,F=L.type.toUpperCase();if(L.data&&L.processData&&typeof L.data!=="string"){L.data=n.param(L.data)}if(L.dataType=="jsonp"){if(F=="GET"){if(!L.url.match(E)){L.url+=(L.url.match(/\?/)?"&":"?")+(L.jsonp||"callback")+"=?"}}else{if(!L.data||!L.data.match(E)){L.data=(L.data?L.data+"&":"")+(L.jsonp||"callback")+"=?"}}L.dataType="json"}if(L.dataType=="json"&&(L.data&&L.data.match(E)||L.url.match(E))){V="jsonp"+q++;if(L.data){L.data=(L.data+"").replace(E,"="+V+"$1")}L.url=L.url.replace(E,"="+V+"$1");L.dataType="script";l[V]=function(W){U=W;H();K();l[V]=g;try{delete l[V]}catch(X){}if(G){G.removeChild(S)}}}if(L.dataType=="script"&&L.cache==null){L.cache=false}if(L.cache===false&&F=="GET"){var D=e();var T=L.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+D+"$2");L.url=T+((T==L.url)?(L.url.match(/\?/)?"&":"?")+"_="+D:"")}if(L.data&&F=="GET"){L.url+=(L.url.match(/\?/)?"&":"?")+L.data;L.data=null}if(L.global&&!n.active++){n.event.trigger("ajaxStart")}var P=/^(\w+:)?\/\/([^\/?#]+)/.exec(L.url);if(L.dataType=="script"&&F=="GET"&&P&&(P[1]&&P[1]!=location.protocol||P[2]!=location.host)){var G=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.src=L.url;if(L.scriptCharset){S.charset=L.scriptCharset}if(!V){var N=false;S.onload=S.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){N=true;H();K();G.removeChild(S)}}}G.appendChild(S);return g}var J=false;var I=L.xhr();if(L.username){I.open(F,L.url,L.async,L.username,L.password)}else{I.open(F,L.url,L.async)}try{if(L.data){I.setRequestHeader("Content-Type",L.contentType)}if(L.ifModified){I.setRequestHeader("If-Modified-Since",n.lastModified[L.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}I.setRequestHeader("X-Requested-With","XMLHttpRequest");I.setRequestHeader("Accept",L.dataType&&L.accepts[L.dataType]?L.accepts[L.dataType]+", */*":L.accepts._default)}catch(R){}if(L.beforeSend&&L.beforeSend(I,L)===false){if(L.global&&!--n.active){n.event.trigger("ajaxStop")}I.abort();return false}if(L.global){n.event.trigger("ajaxSend",[I,L])}var M=function(W){if(I.readyState==0){if(O){clearInterval(O);O=null;if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}}else{if(!J&&I&&(I.readyState==4||W=="timeout")){J=true;if(O){clearInterval(O);O=null}Q=W=="timeout"?"timeout":!n.httpSuccess(I)?"error":L.ifModified&&n.httpNotModified(I,L.url)?"notmodified":"success";if(Q=="success"){try{U=n.httpData(I,L.dataType,L)}catch(Y){Q="parsererror"}}if(Q=="success"){var X;try{X=I.getResponseHeader("Last-Modified")}catch(Y){}if(L.ifModified&&X){n.lastModified[L.url]=X}if(!V){H()}}else{n.handleError(L,I,Q)}K();if(L.async){I=null}}}};if(L.async){var O=setInterval(M,13);if(L.timeout>0){setTimeout(function(){if(I){if(!J){M("timeout")}if(I){I.abort()}}},L.timeout)}}try{I.send(L.data)}catch(R){n.handleError(L,I,null,R)}if(!L.async){M()}function H(){if(L.success){L.success(U,Q)}if(L.global){n.event.trigger("ajaxSuccess",[I,L])}}function K(){if(L.complete){L.complete(I,Q)}if(L.global){n.event.trigger("ajaxComplete",[I,L])}if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}return I},handleError:function(E,G,D,F){if(E.error){E.error(G,D,F)}if(E.global){n.event.trigger("ajaxError",[G,E,F])}},active:0,httpSuccess:function(E){try{return !E.status&&location.protocol=="file:"||(E.status>=200&&E.status<300)||E.status==304||E.status==1223}catch(D){}return false},httpNotModified:function(F,D){try{var G=F.getResponseHeader("Last-Modified");return F.status==304||G==n.lastModified[D]}catch(E){}return false},httpData:function(I,G,F){var E=I.getResponseHeader("content-type"),D=G=="xml"||!G&&E&&E.indexOf("xml")>=0,H=D?I.responseXML:I.responseText;if(D&&H.documentElement.tagName=="parsererror"){throw"parsererror"}if(F&&F.dataFilter){H=F.dataFilter(H,G)}if(typeof H==="string"){if(G=="script"){n.globalEval(H)}if(G=="json"){H=l["eval"]("("+H+")")}}return H},param:function(D){var F=[];function G(H,I){F[F.length]=encodeURIComponent(H)+"="+encodeURIComponent(I)}if(n.isArray(D)||D.jquery){n.each(D,function(){G(this.name,this.value)})}else{for(var E in D){if(n.isArray(D[E])){n.each(D[E],function(){G(E,this)})}else{G(E,n.isFunction(D[E])?D[E]():D[E])}}}return F.join("&").replace(/%20/g,"+")}});var m={},d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function s(E,D){var F={};n.each(d.concat.apply([],d.slice(0,D)),function(){F[this]=E});return F}n.fn.extend({show:function(I,K){if(I){return this.animate(s("show",3),I,K)}else{for(var G=0,E=this.length;G<E;G++){var D=n.data(this[G],"olddisplay");this[G].style.display=D||"";if(n.css(this[G],"display")==="none"){var F=this[G].tagName,J;if(m[F]){J=m[F]}else{var H=n("<"+F+" />").appendTo("body");J=H.css("display");if(J==="none"){J="block"}H.remove();m[F]=J}this[G].style.display=n.data(this[G],"olddisplay",J)}}return this}},hide:function(G,H){if(G){return this.animate(s("hide",3),G,H)}else{for(var F=0,E=this.length;F<E;F++){var D=n.data(this[F],"olddisplay");if(!D&&D!=="none"){n.data(this[F],"olddisplay",n.css(this[F],"display"))}this[F].style.display="none"}return this}},_toggle:n.fn.toggle,toggle:function(F,E){var D=typeof F==="boolean";return n.isFunction(F)&&n.isFunction(E)?this._toggle.apply(this,arguments):F==null||D?this.each(function(){var G=D?F:n(this).is(":hidden");n(this)[G?"show":"hide"]()}):this.animate(s("toggle",3),F,E)},fadeTo:function(D,F,E){return this.animate({opacity:F},D,E)},animate:function(H,E,G,F){var D=n.speed(E,G,F);return this[D.queue===false?"each":"queue"](function(){var J=n.extend({},D),L,K=this.nodeType==1&&n(this).is(":hidden"),I=this;for(L in H){if(H[L]=="hide"&&K||H[L]=="show"&&!K){return J.complete.call(this)}if((L=="height"||L=="width")&&this.style){J.display=n.css(this,"display");J.overflow=this.style.overflow}}if(J.overflow!=null){this.style.overflow="hidden"}J.curAnim=n.extend({},H);n.each(H,function(N,R){var Q=new n.fx(I,J,N);if(/toggle|show|hide/.test(R)){Q[R=="toggle"?K?"show":"hide":R](H)}else{var P=R.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),S=Q.cur(true)||0;if(P){var M=parseFloat(P[2]),O=P[3]||"px";if(O!="px"){I.style[N]=(M||1)+O;S=((M||1)/Q.cur(true))*S;I.style[N]=S+O}if(P[1]){M=((P[1]=="-="?-1:1)*M)+S}Q.custom(S,M,O)}else{Q.custom(S,R,"")}}});return true})},stop:function(E,D){var F=n.timers;if(E){this.queue([])}this.each(function(){for(var G=F.length-1;G>=0;G--){if(F[G].elem==this){if(D){F[G](true)}F.splice(G,1)}}});if(!D){this.dequeue()}return this}});n.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(D,E){n.fn[D]=function(F,G){return this.animate(E,F,G)}});n.extend({speed:function(F,G,E){var D=typeof F==="object"?F:{complete:E||!E&&G||n.isFunction(F)&&F,duration:F,easing:E&&G||G&&!n.isFunction(G)&&G};D.duration=n.fx.off?0:typeof D.duration==="number"?D.duration:n.fx.speeds[D.duration]||n.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){n(this).dequeue()}if(n.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(F,G,D,E){return D+E*F},swing:function(F,G,D,E){return((-Math.cos(F*Math.PI)/2)+0.5)*E+D}},timers:[],timerId:null,fx:function(E,D,F){this.options=D;this.elem=E;this.prop=F;if(!D.orig){D.orig={}}}});n.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(n.fx.step[this.prop]||n.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(E){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var D=parseFloat(n.css(this.elem,this.prop,E));return D&&D>-10000?D:parseFloat(n.curCSS(this.elem,this.prop))||0},custom:function(H,G,F){this.startTime=e();this.start=H;this.end=G;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var D=this;function E(I){return D.step(I)}E.elem=this.elem;n.timers.push(E);if(E()&&n.timerId==null){n.timerId=setInterval(function(){var J=n.timers;for(var I=0;I<J.length;I++){if(!J[I]()){J.splice(I--,1)}}if(!J.length){clearInterval(n.timerId);n.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());n(this.elem).show()},hide:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(G){var F=e();if(G||F>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var D=true;for(var E in this.options.curAnim){if(this.options.curAnim[E]!==true){D=false}}if(D){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(n.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){n(this.elem).hide()}if(this.options.hide||this.options.show){for(var H in this.options.curAnim){n.attr(this.elem.style,H,this.options.orig[H])}}}if(D){this.options.complete.call(this.elem)}return false}else{var I=F-this.startTime;this.state=I/this.options.duration;this.pos=n.easing[this.options.easing||(n.easing.swing?"swing":"linear")](this.state,I,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};n.extend(n.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(D){n.attr(D.elem.style,"opacity",D.now)},_default:function(D){if(D.elem.style&&D.elem.style[D.prop]!=null){D.elem.style[D.prop]=D.now+D.unit}else{D.elem[D.prop]=D.now}}}});if(document.documentElement.getBoundingClientRect){n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}var F=this[0].getBoundingClientRect(),I=this[0].ownerDocument,E=I.body,D=I.documentElement,K=D.clientTop||E.clientTop||0,J=D.clientLeft||E.clientLeft||0,H=F.top+(self.pageYOffset||n.boxModel&&D.scrollTop||E.scrollTop)-K,G=F.left+(self.pageXOffset||n.boxModel&&D.scrollLeft||E.scrollLeft)-J;return{top:H,left:G}}}else{n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}n.offset.initialized||n.offset.initialize();var I=this[0],F=I.offsetParent,E=I,N=I.ownerDocument,L,G=N.documentElement,J=N.body,K=N.defaultView,D=K.getComputedStyle(I,null),M=I.offsetTop,H=I.offsetLeft;while((I=I.parentNode)&&I!==J&&I!==G){L=K.getComputedStyle(I,null);M-=I.scrollTop,H-=I.scrollLeft;if(I===F){M+=I.offsetTop,H+=I.offsetLeft;if(n.offset.doesNotAddBorder&&!(n.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(I.tagName))){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}E=F,F=I.offsetParent}if(n.offset.subtractsBorderForOverflowNotVisible&&L.overflow!=="visible"){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}D=L}if(D.position==="relative"||D.position==="static"){M+=J.offsetTop,H+=J.offsetLeft}if(D.position==="fixed"){M+=Math.max(G.scrollTop,J.scrollTop),H+=Math.max(G.scrollLeft,J.scrollLeft)}return{top:M,left:H}}}n.offset={initialize:function(){if(this.initialized){return}var K=document.body,E=document.createElement("div"),G,F,M,H,L,D,I=K.style.marginTop,J='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';L={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(D in L){E.style[D]=L[D]}E.innerHTML=J;K.insertBefore(E,K.firstChild);G=E.firstChild,F=G.firstChild,H=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(F.offsetTop!==5);this.doesAddBorderForTableAndCells=(H.offsetTop===5);G.style.overflow="hidden",G.style.position="relative";this.subtractsBorderForOverflowNotVisible=(F.offsetTop===-5);K.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(K.offsetTop===0);K.style.marginTop=I;K.removeChild(E);this.initialized=true},bodyOffset:function(D){n.offset.initialized||n.offset.initialize();var F=D.offsetTop,E=D.offsetLeft;if(n.offset.doesNotIncludeMarginInBodyOffset){F+=parseInt(n.curCSS(D,"marginTop",true),10)||0,E+=parseInt(n.curCSS(D,"marginLeft",true),10)||0}return{top:F,left:E}}};n.fn.extend({position:function(){var H=0,G=0,E;if(this[0]){var F=this.offsetParent(),I=this.offset(),D=/^body|html$/i.test(F[0].tagName)?{top:0,left:0}:F.offset();I.top-=j(this,"marginTop");I.left-=j(this,"marginLeft");D.top+=j(F,"borderTopWidth");D.left+=j(F,"borderLeftWidth");E={top:I.top-D.top,left:I.left-D.left}}return E},offsetParent:function(){var D=this[0].offsetParent||document.body;while(D&&(!/^body|html$/i.test(D.tagName)&&n.css(D,"position")=="static")){D=D.offsetParent}return n(D)}});n.each(["Left","Top"],function(E,D){var F="scroll"+D;n.fn[F]=function(G){if(!this[0]){return null}return G!==g?this.each(function(){this==l||this==document?l.scrollTo(!E?G:n(l).scrollLeft(),E?G:n(l).scrollTop()):this[F]=G}):this[0]==l||this[0]==document?self[E?"pageYOffset":"pageXOffset"]||n.boxModel&&document.documentElement[F]||document.body[F]:this[0][F]}});n.each(["Height","Width"],function(G,E){var D=G?"Left":"Top",F=G?"Right":"Bottom";n.fn["inner"+E]=function(){return this[E.toLowerCase()]()+j(this,"padding"+D)+j(this,"padding"+F)};n.fn["outer"+E]=function(I){return this["inner"+E]()+j(this,"border"+D+"Width")+j(this,"border"+F+"Width")+(I?j(this,"margin"+D)+j(this,"margin"+F):0)};var H=E.toLowerCase();n.fn[H]=function(I){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+E]||document.body["client"+E]:this[0]==document?Math.max(document.documentElement["client"+E],document.body["scroll"+E],document.documentElement["scroll"+E],document.body["offset"+E],document.documentElement["offset"+E]):I===g?(this.length?n.css(this[0],H):null):this.css(H,typeof I==="string"?I:I+"px")}})})();

/*
 *
 *  Ajax Autocomplete for jQuery, version 1.0.3
 *  (c) 2009 Tomas Kirda
 *
 *  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
 *  For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/
 *
 *  Last Review: 10:49 AM 3/13/2009
 *
 */

(function(jQuery) {

  jQuery.fn.autocomplete = function(options) {
    return this.each(function() {
      return new Autocomplete(this, options);
    });
  };

  var Autocomplete = function(el, options) {
    this.el = jQuery(el);
    this.id = this.el.attr('id');
    this.el.attr('autocomplete', 'off');
    this.suggestions = [];
    this.data = [];
    this.badQueries = [];
    this.selectedIndex = -1;
    this.currentValue = this.el.val();
    this.intervalId = 0;
    this.cachedResponse = [];
    this.onChangeInterval = null;
    this.ignoreValueChange = false;
    this.serviceUrl = options.serviceUrl;
    this.options = {
      autoSubmit: false,
      minChars: 1,
      maxHeight: 300,
      deferRequestBy: 0,
      width: 0
    };
    if (options) { jQuery.extend(this.options, options); }
    this.initialize();
  };

  Autocomplete.isArray = function(obj) { return obj && obj.constructor === Array; };

  Autocomplete.highlight = function(value, re) {
    return value.replace(re, function(match) { return '<strong>' + match + '<\/strong>'; });
  };

  Autocomplete.prototype = {

    killerFn: null,

    initialize: function() {

      var me = this;

      this.killerFn = function(e) {
        if (jQuery(e.target).parents('.autocomplete').size() === 0) {
          me.killSuggestions();
          me.disableKillerFn();
        }
      };

      var uid = new Date().getTime()
      var autocompleteElId = 'Autocomplete_' + uid;

      if (!this.options.width) { this.options.width = this.el.width(); }
      this.mainContainerId = 'AutocompleteContainter_' + uid;

      jQuery('<div id="' + this.mainContainerId + '" style="position:absolute; z-index: 1000;"><div class="autocomplete-w1"><div class="autocomplete-w2"><div class="autocomplete" id="' + autocompleteElId + '" style="display:none; width:' + this.options.width + 'px;"></div></div></div></div>').appendTo('body');

      this.container = jQuery('#' + autocompleteElId);
      this.fixPosition();
      if (window.opera) {
        this.el.keypress(function(e) { me.onKeyPress(e); });
      } else {
        this.el.keydown(function(e) { me.onKeyPress(e); });
      }
      this.el.keyup(function(e) { me.onKeyUp(e); });
      this.el.blur(function() { me.enableKillerFn(); });
      this.el.focus(function() { me.fixPosition(); });

      this.container.css({ maxHeight: this.options.maxHeight + 'px' });
    },

    fixPosition: function() {
      var offset = this.el.offset();
      jQuery('#' + this.mainContainerId).css({ top: (offset.top + this.el.height()) + 'px', left: offset.left + 'px' });
    },

    enableKillerFn: function() {
      var me = this;
      jQuery(document).bind('click', me.killerFn);
    },

    disableKillerFn: function() {
      var me = this;
      jQuery(document).unbind('click', me.killerFn);
    },

    killSuggestions: function() {
      var me = this;
      this.stopKillSuggestions();
      this.intervalId = window.setInterval(function() { me.hide(); me.stopKillSuggestions(); }, 300);
    },

    stopKillSuggestions: function() {
      window.clearInterval(this.intervalId);
    },

    onKeyPress: function(e) {
      if (!this.enabled) { return; }
      // return will exit the function
      // and event will not fire
      switch (e.keyCode) {
        case 27: //Event.KEY_ESC:
          this.el.val(this.currentValue);
          this.hide();
          break;
        case 9: //Event.KEY_TAB:
        case 13: //Event.KEY_RETURN:
          if (this.selectedIndex === -1) {
            this.hide();
            return;
          }
          this.select(this.selectedIndex);
          if (e.keyCode === 9/* Event.KEY_TAB */) { return; }
          break;
        case 38: //Event.KEY_UP:
          this.moveUp();
          break;
        case 40: //Event.KEY_DOWN:
          this.moveDown();
          break;
        default:
          return;
      }
      e.stopImmediatePropagation();
      e.preventDefault();
    },

    onKeyUp: function(e) {
      switch (e.keyCode) {
        case 38: //Event.KEY_UP:
        case 40: //Event.KEY_DOWN:
          return;
      }
      clearInterval(this.onChangeInterval);
      if (this.currentValue !== this.el.val()) {
        if (this.options.deferRequestBy > 0) {
          // Defer lookup in case when value changes very quickly:
          this.onChangeInterval = setInterval((function() {
            this.onValueChange();
          }).bind(this), this.options.deferRequestBy);
        } else {
          this.onValueChange();
        }
      }
    },

    onValueChange: function() {
      clearInterval(this.onChangeInterval);
      this.currentValue = this.el.val();
      this.selectedIndex = -1;
      if (this.ignoreValueChange) {
        this.ignoreValueChange = false;
        return;
      }
      if (this.currentValue === '' || this.currentValue.length < this.options.minChars) {
        this.hide();
      } else {
        this.getSuggestions();
      }
    },

    getSuggestions: function() {
      var cr = this.cachedResponse[this.currentValue];
      if (cr && Autocomplete.isArray(cr.suggestions)) {
        this.suggestions = cr.suggestions;
        this.data = cr.data;
        this.suggest();
      } else if (!this.isBadQuery(this.currentValue)) {
        var me = this;
        jQuery.get(this.serviceUrl, { query: this.currentValue }, function(json) { me.processResponse(json); }, 'json');
      }
    },

    isBadQuery: function(q) {
      var i = this.badQueries.length;
      while (i--) {
        if (q.indexOf(this.badQueries[i]) === 0) { return true; }
      }
      return false;
    },

    hide: function() {
      this.enabled = false;
      this.selectedIndex = -1;
      this.container.hide();
    },

    suggest: function() {
	  var suggestions = Array();
	  for(var i = 0; i < this.suggestions.length; i++) {
		if(this.suggestions[i] != '') {
			suggestions.push(this.suggestions[i]);
		}
	  }
	  
	  this.suggestions = suggestions;
	
      if (this.suggestions.length === 0) {
        this.hide();
        return;
      }

      var re = new RegExp('\\b' + this.currentValue.match(/\w+/g).join('|\\b'), 'gi');
      var me = this;
      var len = this.suggestions.length;
      var div;
      this.container.html('');
      for (var i = 0; i < len; i++) {
        div = jQuery((me.selectedIndex === i ? '<div class="selected"' : '<div') + ' id="AC_'+me.suggestions[i]+'" title="' + me.suggestions[i] + '">' + Autocomplete.highlight(me.suggestions[i], re) + '</div>');
        div.mouseover((function(xi) { return function() { me.activate(xi); }; })(i));
        div.click((function(xi) { return function() { me.select(xi); }; })(i));
        //console.log(div);
        this.container.append(div);
      }
      this.enabled = true;
      this.container.show();
    },

    processResponse: function(json) {
      var response;
      try {
        response = json;
        if (!Autocomplete.isArray(response.data)) { response.data = []; }
      } catch (err) { return; }
      this.suggestions = response.suggestions;
      this.data = response.data;
      this.cachedResponse[response.query] = response;
      if (response.suggestions.length === 0) { this.badQueries.push(response.query); }
      if (response.query === this.currentValue) { this.suggest(); }
    },

    activate: function(index) {
      var divs = this.container.children();
      var activeItem;
      // Clear previous selection:
      if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {
        jQuery(divs.get(this.selectedIndex)).attr('class', '');
      }
      this.selectedIndex = index;
      if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {
        activeItem = divs.get(this.selectedIndex);
        jQuery(activeItem).attr('class', 'selected');
      }
      return activeItem;
    },

    deactivate: function(div, index) {
      div.className = '';
      if (this.selectedIndex === index) { this.selectedIndex = -1; }
    },

    select: function(i) {
      var selectedValue = this.suggestions[i];
      if (selectedValue) {
        this.el.val(selectedValue);
        if (this.options.autoSubmit) {
          var f = this.el.parents('form');
          if (f.length > 0) { f.get(0).submit(); }
        }
        this.ignoreValueChange = true;
        this.hide();
        this.onSelect(i);
      }
    },

    moveUp: function() {
      if (this.selectedIndex === -1) { return; }
      if (this.selectedIndex === 0) {
        this.container.children().get(0).className = '';
        this.selectedIndex = -1;
        this.el.val(this.currentValue);
        return;
      }
      this.adjustScroll(this.selectedIndex - 1);
    },

    moveDown: function() {
      if (this.selectedIndex === (this.suggestions.length - 1)) { return; }
      this.adjustScroll(this.selectedIndex + 1);
    },

    adjustScroll: function(i) {
      var activeItem = this.activate(i);
      var offsetTop = activeItem.offsetTop;
      var upperBound = this.container.scrollTop();
      var lowerBound = upperBound + this.options.maxHeight - 25;
      if (offsetTop < upperBound) {
        this.container.scrollTop(offsetTop);
      } else if (offsetTop > lowerBound) {
        this.container.scrollTop(offsetTop - this.options.maxHeight + 25);
      }
      this.el.val(this.suggestions[i]);
    },

    onSelect: function(i) {
      (this.options.onSelect || function() { })(this.suggestions[i], this.data[i]);
    }

  };

})(jQuery);


/*!
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2009 M. Alsup
 * Version: 2.51 (16-FEB-2009)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.3 or later
 *
 * Originally based on the work of:
 *	1) Matt Oakes (http://portfolio.gizone.co.uk/applications/slideshow/)
 *	2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/)
 *	3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/)
 */
;(function(jQuery) {

var ver = '2.51';

// if jQuery.support is not defined (pre jQuery 1.3) add what I need
if (jQuery.support == undefined) {
	jQuery.support = {
		opacity: !(jQuery.browser.msie && /MSIE 6.0/.test(navigator.userAgent))
	};
}

function log() {
	if (window.console && window.console.log)
		window.console.log('[cycle] ' + Array.prototype.join.call(arguments,''));
};

jQuery.fn.cycle = function(options) {
	if (this.length == 0) {
		// is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_jQuery(document).ready()
		log('terminating; zero elements found by selector' + (jQuery.isReady ? '' : ' (DOM not ready)'));
		return this;
	}

	var opt2 = arguments[1];
	return this.each(function() {
		if (this.cycleStop == undefined)
			this.cycleStop = 0;
		if (options === undefined || options === null)
			options = {};
		if (options.constructor == String) {
			switch(options) {
			case 'stop':
				this.cycleStop++; // callbacks look for change
				if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
				this.cycleTimeout = 0;
				jQuery(this).removeData('cycle.opts');
				return;
			case 'pause':
				this.cyclePause = 1;
				return;
			case 'resume':
				this.cyclePause = 0;
				if (opt2 === true) { // resume now!
					options = jQuery(this).data('cycle.opts');
					if (!options) {
						log('options not found, can not resume');
						return;
					}
					if (this.cycleTimeout) {
						clearTimeout(this.cycleTimeout);
						this.cycleTimeout = 0;
					}			 
					go(options.elements, options, 1, 1);
				}
				return;
			default:
				options = { fx: options };
			};
		}
		else if (options.constructor == Number) {
			// go to the requested slide
			var num = options;
			options = jQuery(this).data('cycle.opts');
			if (!options) {
				log('options not found, can not advance slide');
				return;
			}
			if (num < 0 || num >= options.elements.length) {
				log('invalid slide index: ' + num);
				return;
			}
			options.nextSlide = num;
			if (this.cycleTimeout) {
				clearTimeout(this.cycleTimeout);
				this.cycleTimeout = 0;
			}			 
			go(options.elements, options, 1, num >= options.currSlide);
			return;
		}

		// stop existing slideshow for this container (if there is one)
		if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
		this.cycleTimeout = 0;
		this.cyclePause = 0;
		
		var jQuerycont = jQuery(this);
		var jQueryslides = options.slideExpr ? jQuery(options.slideExpr, this) : jQuerycont.children();
		var els = jQueryslides.get();
		if (els.length < 2) {
			log('terminating; too few slides: ' + els.length);
			return; // don't bother
		}

		// support metadata plugin (v1.0 and v2.0)
		var opts = jQuery.extend({}, jQuery.fn.cycle.defaults, options || {}, jQuery.metadata ? jQuerycont.metadata() : jQuery.meta ? jQuerycont.data() : {});
		if (opts.autostop) 
			opts.countdown = opts.autostopCount || els.length;

		jQuerycont.data('cycle.opts', opts);
		opts.container = this;
		opts.stopCount = this.cycleStop;

		opts.elements = els;
		opts.before = opts.before ? [opts.before] : [];
		opts.after = opts.after ? [opts.after] : [];
		opts.after.unshift(function(){ opts.busy=0; });
		if (opts.continuous)
			opts.after.push(function() { go(els,opts,0,!opts.rev); });
		opts.originalBefore = opts.before;
		opts.originalAfter = opts.after;
			
		// clearType corrections
		if (!jQuery.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
			clearTypeFix(jQueryslides);

		// allow shorthand overrides of width, height and timeout
		var cls = this.className;
		opts.width = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width;
		opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height;
		opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout;

		if (jQuerycont.css('position') == 'static') 
			jQuerycont.css('position', 'relative');
		if (opts.width) 
			jQuerycont.width(opts.width);
		if (opts.height && opts.height != 'auto') 
			jQuerycont.height(opts.height);

		if (opts.startingSlide) opts.startingSlide = parseInt(opts.startingSlide);	
			
		if (opts.random) {
			opts.randomMap = [];
			for (var i = 0; i < els.length; i++) 
				opts.randomMap.push(i);
			opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;});
			opts.randomIndex = 0;
			opts.startingSlide = opts.randomMap[0];
		}
		else if (opts.startingSlide >= els.length)
			opts.startingSlide = 0; // catch bogus input
		opts.currSlide = opts.startingSlide = opts.startingSlide || 0;
		var first = opts.startingSlide;
		jQueryslides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { 
			var z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i;
			jQuery(this).css('z-index', z) 
		});
		
		jQuery(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case
		if (jQuery.browser.msie) els[first].style.removeAttribute('filter');

		if (opts.fit && opts.width) 
			jQueryslides.width(opts.width);
		if (opts.fit && opts.height && opts.height != 'auto') 
			jQueryslides.height(opts.height);
			
		var reshape = opts.containerResize && !jQuerycont.innerHeight();
		if (reshape) { // apply this logic only if container has no size http://tinyurl.com/da2oa9
			var maxw = 0, maxh = 0;
			for(var i=0; i < els.length; i++) {
				var jQuerye = jQuery(els[i]), w = jQuerye.outerWidth(), h = jQuerye.outerHeight();
				maxw = w > maxw ? w : maxw;
				maxh = h > maxh ? h : maxh;
			}
			jQuerycont.css({width:maxw+'px',height:maxh+'px'});
		}
		
		if (opts.pause) 
			jQuerycont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});

		var txs = jQuery.fn.cycle.transitions;
		// look for multiple effects
		if (opts.fx.indexOf(',') > 0) {
			opts.multiFx = true;
			opts.fxs = opts.fx.replace(/\s*/g,'').split(',');
			// discard any bogus effect names
			for (var i=0; i < opts.fxs.length; i++) {
				var fx = opts.fxs[i];
				var tx = txs[fx];
				if (!tx || !txs.hasOwnProperty(fx) || !jQuery.isFunction(tx)) {
					log('discarding unknowtn transition: ',fx);
					opts.fxs.splice(i,1);
					i--;
				}
			}
			// if we have an empty list then we threw everything away!
			if (!opts.fxs.length) {
				log('No valid transitions named; slideshow terminating.');
				return;
			}
		}
		else if (opts.fx == 'all') {  // auto-gen the list of transitions
			opts.multiFx = true;
			opts.fxs = [];
			for (p in txs) {
				var tx = txs[p];
				if (txs.hasOwnProperty(p) && jQuery.isFunction(tx))
					opts.fxs.push(p);
			}
		}
		if (opts.multiFx && opts.randomizeEffects) {
			// munge the fx list to make effect selection random
			var r1 = Math.floor(Math.random() * 20) + 20;
			for (var i = 0; i < r1; i++) {
				var r2 = Math.floor(Math.random() * opts.fxs.length);
				opts.fxs.push(opts.fxs.splice(r2,1)[0]);
			}
			log('randomized fx sequence: ',opts.fxs);
		}

		// run transition init fn
		if (!opts.multiFx) {
			var init = txs[opts.fx];
			if (jQuery.isFunction(init)) 
				init(jQuerycont, jQueryslides, opts);
			else if (opts.fx != 'custom' && !opts.multiFx) {
				log('unknown transition: ' + opts.fx,'; slideshow terminating');
				return;
			}
		}				
		jQueryslides.each(function() {
			var jQueryel = jQuery(this);
			this.cycleH = (opts.fit && opts.height) ? opts.height : jQueryel.height();
			this.cycleW = (opts.fit && opts.width) ? opts.width : jQueryel.width();
		});

		opts.cssBefore = opts.cssBefore || {};
		opts.animIn = opts.animIn || {};
		opts.animOut = opts.animOut || {};

		jQueryslides.not(':eq('+first+')').css(opts.cssBefore);
		if (opts.cssFirst)
			jQuery(jQueryslides[first]).css(opts.cssFirst);

		if (opts.timeout) {
			opts.timeout = parseInt(opts.timeout);
			// ensure that timeout and speed settings are sane
			if (opts.speed.constructor == String)
				opts.speed = jQuery.fx.speeds[opts.speed] || parseInt(opts.speed);
			if (!opts.sync)
				opts.speed = opts.speed / 2;
			while((opts.timeout - opts.speed) < 250)
				opts.timeout += opts.speed;
		}
		if (opts.easing) 
			opts.easeIn = opts.easeOut = opts.easing;
		if (!opts.speedIn) 
			opts.speedIn = opts.speed;
		if (!opts.speedOut) 
			opts.speedOut = opts.speed;

		opts.slideCount = els.length;
		opts.currSlide = opts.lastSlide = first;
		if (opts.random) {
			opts.nextSlide = opts.currSlide;
			if (++opts.randomIndex == els.length) 
				opts.randomIndex = 0;
			opts.nextSlide = opts.randomMap[opts.randomIndex];
		}
		else
			opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1;

		// fire artificial events
		var e0 = jQueryslides[first];
		if (opts.before.length)
			opts.before[0].apply(e0, [e0, e0, opts, true]);
		if (opts.after.length > 1)
			opts.after[1].apply(e0, [e0, e0, opts, true]);
		
		if (opts.click && !opts.next)
			opts.next = opts.click;
		if (opts.next)
			jQuery(opts.next).bind('click', function(){return advance(els,opts,opts.rev?-1:1)});
		if (opts.prev)
			jQuery(opts.prev).bind('click', function(){return advance(els,opts,opts.rev?1:-1)});
		if (opts.pager)
			buildPager(els,opts);

		// expose fn for adding slides after the show has started
		opts.addSlide = function(newSlide, prepend) {
			var jQuerys = jQuery(newSlide), s = jQuerys[0];
			if (!opts.autostopCount)
				opts.countdown++;
			els[prepend?'unshift':'push'](s);
			if (opts.els)
				opts.els[prepend?'unshift':'push'](s); // shuffle needs this
			opts.slideCount = els.length;
			
			jQuerys.css('position','absolute');
			jQuerys[prepend?'prependTo':'appendTo'](jQuerycont);
			
			if (prepend) {
				opts.currSlide++;
				opts.nextSlide++;
			}
			
			if (!jQuery.support.opacity && opts.cleartype && !opts.cleartypeNoBg)
				clearTypeFix(jQuerys);

			if (opts.fit && opts.width) 
				jQuerys.width(opts.width);
			if (opts.fit && opts.height && opts.height != 'auto') 
				jQueryslides.height(opts.height);
			s.cycleH = (opts.fit && opts.height) ? opts.height : jQuerys.height();
			s.cycleW = (opts.fit && opts.width) ? opts.width : jQuerys.width();

			jQuerys.css(opts.cssBefore);

			if (opts.pager)
				jQuery.fn.cycle.createPagerAnchor(els.length-1, s, jQuery(opts.pager), els, opts);
			
			if (typeof opts.onAddSlide == 'function')
				opts.onAddSlide(jQuerys);
			else
				jQuerys.hide(); // default behavior
		};

		if (opts.timeout || opts.continuous)
			this.cycleTimeout = setTimeout(
				function(){go(els,opts,0,!opts.rev)}, 
				opts.continuous ? 10 : opts.timeout + (opts.delay||0));
	});
};

function go(els, opts, manual, fwd) {
	if (manual && opts.busy) {
		jQuery(els).stop(true,true);
		opts.busy = false;
	}
	if (opts.busy) return;
	var p = opts.container, curr = els[opts.currSlide], next = els[opts.nextSlide];
	if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) 
		return;

	if (!manual && !p.cyclePause && 
		((opts.autostop && (--opts.countdown <= 0)) ||
		(opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) {
		if (opts.end)
			opts.end(opts);
		return;
	}

	if (manual || !p.cyclePause) {
		// keep trying to get the size if we don't have it yet
		curr.cycleH = curr.cycleH || curr.offsetHeight;
		curr.cycleW = curr.cycleW || curr.offsetWidth;
		next.cycleH = next.cycleH || next.offsetHeight;
		next.cycleW = next.cycleW || next.offsetWidth;
		
		// support multiple transition types
		if (opts.multiFx) {
			if (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length) 
				opts.lastFx = 0;
			var fx = opts.fxs[opts.lastFx];
			opts.currFx = fx;
			
			// reset state!
			opts.before = []; opts.after = [];
			opts.cssBefore = {}; opts.cssAfter = {}; opts.animIn = {}; opts.animOut = {};
			opts.fxFn = null;
			jQuery.each(opts.originalBefore, function() { opts.before.push(this); });
			jQuery.each(opts.originalAfter,  function() { opts.after.push(this); });
			
			// re-init
			var init = jQuery.fn.cycle.transitions[fx];
			if (jQuery.isFunction(init))
				init(jQuery(opts.container), jQuery(opts.elements), opts);
		}
		
		if (opts.before.length)
			jQuery.each(opts.before, function(i,o) { 
				if (p.cycleStop != opts.stopCount) return;
				o.apply(next, [curr, next, opts, fwd]); 
			});
		var after = function() {
			if (jQuery.browser.msie && opts.cleartype)
				this.style.removeAttribute('filter');
			jQuery.each(opts.after, function(i,o) { 
				if (p.cycleStop != opts.stopCount) return;
				o.apply(next, [curr, next, opts, fwd]); 
			});
		};

		if (opts.nextSlide != opts.currSlide) {
			opts.busy = 1;
			if (opts.fxFn)
				opts.fxFn(curr, next, opts, after, fwd);
			else if (jQuery.isFunction(jQuery.fn.cycle[opts.fx]))
				jQuery.fn.cycle[opts.fx](curr, next, opts, after);
			else
				jQuery.fn.cycle.custom(curr, next, opts, after, manual && opts.fastOnEvent);
		}
		opts.lastSlide = opts.currSlide;
		if (opts.random) {
			opts.currSlide = opts.nextSlide;
			if (++opts.randomIndex == els.length) 
				opts.randomIndex = 0;
			opts.nextSlide = opts.randomMap[opts.randomIndex];
		}
		else { // sequence
			var roll = (opts.nextSlide + 1) == els.length;
			opts.nextSlide = roll ? 0 : opts.nextSlide+1;
			opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
		}
		if (opts.pager)
			jQuery.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide);
	}
	if (opts.timeout && !opts.continuous)
		p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, getTimeout(curr,next,opts,fwd));
	else if (opts.continuous && p.cyclePause) 
		p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, 10);
};

jQuery.fn.cycle.updateActivePagerLink = function(pager, currSlide) {
	jQuery(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide');
};

function getTimeout(curr, next, opts, fwd) {
	if (opts.timeoutFn) {
		var t = opts.timeoutFn(curr,next,opts,fwd);
		if (t !== false)
			return t;
	}
	return opts.timeout;
};

// advance slide forward or back
function advance(els, opts, val) {
	var p = opts.container, timeout = p.cycleTimeout;
	if (timeout) {
		clearTimeout(timeout);
		p.cycleTimeout = 0;
	}
	if (opts.random && val < 0) {
		// move back to the previously display slide
		opts.randomIndex--;
		if (--opts.randomIndex == -2)
			opts.randomIndex = els.length-2;
		else if (opts.randomIndex == -1)
			opts.randomIndex = els.length-1;
		opts.nextSlide = opts.randomMap[opts.randomIndex];
	}
	else if (opts.random) {
		if (++opts.randomIndex == els.length) 
			opts.randomIndex = 0;
		opts.nextSlide = opts.randomMap[opts.randomIndex];
	}
	else {
		opts.nextSlide = opts.currSlide + val;
		if (opts.nextSlide < 0) {
			if (opts.nowrap) return false;
			opts.nextSlide = els.length - 1;
		}
		else if (opts.nextSlide >= els.length) {
			if (opts.nowrap) return false;
			opts.nextSlide = 0;
		}
	}
	
	if (opts.prevNextClick && typeof opts.prevNextClick == 'function')
		opts.prevNextClick(val > 0, opts.nextSlide, els[opts.nextSlide]);
	go(els, opts, 1, val>=0);
	return false;
};

function buildPager(els, opts) {
	var jQueryp = jQuery(opts.pager);
	jQuery.each(els, function(i,o) {
		jQuery.fn.cycle.createPagerAnchor(i,o,jQueryp,els,opts);
	});
   jQuery.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide);
};

jQuery.fn.cycle.createPagerAnchor = function(i, el, jQueryp, els, opts) {
	var a = (typeof opts.pagerAnchorBuilder == 'function')
		? opts.pagerAnchorBuilder(i,el)
		: '<a href="#">'+(i+1)+'</a>';
	
	if (!a)
		return;
	
	var jQuerya = jQuery(a);
	
	// don't reparent if anchor is in the dom
	if (jQuerya.parents('body').length == 0)
		jQuerya.appendTo(jQueryp);
		
	jQuerya.bind(opts.pagerEvent, function() {
		opts.nextSlide = i;
		var p = opts.container, timeout = p.cycleTimeout;
		if (timeout) {
			clearTimeout(timeout);
			p.cycleTimeout = 0;
		}			 
		if (typeof opts.pagerClick == 'function')
			opts.pagerClick(opts.nextSlide, els[opts.nextSlide]);
		go(els,opts,1,opts.currSlide < i);
		return false;
	});
	if (opts.pauseOnPagerHover)
		jQuerya.hover(function() { opts.container.cyclePause++; }, function() { opts.container.cyclePause--; } );
};

// helper fn to calculate the number of slides between the current and the next
jQuery.fn.cycle.hopsFromLast = function(opts, fwd) {
	var hops, l = opts.lastSlide, c = opts.currSlide;
	if (fwd)
		hops = c > l ? c - l : opts.slideCount - l;
	else
		hops = c < l ? l - c : l + opts.slideCount - c;
	return hops;
};

// this fixes clearType problems in ie6 by setting an explicit bg color
function clearTypeFix(jQueryslides) {
	function hex(s) {
		var s = parseInt(s).toString(16);
		return s.length < 2 ? '0'+s : s;
	};
	function getBg(e) {
		for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) {
			var v = jQuery.css(e,'background-color');
			if (v.indexOf('rgb') >= 0 ) { 
				var rgb = v.match(/\d+/g); 
				return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]);
			}
			if (v && v != 'transparent')
				return v;
		}
		return '#ffffff';
	};
	jQueryslides.each(function() { jQuery(this).css('background-color', getBg(this)); });
};

jQuery.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
	jQuery(opts.elements).not(curr).hide();
	opts.cssBefore.opacity = 1; 
	opts.cssBefore.display = 'block';
	if (w !== false)
		opts.cssBefore.width = next.cycleW;
	if (h !== false)
		opts.cssBefore.height = next.cycleH;
	opts.cssAfter = opts.cssAfter || {};
	opts.cssAfter.display = 'none';
	jQuery(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0));
	jQuery(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1));
};

jQuery.fn.cycle.custom = function(curr, next, opts, cb, speedOverride) {
	var jQueryl = jQuery(curr), jQueryn = jQuery(next);
	jQueryn.css(opts.cssBefore);
	
	var speedIn = opts.speedIn;
	var speedOut = opts.speedOut;
	var easeIn = opts.easeIn;
	var easeOut = opts.easeOut;
	
	if (speedOverride) {
		if (typeof speedOverride == 'number')
			speedIn = speedOut = speedOverride;
		else
			speedIn = speedOut = 1;
		easeIn = easeOut = null;
	}

	var fn = function() {jQueryn.animate(opts.animIn, speedIn, easeIn, cb)};
	jQueryl.animate(opts.animOut, speedOut, easeOut, function() {
		if (opts.cssAfter) jQueryl.css(opts.cssAfter);
		if (!opts.sync) fn();
	});
	if (opts.sync) fn();
};

jQuery.fn.cycle.transitions = {
	fade: function(jQuerycont, jQueryslides, opts) {
		jQueryslides.not(':eq('+opts.currSlide+')').css('opacity',0);
		opts.before.push(function(curr,next,opts) { 
			jQuery.fn.cycle.commonReset(curr,next,opts);
			opts.cssBefore.opacity = 0; 
		});
		opts.animIn	   = { opacity: 1 };
		opts.animOut   = { opacity: 0 };
		opts.cssBefore = { top: 0, left: 0 };
	}
};

jQuery.fn.cycle.ver = function() { return ver; };

// override these globally if you like (they are all optional)
jQuery.fn.cycle.defaults = {
	fx:			  'fade', // name of transition effect (or comma separated names, ex: fade,scrollUp,shuffle) 
	timeout:	   4000,  // milliseconds between slide transitions (0 to disable auto advance)
	timeoutFn:     null,  // callback for determining per-slide timeout value:  function(currSlideElement, nextSlideElement, options, forwardFlag)
	continuous:	   0,	  // true to start next transition immediately after current one completes
	speed:		   1000,  // speed of the transition (any valid fx speed value)
	speedIn:	   null,  // speed of the 'in' transition
	speedOut:	   null,  // speed of the 'out' transition
	next:		   null,  // selector for element to use as click trigger for next slide
	prev:		   null,  // selector for element to use as click trigger for previous slide
	prevNextClick: null,  // callback fn for prev/next clicks:	function(isNext, zeroBasedSlideIndex, slideElement)
	pager:		   null,  // selector for element to use as pager container
	pagerClick:	   null,  // callback fn for pager clicks:	function(zeroBasedSlideIndex, slideElement)
	pagerEvent:	  'click', // name of event which drives the pager navigation
	pagerAnchorBuilder: null, // callback fn for building anchor links:  function(index, DOMelement)
	before:		   null,  // transition callback (scope set to element to be shown):     function(currSlideElement, nextSlideElement, options, forwardFlag)
	after:		   null,  // transition callback (scope set to element that was shown):  function(currSlideElement, nextSlideElement, options, forwardFlag)
	end:		   null,  // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options)
	easing:		   null,  // easing method for both in and out transitions
	easeIn:		   null,  // easing for "in" transition
	easeOut:	   null,  // easing for "out" transition
	shuffle:	   null,  // coords for shuffle animation, ex: { top:15, left: 200 }
	animIn:		   null,  // properties that define how the slide animates in
	animOut:	   null,  // properties that define how the slide animates out
	cssBefore:	   null,  // properties that define the initial state of the slide before transitioning in
	cssAfter:	   null,  // properties that defined the state of the slide after transitioning out
	fxFn:		   null,  // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag)
	height:		  'auto', // container height
	startingSlide: 0,	  // zero-based index of the first slide to be displayed
	sync:		   1,	  // true if in/out transitions should occur simultaneously
	random:		   0,	  // true for random, false for sequence (not applicable to shuffle fx)
	fit:		   0,	  // force slides to fit container
	containerResize: 1,	  // resize container to fit largest slide
	pause:		   0,	  // true to enable "pause on hover"
	pauseOnPagerHover: 0, // true to pause when hovering over pager link
	autostop:	   0,	  // true to end slideshow after X transitions (where X == slide count)
	autostopCount: 0,	  // number of transitions (optionally used with autostop to define X)
	delay:		   0,	  // additional delay (in ms) for first transition (hint: can be negative)
	slideExpr:	   null,  // expression for selecting slides (if something other than all children is required)
	cleartype:	   0,	  // true if clearType corrections should be applied (for IE)
	nowrap:		   0,	  // true to prevent slideshow from wrapping
	fastOnEvent:   0,	  // force fast transitions when triggered manually (via pager or prev/next); value == time in ms
	randomizeEffects: 1   // valid when multiple effects are used; true to make the effect sequence random
};

})(jQuery);


/*!
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version:	 2.51
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(jQuery) {

//
// These functions define one-time slide initialization for the named
// transitions. To save file size feel free to remove any of these that you 
// don't need.
//

// scrollUp/Down/Left/Right
jQuery.fn.cycle.transitions.scrollUp = function(jQuerycont, jQueryslides, opts) {
	jQuerycont.css('overflow','hidden');
	opts.before.push(jQuery.fn.cycle.commonReset);
	var h = jQuerycont.height();
	opts.cssBefore ={ top: h, left: 0 };
	opts.cssFirst = { top: 0 };
	opts.animIn	  = { top: 0 };
	opts.animOut  = { top: -h };
};
jQuery.fn.cycle.transitions.scrollDown = function(jQuerycont, jQueryslides, opts) {
	jQuerycont.css('overflow','hidden');
	opts.before.push(jQuery.fn.cycle.commonReset);
	var h = jQuerycont.height();
	opts.cssFirst = { top: 0 };
	opts.cssBefore= { top: -h, left: 0 };
	opts.animIn	  = { top: 0 };
	opts.animOut  = { top: h };
};
jQuery.fn.cycle.transitions.scrollLeft = function(jQuerycont, jQueryslides, opts) {
	jQuerycont.css('overflow','hidden');
	opts.before.push(jQuery.fn.cycle.commonReset);
	var w = jQuerycont.width();
	opts.cssFirst = { left: 0 };
	opts.cssBefore= { left: w, top: 0 };
	opts.animIn	  = { left: 0 };
	opts.animOut  = { left: 0-w };
};
jQuery.fn.cycle.transitions.scrollRight = function(jQuerycont, jQueryslides, opts) {
	jQuerycont.css('overflow','hidden');
	opts.before.push(jQuery.fn.cycle.commonReset);
	var w = jQuerycont.width();
	opts.cssFirst = { left: 0 };
	opts.cssBefore= { left: -w, top: 0 };
	opts.animIn	  = { left: 0 };
	opts.animOut  = { left: w };
};
jQuery.fn.cycle.transitions.scrollHorz = function(jQuerycont, jQueryslides, opts) {
	jQuerycont.css('overflow','hidden').width();
	opts.before.push(function(curr, next, opts, fwd) {
		jQuery.fn.cycle.commonReset(curr,next,opts);
		opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW);
		opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW;
	});
	opts.cssFirst = { left: 0 };
	opts.cssBefore= { top: 0 };
	opts.animIn   = { left: 0 };
	opts.animOut  = { top: 0 };
};
jQuery.fn.cycle.transitions.scrollVert = function(jQuerycont, jQueryslides, opts) {
	jQuerycont.css('overflow','hidden');
	opts.before.push(function(curr, next, opts, fwd) {
		jQuery.fn.cycle.commonReset(curr,next,opts);
		opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1);
		opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH;
	});
	opts.cssFirst = { top: 0 };
	opts.cssBefore= { left: 0 };
	opts.animIn   = { top: 0 };
	opts.animOut  = { left: 0 };
};

// slideX/slideY
jQuery.fn.cycle.transitions.slideX = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery(opts.elements).not(curr).hide();
		jQuery.fn.cycle.commonReset(curr,next,opts,false,true);
		opts.animIn.width = next.cycleW;
	});
	opts.cssBefore = { left: 0, top: 0, width: 0 };
	opts.animIn	 = { width: 'show' };
	opts.animOut = { width: 0 };
};
jQuery.fn.cycle.transitions.slideY = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery(opts.elements).not(curr).hide();
		jQuery.fn.cycle.commonReset(curr,next,opts,true,false);
		opts.animIn.height = next.cycleH;
	});	   
	opts.cssBefore = { left: 0, top: 0, height: 0 };
	opts.animIn	 = { height: 'show' };
	opts.animOut = { height: 0 };
};

// shuffle
jQuery.fn.cycle.transitions.shuffle = function(jQuerycont, jQueryslides, opts) {
	var w = jQuerycont.css('overflow', 'visible').width();
	jQueryslides.css({left: 0, top: 0});
	opts.before.push(function(curr,next,opts) { 
		jQuery.fn.cycle.commonReset(curr,next,opts,true,true,true);
	});
	opts.speed = opts.speed / 2; // shuffle has 2 transitions		 
	opts.random = 0;
	opts.shuffle = opts.shuffle || {left:-w, top:15};
	opts.els = [];
	for (var i=0; i < jQueryslides.length; i++)
		opts.els.push(jQueryslides[i]);

	for (var i=0; i < opts.currSlide; i++)
		opts.els.push(opts.els.shift());

	// custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!)
	opts.fxFn = function(curr, next, opts, cb, fwd) {
		var jQueryel = fwd ? jQuery(curr) : jQuery(next);
		jQuery(next).css(opts.cssBefore);
		var count = opts.slideCount;
		jQueryel.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
			var hops = jQuery.fn.cycle.hopsFromLast(opts, fwd);
			for (var k=0; k < hops; k++)
				fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop());
			if (fwd) 
				for (var i=0, len=opts.els.length; i < len; i++)
					jQuery(opts.els[i]).css('z-index', len-i+count);
			else {
				var z = jQuery(curr).css('z-index');
				jQueryel.css('z-index', parseInt(z)+1+count);
			}
			jQueryel.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
				jQuery(fwd ? this : curr).hide();
				if (cb) cb();
			});
		});
	};
	opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
};

// turnUp/Down/Left/Right
jQuery.fn.cycle.transitions.turnUp = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,true,false);
		opts.cssBefore.top = next.cycleH;
		opts.animIn.height = next.cycleH;
	});
	opts.cssFirst  = { top: 0 };
	opts.cssBefore = { left: 0, height: 0 };
	opts.animIn	   = { top: 0 };
	opts.animOut   = { height: 0 };
};
jQuery.fn.cycle.transitions.turnDown = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,true,false);
		opts.animIn.height = next.cycleH;
		opts.animOut.top   = curr.cycleH;
	});
	opts.cssFirst  = { top: 0 };
	opts.cssBefore = { left: 0, top: 0, height: 0 };
	opts.animOut   = { height: 0 };
};
jQuery.fn.cycle.transitions.turnLeft = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,false,true);
		opts.cssBefore.left = next.cycleW;
		opts.animIn.width = next.cycleW;
	});
	opts.cssBefore = { top: 0, width: 0  };
	opts.animIn	   = { left: 0 };
	opts.animOut   = { width: 0 };
};
jQuery.fn.cycle.transitions.turnRight = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,false,true);
		opts.animIn.width = next.cycleW;
		opts.animOut.left = curr.cycleW;
	});
	opts.cssBefore = { top: 0, left: 0, width: 0 };
	opts.animIn	   = { left: 0 };
	opts.animOut   = { width: 0 };
};

// zoom
jQuery.fn.cycle.transitions.zoom = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,false,false,true);
		opts.cssBefore.top = next.cycleH/2;
		opts.cssBefore.left = next.cycleW/2;
		opts.animIn	   = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
		opts.animOut   = { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 };
	});	   
	opts.cssFirst = { top:0, left: 0 };
	opts.cssBefore = { width: 0, height: 0 };
};

// fadeZoom
jQuery.fn.cycle.transitions.fadeZoom = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,false,false);
		opts.cssBefore.left = next.cycleW/2;
		opts.cssBefore.top = next.cycleH/2;
		opts.animIn	= { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
	});	   
	opts.cssBefore = { width: 0, height: 0 };
	opts.animOut  = { opacity: 0 };
};

// blindX
jQuery.fn.cycle.transitions.blindX = function(jQuerycont, jQueryslides, opts) {
	var w = jQuerycont.css('overflow','hidden').width();
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts);
		opts.animIn.width = next.cycleW;
		opts.animOut.left   = curr.cycleW;
	});
	opts.cssBefore = { left: w, top: 0 };
	opts.animIn = { left: 0 };
	opts.animOut  = { left: w };
};
// blindY
jQuery.fn.cycle.transitions.blindY = function(jQuerycont, jQueryslides, opts) {
	var h = jQuerycont.css('overflow','hidden').height();
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts);
		opts.animIn.height = next.cycleH;
		opts.animOut.top   = curr.cycleH;
	});	   
	opts.cssBefore = { top: h, left: 0 };
	opts.animIn = { top: 0 };
	opts.animOut  = { top: h };
};
// blindZ
jQuery.fn.cycle.transitions.blindZ = function(jQuerycont, jQueryslides, opts) {
	var h = jQuerycont.css('overflow','hidden').height();
	var w = jQuerycont.width();
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts);
		opts.animIn.height = next.cycleH;
		opts.animOut.top   = curr.cycleH;
	});	   
	opts.cssBefore = { top: h, left: w };
	opts.animIn = { top: 0, left: 0 };
	opts.animOut  = { top: h, left: w };
};

// growX - grow horizontally from centered 0 width
jQuery.fn.cycle.transitions.growX = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,false,true);
		opts.cssBefore.left = this.cycleW/2;
		opts.animIn = { left: 0, width: this.cycleW };
		opts.animOut = { left: 0 };
	});	   
	opts.cssBefore = { width: 0, top: 0 };
};
// growY - grow vertically from centered 0 height
jQuery.fn.cycle.transitions.growY = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,true,false);
		opts.cssBefore.top = this.cycleH/2;
		opts.animIn = { top: 0, height: this.cycleH };
		opts.animOut = { top: 0 };
	});	   
	opts.cssBefore = { height: 0, left: 0 };
};

// curtainX - squeeze in both edges horizontally
jQuery.fn.cycle.transitions.curtainX = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,false,true);
		opts.cssBefore.left = next.cycleW/2;
		opts.animIn = { left: 0, width: this.cycleW };
		opts.animOut = { left: curr.cycleW/2, width: 0 };
	});	   
	opts.cssBefore = { top: 0, width: 0 };
};
// curtainY - squeeze in both edges vertically
jQuery.fn.cycle.transitions.curtainY = function(jQuerycont, jQueryslides, opts) {
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,true,false);
		opts.cssBefore.top = next.cycleH/2;
		opts.animIn = { top: 0, height: next.cycleH };
		opts.animOut = { top: curr.cycleH/2, height: 0 };
	});	   
	opts.cssBefore = { left: 0, height: 0 };
};

// cover - curr slide covered by next slide
jQuery.fn.cycle.transitions.cover = function(jQuerycont, jQueryslides, opts) {
	var d = opts.direction || 'left';
	var w = jQuerycont.css('overflow','hidden').width();
	var h = jQuerycont.height();
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts);
		if (d == 'right') 
			opts.cssBefore.left = -w;
		else if (d == 'up')	   
			opts.cssBefore.top = h;
		else if (d == 'down')  
			opts.cssBefore.top = -h;
		else
			opts.cssBefore.left = w;
	});
	opts.animIn = { left: 0, top: 0};
	opts.animOut = { opacity: 1 };
	opts.cssBefore = { top: 0, left: 0 };
};

// uncover - curr slide moves off next slide
jQuery.fn.cycle.transitions.uncover = function(jQuerycont, jQueryslides, opts) {
	var d = opts.direction || 'left';
	var w = jQuerycont.css('overflow','hidden').width();
	var h = jQuerycont.height();
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,true,true,true);
		if (d == 'right') 
			opts.animOut.left = w;
		else if (d == 'up')	   
			opts.animOut.top = -h;
		else if (d == 'down')  
			opts.animOut.top = h;
		else
			opts.animOut.left = -w;
	});	   
	opts.animIn = { left: 0, top: 0 };
	opts.animOut = { opacity: 1 };
	opts.cssBefore = { top: 0, left: 0 };
};

// toss - move top slide and fade away
jQuery.fn.cycle.transitions.toss = function(jQuerycont, jQueryslides, opts) {
	var w = jQuerycont.css('overflow','visible').width();
	var h = jQuerycont.height();
	opts.before.push(function(curr, next, opts) {
		jQuery.fn.cycle.commonReset(curr,next,opts,true,true,true);
		// provide default toss settings if animOut not provided
		if (!opts.animOut.left && !opts.animOut.top)
			opts.animOut = { left: w*2, top: -h/2, opacity: 0 };
		else
			opts.animOut.opacity = 0;
	});	   
	opts.cssBefore = { left: 0, top: 0 };
	opts.animIn = { left: 0 };
};

// wipe - clip animation
jQuery.fn.cycle.transitions.wipe = function(jQuerycont, jQueryslides, opts) {
	var w = jQuerycont.css('overflow','hidden').width();
	var h = jQuerycont.height();
	opts.cssBefore = opts.cssBefore || {};
	var clip;
	if (opts.clip) {
		if (/l2r/.test(opts.clip))
			clip = 'rect(0px 0px '+h+'px 0px)';
		else if (/r2l/.test(opts.clip))
			clip = 'rect(0px '+w+'px '+h+'px '+w+'px)';
		else if (/t2b/.test(opts.clip))
			clip = 'rect(0px '+w+'px 0px 0px)';
		else if (/b2t/.test(opts.clip))
			clip = 'rect('+h+'px '+w+'px '+h+'px 0px)';
		else if (/zoom/.test(opts.clip)) {
			var t = parseInt(h/2);
			var l = parseInt(w/2);
			clip = 'rect('+t+'px '+l+'px '+t+'px '+l+'px)';
		}
	}
	
	opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)';
	
	var d = opts.cssBefore.clip.match(/(\d+)/g);
	var t = parseInt(d[0]), r = parseInt(d[1]), b = parseInt(d[2]), l = parseInt(d[3]);
	
	opts.before.push(function(curr, next, opts) {
		if (curr == next) return;
		var jQuerycurr = jQuery(curr), jQuerynext = jQuery(next);
		jQuery.fn.cycle.commonReset(curr,next,opts);
		
		var step = 1, count = parseInt((opts.speedIn / 13)) - 1;
		(function f() {
			var tt = t ? t - parseInt(step * (t/count)) : 0;
			var ll = l ? l - parseInt(step * (l/count)) : 0;
			var bb = b < h ? b + parseInt(step * ((h-b)/count || 1)) : h;
			var rr = r < w ? r + parseInt(step * ((w-r)/count || 1)) : w;
			jQuerynext.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
			(step++ <= count) ? setTimeout(f, 13) : jQuerycurr.css('display', 'none');
		})();
	});	   
	opts.cssBefore = { display: 'block', opacity: 1, top: 0, left: 0 };
	opts.animIn	   = { left: 0 };
	opts.animOut   = { left: 0 };
};

})(jQuery);


/*
 * Jeditable - jQuery in place edit plugin
 *
 * Copyright (c) 2006-2008 Mika Tuupola, Dylan Verheul
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Project home:
 *   http://www.appelsiini.net/projects/jeditable
 *
 * Based on editable by Dylan Verheul <dylan_at_dyve.net>:
 *    http://www.dyve.net/jquery/?editable
 *
 */

/**
  * Version 1.6.2
  *
  * ** means there is basic unit tests for this parameter. 
  *
  * @name  Jeditable
  * @type  jQuery
  * @param String  target             (POST) URL or function to send edited content to **
  * @param Hash    options            additional options 
  * @param String  options[method]    method to use to send edited content (POST or PUT) **
  * @param Function options[callback] Function to run after submitting edited content **
  * @param String  options[name]      POST parameter name of edited content
  * @param String  options[id]        POST parameter name of edited div id
  * @param Hash    options[submitdata] Extra parameters to send when submitting edited content.
  * @param String  options[type]      text, textarea or select (or any 3rd party input type) **
  * @param Integer options[rows]      number of rows if using textarea ** 
  * @param Integer options[cols]      number of columns if using textarea **
  * @param Mixed   options[height]    'auto', 'none' or height in pixels **
  * @param Mixed   options[width]     'auto', 'none' or width in pixels **
  * @param String  options[loadurl]   URL to fetch input content before editing **
  * @param String  options[loadtype]  Request type for load url. Should be GET or POST.
  * @param String  options[loadtext]  Text to display while loading external content.
  * @param Mixed   options[loaddata]  Extra parameters to pass when fetching content before editing.
  * @param Mixed   options[data]      Or content given as paramameter. String or function.**
  * @param String  options[indicator] indicator html to show when saving
  * @param String  options[tooltip]   optional tooltip text via title attribute **
  * @param String  options[event]     jQuery event such as 'click' of 'dblclick' **
  * @param String  options[submit]    submit button value, empty means no button **
  * @param String  options[cancel]    cancel button value, empty means no button **
  * @param String  options[cssclass]  CSS class to apply to input form. 'inherit' to copy from parent. **
  * @param String  options[style]     Style to apply to input form 'inherit' to copy from parent. **
  * @param String  options[select]    true or false, when true text is highlighted ??
  * @param String  options[placeholder] Placeholder text or html to insert when element is empty. **
  * @param String  options[onblur]    'cancel', 'submit', 'ignore' or function ??
  *             
  * @param Function options[onsubmit] function(settings, original) { ... } called before submit
  * @param Function options[onreset]  function(settings, original) { ... } called before reset
  * @param Function options[onerror]  function(settings, original, xhr) { ... } called on error
  *             
  * @param Hash    options[ajaxoptions]  jQuery Ajax options. See docs.jquery.com.
  *             
  */

(function(jQuery) {

    jQuery.fn.editable = function(target, options) {
    
        var settings = {
            target     : target,
            name       : 'value',
            id         : 'id',
            type       : 'text',
            width      : 'auto',
            height     : 'auto',
            event      : 'click',
            onblur     : 'cancel',
            loadtype   : 'GET',
            loadtext   : 'Loading...',
            placeholder: 'Click to edit',
            loaddata   : {},
            submitdata : {},
            ajaxoptions: {}
        };
        
        if(options) {
            jQuery.extend(settings, options);
        }
    
        /* setup some functions */
        var plugin   = jQuery.editable.types[settings.type].plugin || function() { };
        var submit   = jQuery.editable.types[settings.type].submit || function() { };
        var buttons  = jQuery.editable.types[settings.type].buttons 
                    || jQuery.editable.types['defaults'].buttons;
        var content  = jQuery.editable.types[settings.type].content 
                    || jQuery.editable.types['defaults'].content;
        var element  = jQuery.editable.types[settings.type].element 
                    || jQuery.editable.types['defaults'].element;
        var reset    = jQuery.editable.types[settings.type].reset 
                    || jQuery.editable.types['defaults'].reset;
        var callback = settings.callback || function() { };
        var onsubmit = settings.onsubmit || function() { };
        var onreset  = settings.onreset  || function() { };
        var onerror  = settings.onerror  || reset;
        
        /* add custom event if it does not exist */
        if  (!jQuery.isFunction(jQuery(this)[settings.event])) {
            jQuery.fn[settings.event] = function(fn){
                return fn ? this.bind(settings.event, fn) : this.trigger(settings.event);
            }
        }
          
        /* show tooltip */
        jQuery(this).attr('title', settings.tooltip);
        
        settings.autowidth  = 'auto' == settings.width;
        settings.autoheight = 'auto' == settings.height;

        return this.each(function() {
                        
            /* save this to self because this changes when scope changes */
            var self = this;  
                   
            /* inlined block elements lose their width and height after first edit */
            /* save them for later use as workaround */
            var savedwidth  = jQuery(self).width();
            var savedheight = jQuery(self).height();
            
            /* if element is empty add something clickable (if requested) */
            if (!jQuery.trim(jQuery(this).html())) {
                jQuery(this).html(settings.placeholder);
            }
            
            jQuery(this)[settings.event](function(e) {

                /* prevent throwing an exeption if edit field is clicked again */
                if (self.editing) {
                    return;
                }

                /* remove tooltip */
                jQuery(self).removeAttr('title');
                
                /* figure out how wide and tall we are, saved width and height */
                /* are workaround for http://dev.jquery.com/ticket/2190 */
                if (0 == jQuery(self).width()) {
                    //jQuery(self).css('visibility', 'hidden');
                    settings.width  = savedwidth;
                    settings.height = savedheight;
                } else {
                    if (settings.width != 'none') {
                        settings.width = 
                            settings.autowidth ? jQuery(self).width()  : settings.width;
                    }
                    if (settings.height != 'none') {
                        settings.height = 
                            settings.autoheight ? jQuery(self).height() : settings.height;
                    }
                }
                //jQuery(this).css('visibility', '');
                
                /* remove placeholder text, replace is here because of IE */
                if (jQuery(this).html().toLowerCase().replace(/;/, '') == 
                    settings.placeholder.toLowerCase().replace(/;/, '')) {
                        jQuery(this).html('');
                }
                                
                self.editing    = true;
                self.revert     = jQuery(self).html();
                jQuery(self).html('');

                /* create the form object */
                var form = jQuery('<form />');
                
                /* apply css or style or both */
                if (settings.cssclass) {
                    if ('inherit' == settings.cssclass) {
                        form.attr('class', jQuery(self).attr('class'));
                    } else {
                        form.attr('class', settings.cssclass);
                    }
                }

                if (settings.style) {
                    if ('inherit' == settings.style) {
                        form.attr('style', jQuery(self).attr('style'));
                        /* IE needs the second line or display wont be inherited */
                        form.css('display', jQuery(self).css('display'));                
                    } else {
                        form.attr('style', settings.style);
                    }
                }

                /* add main input element to form and store it in input */
                var input = element.apply(form, [settings, self]);

                /* set input content via POST, GET, given data or existing value */
                var input_content;
                
                if (settings.loadurl) {
                    var t = setTimeout(function() {
                        input.disabled = true;
                        content.apply(form, [settings.loadtext, settings, self]);
                    }, 100);

                    var loaddata = {};
                    loaddata[settings.id] = self.id;
                    if (jQuery.isFunction(settings.loaddata)) {
                        jQuery.extend(loaddata, settings.loaddata.apply(self, [self.revert, settings]));
                    } else {
                        jQuery.extend(loaddata, settings.loaddata);
                    }
                    jQuery.ajax({
                       type : settings.loadtype,
                       url  : settings.loadurl,
                       data : loaddata,
                       async : false,
                       success: function(result) {
                          window.clearTimeout(t);
                          input_content = result;
                          input.disabled = false;
                       }
                    });
                } else if (settings.data) {
                    input_content = settings.data;
                    if (jQuery.isFunction(settings.data)) {
                        input_content = settings.data.apply(self, [self.revert, settings]);
                    }
                } else {
                    input_content = self.revert; 
                }
                content.apply(form, [input_content, settings, self]);

                input.attr('name', settings.name);
        
                /* add buttons to the form */
                buttons.apply(form, [settings, self]);
         
                /* add created form to self */
                jQuery(self).append(form);
         
                /* attach 3rd party plugin if requested */
                plugin.apply(form, [settings, self]);

                /* focus to first visible form element */
                jQuery(':input:visible:enabled:first', form).focus();

                /* highlight input contents when requested */
                if (settings.select) {
                    input.select();
                }
        
                /* discard changes if pressing esc */
                input.keydown(function(e) {
                    if (e.keyCode == 27) {
                        e.preventDefault();
                        //self.reset();
                        reset.apply(form, [settings, self]);
                    }
                });

                /* discard, submit or nothing with changes when clicking outside */
                /* do nothing is usable when navigating with tab */
                var t;
                if ('cancel' == settings.onblur) {
                    input.blur(function(e) {
                        /* prevent canceling if submit was clicked */
                        t = setTimeout(function() {
                            reset.apply(form, [settings, self]);
                        }, 500);
                    });
                } else if ('submit' == settings.onblur) {
                    input.blur(function(e) {
                        /* prevent double submit if submit was clicked */
                        t = setTimeout(function() {
                            form.submit();
                        }, 200);
                    });
                } else if (jQuery.isFunction(settings.onblur)) {
                    input.blur(function(e) {
                        settings.onblur.apply(self, [input.val(), settings]);
                    });
                } else {
                    input.blur(function(e) {
                      /* TODO: maybe something here */
                    });
                }

                form.submit(function(e) {

                    if (t) { 
                        clearTimeout(t);
                    }

                    /* do no submit */
                    e.preventDefault(); 
            
                    /* call before submit hook. */
                    /* if it returns false abort submitting */                    
                    if (false !== onsubmit.apply(form, [settings, self])) { 
                        /* custom inputs call before submit hook. */
                        /* if it returns false abort submitting */
                        if (false !== submit.apply(form, [settings, self])) { 

                          /* check if given target is function */
                          if (jQuery.isFunction(settings.target)) {
                              var str = settings.target.apply(self, [input.val(), settings]);
                              jQuery(self).html(str);
                              self.editing = false;
                              callback.apply(self, [self.innerHTML, settings]);
                              /* TODO: this is not dry */                              
                              if (!jQuery.trim(jQuery(self).html())) {
                                  jQuery(self).html(settings.placeholder);
                              }
                          } else {
                              /* add edited content and id of edited element to POST */
                              var submitdata = {};
							  
							  if (settings.type=='fckeditor') 
							  { 
								submitdata[settings.name] = FCKeditorAPI.GetInstance(settings.id).GetXHTML() 
							  } 
							  else 
							  { 
								submitdata[settings.name] = input.val(); 
							  } 

                              submitdata[settings.id] = self.id;
                              /* add extra data to be POST:ed */
                              if (jQuery.isFunction(settings.submitdata)) {
                                  jQuery.extend(submitdata, settings.submitdata.apply(self, [self.revert, settings]));
                              } else {
                                  jQuery.extend(submitdata, settings.submitdata);
                              }

                              /* quick and dirty PUT support */
                              if ('PUT' == settings.method) {
                                  submitdata['_method'] = 'put';
                              }

                              /* show the saving indicator */
                              jQuery(self).html(settings.indicator);
                              
                              /* defaults for ajaxoptions */
                              var ajaxoptions = {
                                  type    : 'POST',
                                  data    : submitdata,
                                  url     : settings.target,
                                  success : function(result, status) {
                                      jQuery(self).html(result);
                                      self.editing = false;
                                      callback.apply(self, [self.innerHTML, settings]);
                                      if (!jQuery.trim(jQuery(self).html())) {
                                          jQuery(self).html(settings.placeholder);
                                      }
                                  },
                                  error   : function(xhr, status, error) {
                                      onerror.apply(form, [settings, self, xhr]);
                                  }
                              }
                              
                              /* override with what is given in settings.ajaxoptions */
                              jQuery.extend(ajaxoptions, settings.ajaxoptions);   
                              jQuery.ajax(ajaxoptions);          
                              
                            }
                        }
                    }
                    
                    /* show tooltip again */
                    jQuery(self).attr('title', settings.tooltip);
                    
                    return false;
                });
            });
            
            /* privileged methods */
            this.reset = function(form) {
                /* prevent calling reset twice when blurring */
                if (this.editing) {
                    /* before reset hook, if it returns false abort reseting */
                    if (false !== onreset.apply(form, [settings, self])) { 
                        jQuery(self).html(self.revert);
                        self.editing   = false;
                        if (!jQuery.trim(jQuery(self).html())) {
                            jQuery(self).html(settings.placeholder);
                        }
                        /* show tooltip again */
                        jQuery(self).attr('title', settings.tooltip);                
                    }                    
                }
            }            
        });

    };


    jQuery.editable = {
        types: {
            defaults: {
                element : function(settings, original) {
                    var input = jQuery('<input type="hidden"></input>');                
                    jQuery(this).append(input);
                    return(input);
                },
                content : function(string, settings, original) {
                    jQuery(':input:first', this).val(string);
                },
                reset : function(settings, original) {
                  original.reset(this);
                },
                buttons : function(settings, original) {
                    var form = this;
                    if (settings.submit) {
                        /* if given html string use that */
                        if (settings.submit.match(/>jQuery/)) {
                            var submit = jQuery(settings.submit).click(function() {
                                if (submit.attr("type") != "submit") {
                                    form.submit();
                                }
                            });
                        /* otherwise use button with given string as text */
                        } else {
                            var submit = jQuery('<button type="submit" />');
                            submit.html(settings.submit);                            
                        }
                        jQuery(this).append(submit);
                    }
                    if (settings.cancel) {
                        /* if given html string use that */
                        if (settings.cancel.match(/>jQuery/)) {
                            var cancel = jQuery(settings.cancel);
                        /* otherwise use button with given string as text */
                        } else {
                            var cancel = jQuery('<button type="cancel" />');
                            cancel.html(settings.cancel);
                        }
                        jQuery(this).append(cancel);

                        jQuery(cancel).click(function(event) {
                            //original.reset();
                            if (jQuery.isFunction(jQuery.editable.types[settings.type].reset)) {
                                var reset = jQuery.editable.types[settings.type].reset;                                                                
                            } else {
                                var reset = jQuery.editable.types['defaults'].reset;                                
                            }
                            reset.apply(form, [settings, original]);
                            return false;
                        });
                    }
                }
            },
            text: {
                element : function(settings, original) {
                    var input = jQuery('<input />');
                    if (settings.width  != 'none') { input.width(settings.width);  }
                    if (settings.height != 'none') { input.height(settings.height); }
                    /* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */
                    //input[0].setAttribute('autocomplete','off');
                    input.attr('autocomplete','off');
                    jQuery(this).append(input);
                    return(input);
                }
            },
            textarea: {
                element : function(settings, original) {
                    var textarea = jQuery('<textarea />');
                    if (settings.rows) {
                        textarea.attr('rows', settings.rows);
                    } else {
                        textarea.height(settings.height);
                    }
                    if (settings.cols) {
                        textarea.attr('cols', settings.cols);
                    } else {
                        textarea.width(settings.width);
                    }
                    jQuery(this).append(textarea);
                    return(textarea);
                }
            },
			fckeditor: { 
				element : function(settings, original) { 
					var textarea = jQuery('<textarea />'); 
					if (settings.rows) { 
						textarea.attr('rows', settings.rows); 
					} else { 
						textarea.height(settings.height); 
					} 
					if (settings.cols) { 
						textarea.attr('cols', settings.cols); 
					} else { 
						textarea.width(settings.width); 
					} 
					textarea.attr("id", settings.id) 
					textarea.attr("style", "display: none") 

					jQuery(this).append(textarea); 
					setTimeout("replaceTextarea('"+settings.id+"')", 100); 

					return(textarea); 
				} 
			},
            select: {
               element : function(settings, original) {
                    var select = jQuery('<select />');
                    jQuery(this).append(select);
                    return(select);
                },
                content : function(string, settings, original) {
                    if (String == string.constructor) {      
                        eval ('var json = ' + string);
                        for (var key in json) {
                            if (!json.hasOwnProperty(key)) {
                                continue;
                            }
                            if ('selected' == key) {
                                continue;
                            } 
                            var option = jQuery('<option />').val(key).append(json[key]);
                            jQuery('select', this).append(option);    
                        }
                    }
                    /* Loop option again to set selected. IE needed this... */ 
                    jQuery('select', this).children().each(function() {
                        if (jQuery(this).val() == json['selected'] || 
                            jQuery(this).text() == original.revert) {
                                jQuery(this).attr('selected', 'selected');
                        };
                    });
                }
            }
        },

        /* Add new input type */
        addInputType: function(name, input) {
            jQuery.editable.types[name] = input;
        }
    };

})(jQuery);


/*
 * Ajaxupload for Jeditable
 *
 * Copyright (c) 2008 Mika Tuupola
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Depends on Ajax fileupload jQuery plugin by PHPLetter guys:
 *   http://www.phpletter.com/Our-Projects/AjaxFileUpload/
 *
 * Project home:
 *   http://www.appelsiini.net/projects/jeditable
 *
 */
 
jQuery.editable.addInputType('ajaxupload', {
    /* create input element */
    element : function(settings) {
        settings.onblur = 'ignore';
        var input = jQuery('<input type="file" id="upload" name="upload" />');
        jQuery(this).append(input);
        return(input);
    },
    content : function(string, settings, original) {
        /* do nothing */
    },
    plugin : function(settings, original) {
        var form = this;
        form.attr("enctype", "multipart/form-data");
        jQuery("button:submit", form).bind('click', function() {
            //jQuery(".message").show();
            jQuery.ajaxFileUpload({
                url: settings.target,
                secureuri:false,
                fileElementId: 'upload',
                dataType: 'html',
                success: function (data, status) {
                    jQuery(original).html(data);
                    original.editing = false;
                },
                error: function (data, status, e) {
                    alert(e);
                }
            })
            return(false);
        });
    }
});



jQuery.extend({

    createUploadIframe: function(id, uri)
	{
			//create frame
            var frameId = 'jUploadFrame' + id;
            
            if(window.ActiveXObject) {
                var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
                if(typeof uri== 'boolean'){
                    io.src = 'javascript:false';
                }
                else if(typeof uri== 'string'){
                    io.src = uri;
                }
            }
            else {
                var io = document.createElement('iframe');
                io.id = frameId;
                io.name = frameId;
            }
            io.style.position = 'absolute';
            io.style.top = '-1000px';
            io.style.left = '-1000px';

            document.body.appendChild(io);

            return io			
    },
    createUploadForm: function(id, fileElementId)
	{
		//create form	
		var formId = 'jUploadForm' + id;
		var fileId = 'jUploadFile' + id;
		var form = jQuery('<form  action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');	
		var oldElement = jQuery('#' + fileElementId);
		var newElement = jQuery(oldElement).clone();
		jQuery(oldElement).attr('id', fileId);
		jQuery(oldElement).before(newElement);
		jQuery(oldElement).appendTo(form);
		//set attributes
		jQuery(form).css('position', 'absolute');
		jQuery(form).css('top', '-1200px');
		jQuery(form).css('left', '-1200px');
		jQuery(form).appendTo('body');		
		return form;
    },

    ajaxFileUpload: function(s) {
        // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout		
        s = jQuery.extend({}, jQuery.ajaxSettings, s);
        var id = new Date().getTime()        
		var form = jQuery.createUploadForm(id, s.fileElementId);
		var io = jQuery.createUploadIframe(id, s.secureuri);
		var frameId = 'jUploadFrame' + id;
		var formId = 'jUploadForm' + id;		
        // Watch for a new set of requests
        if ( s.global && ! jQuery.active++ )
		{
			jQuery.event.trigger( "ajaxStart" );
		}            
        var requestDone = false;
        // Create the request object
        var xml = {}   
        if ( s.global )
            jQuery.event.trigger("ajaxSend", [xml, s]);
        // Wait for a response to come back
        var uploadCallback = function(isTimeout)
		{			
			var io = document.getElementById(frameId);
            try 
			{				
				if(io.contentWindow)
				{
					 xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
                	 xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
					 
				}else if(io.contentDocument)
				{
					 xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
                	xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
				}						
            }catch(e)
			{
				jQuery.handleError(s, xml, null, e);
			}
            if ( xml || isTimeout == "timeout") 
			{				
                requestDone = true;
                var status;
                try {
                    status = isTimeout != "timeout" ? "success" : "error";
                    // Make sure that the request was successful or notmodified
                    if ( status != "error" )
					{
                        // process the data (runs the xml through httpData regardless of callback)
                        var data = jQuery.uploadHttpData( xml, s.dataType );    
                        // If a local callback was specified, fire it and pass it the data
                        if ( s.success )
                            s.success( data, status );
    
                        // Fire the global callback
                        if( s.global )
                            jQuery.event.trigger( "ajaxSuccess", [xml, s] );
                    } else
                        jQuery.handleError(s, xml, status);
                } catch(e) 
				{
                    status = "error";
                    jQuery.handleError(s, xml, status, e);
                }

                // The request was completed
                if( s.global )
                    jQuery.event.trigger( "ajaxComplete", [xml, s] );

                // Handle the global AJAX counter
                if ( s.global && ! --jQuery.active )
                    jQuery.event.trigger( "ajaxStop" );

                // Process result
                if ( s.complete )
                    s.complete(xml, status);

                jQuery(io).unbind()

                setTimeout(function()
									{	try 
										{
											jQuery(io).remove();
											jQuery(form).remove();	
											
										} catch(e) 
										{
											jQuery.handleError(s, xml, null, e);
										}									

									}, 100)

                xml = null

            }
        }
        // Timeout checker
        if ( s.timeout > 0 ) 
		{
            setTimeout(function(){
                // Check to see if the request is still happening
                if( !requestDone ) uploadCallback( "timeout" );
            }, s.timeout);
        }
        try 
		{
           // var io = jQuery('#' + frameId);
			var form = jQuery('#' + formId);
			jQuery(form).attr('action', s.url);
			jQuery(form).attr('method', 'POST');
			jQuery(form).attr('target', frameId);
            if(form.encoding)
			{
                form.encoding = 'multipart/form-data';				
            }
            else
			{				
                form.enctype = 'multipart/form-data';
            }			
            jQuery(form).submit();

        } catch(e) 
		{			
            jQuery.handleError(s, xml, null, e);
        }
        if(window.attachEvent){
            document.getElementById(frameId).attachEvent('onload', uploadCallback);
        }
        else{
            document.getElementById(frameId).addEventListener('load', uploadCallback, false);
        } 		
        return {abort: function () {}};	

    },

    uploadHttpData: function( r, type ) {
        var data = !type;
        data = type == "xml" || data ? r.responseXML : r.responseText;
        // If the type is "script", eval it in global context
        if ( type == "script" )
            jQuery.globalEval( data );
        // Get the JavaScript object, if JSON is used.
        if ( type == "json" )
            eval( "data = " + data );
        // evaluate scripts within html
        if ( type == "html" )
            jQuery("<div>").html(data);
            //jQuery("<div>").html(data).evalScripts();
			//alert(jQuery('param', data).each(function(){alert(jQuery(this).attr('value'));}));
        return data;
    }
})



function limitChars(textid, limit, infodiv) {
  var text = jQuery('#'+textid).val(); 
  var textlength = text.length;
  if(textlength > limit) {
    jQuery('#' + infodiv).html('You cannot write more then '+limit+' characters');
    jQuery('#'+textid).val(text.substr(0,limit));
    return false;
  }
  else {
    jQuery('#' + infodiv).html('You have '+ (limit - textlength) +' characters left.');
    return true;
  }
}

/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;  // maximum image size.

if (document.getElementById || document.all){
  document.write('<div id="trailimageid">');
  document.write('</div>');
}

function gettrailobj() {
  
  if (document.getElementById) {
    return document.getElementById("trailimageid").style;
  }
  else if (document.all) {
    return document.all.trailimagid.style;
  }
  return '';
}

function gettrailobjnostyle(){
  
  if (document.getElementById) {
    return document.getElementById("trailimageid");
  }
  else if (document.all) {
    return document.all.trailimagid;
  }
  return '';
}

function truebody() {
  return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showtrail(title,description,currentimageheight) {
  document.onmousemove=followmouse;

  newHTML = '<div class="info_box">';
  newHTML = newHTML + '<h2>' + title + '</h2>';
  newHTML = newHTML + description + '<br/>';

  newHTML = newHTML + '</div>';
  gettrailobjnostyle().innerHTML = newHTML;
  gettrailobj().display="inline";
}


function hidetrail() {
  gettrailobj().innerHTML = " ";
  gettrailobj().display="none"
  document.onmousemove=""
  gettrailobj().left="-500px"
}

function followmouse(e) {
  var xcoord=offsetfrommouse[0]
  var ycoord=offsetfrommouse[1]

  var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth - 15
  var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

  if (typeof e != "undefined"){ // firefix
    xcoord = e.pageX - xcoord - 230; // Move to the left side of the cursor
    ycoord += e.pageY - 10;
  } else if (typeof window.event != "undefined"){ // ie
    xcoord = event.clientX + truebody().scrollLeft - xcoord - 160; // Move to the left side of the cursor
    ycoord += truebody().scrollTop + event.clientY - 10;
  }

  var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
  var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
    if(ycoord < 0) { ycoord = ycoord*-1; }
  gettrailobj().left=xcoord+"px"
  gettrailobj().top=ycoord+"px"
}
/* END Simple Image Trail */

function replaceTextarea(id)
{
  var oFCKeditor = new FCKeditor(id);
  oFCKeditor.ToolbarSet = "VerySimple";
  oFCKeditor.BasePath = "/javascripts/fckeditor/";
  oFCKeditor.Config['CustomConfigurationsPath'] = '/javascripts/fckcustom.js'
  oFCKeditor.width = 770;
  oFCKeditor.Height = 400;
  // IE hack
  oFCKeditor.Value = "<p></p>";
  oFCKeditor.ReplaceTextarea();
}

$.ajaxSetup({ 'beforeSend': function(xhr) {
  xhr.setRequestHeader('Accept', 'text/javascript')
}});


function countDown(id, length)
{
  $('#' + id).keyup(function(){
  if(this.value.length >= length) {
    //handle the over the limit part here
    $(this).addClass('overlimit');
    this.value = this.value.substring(0, length);
  } else {
    $(this).removeClass('overlimit');
  }
  countdownMessage(id, length, this);
  });
}

function countdownMessage(id, length, element)
{
  $('#' + id + '_counter').text((length-element.value.length) + " characters left for " + id.replace(/_/g, " "));
}

function default_text_for_input(id, text)
{
  $(id).focus(function() {
    if (this.value == text) { this.value = '' }
  }).blur(function() {
    if (this.value == '') { this.value = text }
  });
}


function flip_address() {
  var address_fields = new Array('address_title', 'address_first_name', 'address_last_name',
                   'address_address_line_1', 'address_address_line_2', 'address_town',
                   'address_county', 'address_country_id', 'address_postcode', 'address_telephone');  
  
  checkbox = document.getElementById('same_delivery_address');
  
  if(checkbox.checked) {
    for(i in address_fields) {
      field_name = address_fields[i];
      delivery_id = 'delivery_' + field_name;
      billing_id = 'billing_' + field_name;
      
      document.getElementById(delivery_id).enabled = false;
      document.getElementById(delivery_id).value = document.getElementById(billing_id).value;
    } 
  } else {
    for(i in address_fields) {
      field_name = address_fields[i];
      delivery_id = 'delivery_' + field_name;
      billing_id = 'billing_' + field_name;
      
      document.getElementById(delivery_id).enabled = true;
      document.getElementById(delivery_id).value = "";
    }
  }
}

$(document).ready(function() {

  // Delivery Address
  $('#same_delivery_address').click(function(event) {
    flip_address();
  });
  
});

// Currency Convertor dropdown
$(document).ready(function() {
  
  $form = $("form.currency");
  $('form.currency #iso_4217_code').change(function() {
    $form.submit();
  });
  $form.find("input[type='submit']").remove();
  
});

var loadEmailFriendCloseLink = function($element) {
  $element.append('<div id="email_friend_close"><a href="#">Close</a></div>');
  $('#email_friend_close').click(function(e) {
    $wrapper.slideUp(300);
    e.preventDefault();
  });
}

var loadEmailFriendFormBehaviour = function() {
  $('#new_email_to_a_friend').submit(function(event) {
    $form = $(this);
    $.post($form.attr('action'), $form.serialize(), function(data) {
      $wrapper.html(data);
      loadEmailFriendCloseLink($wrapper);
      loadEmailFriendFormBehaviour();
      $('html').animate({scrollTop:0}, 'medium'); 
    });
    event.preventDefault();
  });
}

$(document).ready(function() {

  $('#email_friend_link').after('<div id="email_friend_box"></div>').click(function(event) {
    $.get($(this).attr('href'), "", function(data) { 
      $wrapper = $('#email_friend_box');
      $wrapper.html(data);
      loadEmailFriendCloseLink($wrapper);
      $wrapper.slideDown(300, function() {        
        loadEmailFriendFormBehaviour();
      });
      $('html').animate({scrollTop: 50}, 'medium'); 
    });
    event.preventDefault();
  });

});

function clear_filter(filter_id) {
  var hidden_field_id = 'hidden_field_'+filter_id;  
  var select_field_id = filter_id + '_filter';
  document.getElementById(hidden_field_id).value = 'All';
  document.getElementById(select_field_id).selectedIndex = 0;
  document.getElementById('filters').submit();
}

$(document).ready(function() {

  // Filters
  $filters = $("#filters");
  $filters.find("input:not(#price_from, #price_to), select").change(function() {
    $filters.submit();
  });
  
});


$(document).ready(function() {

  // Newsletter signup
  default_text_for_input('#content_main #newsletter_user_email', 'Enter email address');
  default_text_for_input('#footer_box #newsletter_user_email', 'Enter email address');
  
  // Product Reviews
  $('#new_product_review #product_review_review').keyup(function(){
    limitChars('product_review_review', 500, 'characters_left');
  });

  // Affiliate
  $('.affiliate_html textarea').focus(function() {
    this.select();
  });

  // Delivery Zone Countries Toggle
  $('table.admin_list_table td span.delivery_zone_toggle').click(function() {
    $(this).next('.delivery_zone_countries').toggle();
    return false;
  });
  
  // Basket
  $('.left_handed_check input').click(function() {
    $form = $('.edit_basket');
    $.post($form.attr('action'), $form.serialize());
  });

});

jQuery.preloadImages = function() {
  array = arguments[0];
  for (i = 0; i < array.length; i++) {
    $("<img>").attr("src", array[i]);
  }
}

var loadProductDetailsBehaviour = function() {
  $product_details = $('#product_details')
  $product_details.find('form#product_form').show();
  $('#product_options select').change(function() {
    $data = $product_details.find('#product_options select, #product_options input').serialize();
    $data += "&authenticity_token=" + encodeURIComponent($product_details.find('input[name=authenticity_token]').val());
    $url  = '/product/' + $product_details.find('#code').val() + '/update_variants';
    $.post($url, $data, function(data) {
      $product_details.html(data);
      loadProductDetailsBehaviour();
    });    
  });
}

$(document).ready(function() {
  
  // PRODUCT DETAILS PAGE
  // Reset select fields to first value so Firefox plays nice
  $('#product_options select option:first').attr('selected', 'selected');
  loadProductDetailsBehaviour();
  
  // PRICE TOOLTIP
  $('.price_tooltip').mouseover(function() {
    showtrail('Estimated price','This is a guide price only. Payment will be made in UK Pounds Sterling.');
  }).mouseout(function() {
    hidetrail();
  });
  
});


var quick_shop_dirty = false;

function make_quick_shop_dirty() {
  quick_shop_dirty = true;
}

function make_quick_shop_clean() {
  quick_shop_dirty = false;
}


$(document).ready(function() {

  // Predictive Search
  $('#search_query').autocomplete({  
    serviceUrl:'/search/suggestions',
    minChars: 2, 
    maxHeight: 400,
    width: 200,
    autoSubmit: true
  });

  // Search field
  default_text_for_input('#search_query', 'Product name/code');

});


$(document).ready(function() {

  $('a#remove_wishlist_items').click(function(event) {
    if (confirm("Are you sure you want to remove the selected items from your wish list?")) {
      var form = $(this).closest('form');
      var wishlist = $('#wishlist').attr('value');
      form.attr('action', "/wishlists/" + wishlist + "/entries");
      var m = document.createElement('input');
      m.setAttribute('type', 'hidden');
      m.setAttribute('name', '_method');
      m.setAttribute('value', 'delete');
      form.append(m);
      form.submit();
    }
    event.preventDefault();
  });
  
});

/*


   Magic Thumb v2.0.34 
   Copyright 2010 Magic Toolbox
   You must buy a license to use this tool.
   Go to www.magictoolbox.com/magicthumb/


*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(w(){C(Q.79){B}E a={3v:"2.3.10",73:0,3j:{},$6a:w(b){B(b.$2t||(b.$2t=++$J.73))},5d:w(b){B($J.3j[b]||($J.3j[b]={}))},$F:w(){},$N:w(){B N},1P:w(b){B(2l!=b)},9t:w(b){B!!(b)},2F:w(b){C(!$J.1P(b)){B N}C(b.$2n){B b.$2n}C(!!b.3b){C(1==b.3b){B"5Z"}C(3==b.3b){B"7o"}}C(b.1o&&b.4X){B"bz"}C(b.1o&&b.51){B"1r"}C((b 2x Q.bL||b 2x Q.6F)&&b.47===$J.2O){B"6B"}C(b 2x Q.3e){B"3U"}C(b 2x Q.6F){B"w"}C(b 2x Q.6E){B"5j"}C($J.v.2c){C($J.1P(b.7c)){B"3i"}}19{C(b 2x Q.5X||b===Q.3i||b.47==Q.bJ){B"3i"}}C(b 2x Q.7k){B"7h"}C(b 2x Q.4k){B"bP"}C(b===Q){B"Q"}C(b===12){B"12"}B 4Y(b)},1q:w(f,e){C(!(f 2x Q.3e)){f=[f]}1g(E d=0,b=f.1o;d<b;d++){C(!$J.1P(f)){49}1g(E c 1i(e||{})){f[d][c]=e[c]}}B f[0]},5s:w(f,e){C(!(f 2x Q.3e)){f=[f]}1g(E d=0,b=f.1o;d<b;d++){C(!$J.1P(f[d])){49}C(!f[d].1C){49}1g(E c 1i(e||{})){C(!f[d].1C[c]){f[d].1C[c]=e[c]}}}B f[0]},7n:w(d,c){C(!$J.1P(d)){B d}1g(E b 1i(c||{})){C(!d[b]){d[b]=c[b]}}B d},$1X:w(){1g(E c=0,b=1r.1o;c<b;c++){1X{B 1r[c]()}2r(d){}}B K},$A:w(d){C(!$J.1P(d)){B $j([])}C(d.7i){B $j(d.7i())}C(d.4X){E c=d.1o||0,b=T 3e(c);2X(c--){b[c]=d[c]}B $j(b)}B $j(3e.1C.aO.21(d))},4r:w(){B T 7k().b8()},2V:w(f){E d;1E($J.2F(f)){P"7p":d={};1g(E e 1i f){d[e]=$J.2V(f[e])}R;P"3U":d=[];1g(E c=0,b=f.1o;c<b;c++){d[c]=$J.2V(f[c])}R;1U:B f}B d},$:w(c){C(!$J.1P(c)){B K}C(c.$6I){B c}1E($J.2F(c)){P"3U":c=$J.7n(c,$J.1q($J.3e,{$6I:S}));c.3o=c.2z;B c;R;P"5j":E b=12.aY(c);C($J.1P(b)){B $J.$(b)}B K;R;P"Q":P"12":$J.$6a(c);c=$J.1q(c,$J.3A);R;P"5Z":$J.$6a(c);c=$J.1q(c,$J.1Q);R;P"3i":c=$J.1q(c,$J.5X);R;P"7o":B c;R;P"w":P"3U":P"7h":1U:R}B $J.1q(c,{$6I:S})},$T:w(b,d,c){B $j($J.1z.6N(b)).6J(d).U(c)}};Q.79=Q.$J=a;Q.$j=a.$;$J.3e={$2n:"3U",3r:w(e,f){E b=9.1o;1g(E c=9.1o,d=(f<0)?X.4n(0,c+f):f||0;d<c;d++){C(9[d]===e){B d}}B-1},3Q:w(b,c){B 9.3r(b,c)!=-1},2z:w(b,e){1g(E d=0,c=9.1o;d<c;d++){C(d 1i 9){b.21(e,9[d],d,9)}}},1V:w(b,g){E f=[];1g(E e=0,c=9.1o;e<c;e++){C(e 1i 9){E d=9[e];C(b.21(g,9[e],e,9)){f.4s(d)}}}B f},8N:w(b,f){E e=[];1g(E d=0,c=9.1o;d<c;d++){C(d 1i 9){e[d]=b.21(f,9[d],d,9)}}B e}};$J.5s(6E,{$2n:"5j",3T:w(){B 9.1p(/^\\s+|\\s+$/g,"")},bD:w(){B 9.1p(/^\\s+/g,"")},bN:w(){B 9.1p(/\\s+$/g,"")},bi:w(b){B(9.5i()===b.5i())},bf:w(b){B(9.1Y().5i()===b.1Y().5i())},k:w(){B 9.1p(/-\\D/g,w(b){B b.7e(1).bv()})},5h:w(){B 9.1p(/[A-Z]/g,w(b){B("-"+b.7e(0).1Y())})},1c:w(c){B 3L(9,c||10)},8m:w(){B 6h(9)},8l:w(){B!9.1p(/S/i,"").3T()},3z:w(c,b){b=b||"";B(b+9+b).3r(b+c+b)>-1}});a.5s(6F,{$2n:"w",13:w(){E c=$J.$A(1r),b=9,d=c.4B();B w(){B b.3h(d||K,c.7K($J.$A(1r)))}},2j:w(){E c=$J.$A(1r),b=9,d=c.4B();B w(e){B b.3h(d||K,$j([e||Q.3i]).7K(c))}},1O:w(){E c=$J.$A(1r),b=9,d=c.4B();B Q.ao(w(){B b.3h(b,c)},d||0)},7x:w(){E c=$J.$A(1r),b=9;B w(){B b.1O.3h(b,c)}},7b:w(){E c=$J.$A(1r),b=9,d=c.4B();B Q.aC(w(){B b.3h(b,c)},d||0)}});$J.v={5N:{7C:!!(12.9g),9v:!!(Q.8Z),7B:!!(12.9d)},2C:(Q.99)?"7A":!!(Q.8X)?"2c":(!7I.a8)?"3c":(2l!=12.ad)?"5L":"ae",3v:"",65:($J.1P(Q.ag))?"9K":(7I.65.3Z(/87|42|9E/i)||["9F"])[0].1Y(),3a:12.5l&&"76"==12.5l.1Y(),2i:w(){B(12.5l&&"76"==12.5l.1Y())?12.2a:12.6t},1s:N,4F:w(){C($J.v.1s){B}$J.v.1s=S;$J.2a=$j(12.2a);$j(12).7j("36")}};(w(){w b(){B!!(1r.51.6H)}$J.v.3v=("7A"==$J.v.2C)?((b())?9T:((12.4z)?9S:9R)):("2c"==$J.v.2C)?!!(Q.7D&&Q.9Q)?6:((Q.7D)?5:4):("3c"==$J.v.2C)?(($J.v.5N.7C)?(($J.v.5N.7B)?9Y:7m):9X):("5L"==$J.v.2C)?!!(Q.9W)?9P:((12.4z)?9O:9H):"";$J.v[$J.v.2C]=$J.v[$J.v.2C+$J.v.3v]=S})();$J.1Q={5V:w(b){B 9.2p.3z(b," ")},2u:w(b){C(b&&!9.5V(b)){9.2p+=(9.2p?" ":"")+b}B 9},4K:w(b){b=b||".*";9.2p=9.2p.1p(T 4k("(^|\\\\s)"+b+"(?:\\\\s|$)"),"$1").3T();B 9},9G:w(b){B 9.5V(b)?9.4K(b):9.2u(b)},1f:w(c){c=(c=="31"&&9.4l)?"6i":c.k();E b=K;C(9.4l){b=9.4l[c]}19{C(12.5J&&12.5J.6L){6s=12.5J.6L(9,K);b=6s?6s.9N([c.5h()]):K}}C(!b){b=9.2q[c]}C("1k"==c){B $J.1P(b)?6h(b):1}C(/^(2h(6o|5B|6n|6m)9M)|((1W|1l)(6o|5B|6n|6m))$/.2L(c)){b=3L(b)?b:"5b"}B("1e"==b?K:b)},1b:w(c,b){1X{C("1k"==c){9.g(b);B 9}C("31"==c){9.2q[("2l"===4Y(9.2q.6i))?"9L":"6i"]=b;B 9}9.2q[c.k()]=b+(("67"==$J.2F(b)&&!$j(["1H","5F"]).3Q(c.k()))?"5A":"")}2r(d){}B 9},U:w(c){1g(E b 1i c){9.1b(b,c[b])}B 9},2w:w(){E b={};$J.$A(1r).3o(w(c){b[c]=9.1f(c)},9);B b},g:w(e,c){c=c||N;e=6h(e);C(c){C(e==0){C("1x"!=9.2q.2v){9.2q.2v="1x"}}19{C("4x"!=9.2q.2v){9.2q.2v="4x"}}}C($J.v.2c){C(!9.4l||!9.4l.a0){9.2q.5F=1}1X{E d=9.a1.4X("6V.6Y.6M");d.6O=(1!=e);d.1k=e*1y}2r(b){9.2q.1V+=(1==e)?"":"ah:6V.6Y.6M(6O=S,1k="+e*1y+")"}}9.2q.1k=e;B 9},6J:w(b){1g(E c 1i b){9.ai(c,""+b[c])}B 9},22:w(){B 9.U({1t:"2o",2v:"1x"})},2S:w(){B 9.U({1t:"1I",2v:"4x"})},1N:w(){B{H:9.7F,L:9.5x}},5f:w(){B{O:9.2Q,M:9.3n}},aj:w(){E b=9,c={O:0,M:0};6T{c.M+=b.3n||0;c.O+=b.2Q||0;b=b.26}2X(b);B c},3s:w(){C($J.1P(12.6t.72)){E c=9.72(),e=$j(12).5f(),g=$J.v.2i();B{O:c.O+e.y-g.al,M:c.M+e.x-g.ak}}E f=9,d=t=0;6T{d+=f.ac||0;t+=f.a5||0;f=f.a4}2X(f&&!(/^(?:2a|a3)$/i).2L(f.3E));B{O:t,M:d}},3S:w(){E c=9.3s();E b=9.1N();B{O:c.O,1d:c.O+b.L,M:c.M,1a:c.M+b.H}},43:w(d){1X{9.62=d}2r(b){9.a2=d}B 9},5T:w(){B(9.26)?9.26.a6(9):9},54:w(){$J.$A(9.a7).3o(w(b){C(3==b.3b){B}$j(b).54()});9.5T();9.6y();C(9.$2t){$J.3j[9.$2t]=K;1Z $J.3j[9.$2t]}B K},35:w(d,c){c=c||"1d";E b=9.7Z;("O"==c&&b)?9.ab(d,b):9.aa(d);B 9},1L:w(d,c){E b=$j(d).35(9,c);B 9},7G:w(b){9.35(b.26.6w(9,b));B 9},5o:w(b){C(!(b=$j(b))){B N}B(9==b)?N:(9.3Q&&!($J.v.7w))?(9.3Q(b)):(9.70)?!!(9.70(b)&16):$J.$A(9.1J(b.3E)).3Q(b)}};$J.1Q.an=$J.1Q.1f;$J.1Q.9u=$J.1Q.U;C(!Q.1Q){Q.1Q=$J.$F;C($J.v.2C.3c){Q.12.6N("92")}Q.1Q.1C=($J.v.2C.3c)?Q["[[91.1C]]"]:{}}$J.5s(Q.1Q,{$2n:"5Z"});$J.3A={1N:w(){C($J.v.96||$J.v.7w){B{H:V.98,L:V.97}}B{H:$J.v.2i().9a,L:$J.v.2i().9c}},5f:w(){B{x:V.9b||$J.v.2i().3n,y:V.95||$J.v.2i().2Q}},8x:w(){E b=9.1N();B{H:X.4n($J.v.2i().93,b.H),L:X.4n($J.v.2i().8Y,b.L)}}};$J.1q(12,{$2n:"12"});$J.1q(Q,{$2n:"Q"});$J.1q([$J.1Q,$J.3A],{I:w(e,c){E b=$J.5d(9.$2t),d=b[e];C(2l!=c&&2l==d){d=b[e]=c}B(d||K)},17:w(d,c){E b=$J.5d(9.$2t);b[d]=c;B 9},4Z:w(c){E b=$J.5d(9.$2t);1Z b[c];B 9}});C(!(Q.64&&Q.64.1C&&Q.64.1C.4z)){$J.1q([$J.1Q,$J.3A],{4z:w(b){B $J.$A(9.7O("*")).1V(w(d){1X{B(1==d.3b&&d.2p.3z(b," "))}2r(c){}})}})}$J.1q([$J.1Q,$J.3A],{94:w(){B 9.4z(1r[0])},1J:w(){B 9.7O(1r[0])}});$J.5X={$2n:"3i",18:w(){C(9.7g){9.7g()}19{9.7c=S}C(9.77){9.77()}19{9.9w=N}B 9},9x:w(){B{x:9.9B||9.9A+$J.v.2i().3n,y:9.9z||9.9y+$J.v.2i().2Q}},3H:w(){E b=9.9r||9.9q;2X(b&&3==b.3b){b=b.26}B b},3C:w(){E c=K;1E(9.3D){P"2s":c=9.78||9.9j;R;P"2d":c=9.78||9.9h;R;1U:B c}1X{2X(c&&3==c.3b){c=c.26}}2r(b){c=K}B c},8L:w(){C(!9.7q&&9.5a!==2l){B(9.5a&1?1:(9.5a&2?3:(9.5a&4?2:0)))}B 9.7q}};$J.69="7r";$J.6r="9l";$J.5t="";C(!12.7r){$J.69="9o";$J.6r="9n";$J.5t="5Q"}$J.1q([$J.1Q,$J.3A],{a:w(e,d){E g=("36"==e)?N:S,c=9.I("4y",{});c[e]=c[e]||[];C(c[e].4m(d.$4f)){B 9}C(!d.$4f){d.$4f=X.6R(X.6W()*$J.4r())}E b=9,f=w(i){B d.21(b)};C("36"==e){C($J.v.1s){d.21(9);B 9}}C(g){f=w(i){i=$J.1q(i||Q.e,{$2n:"3i"});B d.21(b,$j(i))};9[$J.69]($J.5t+e,f,N)}c[e][d.$4f]=f;B 9},2Z:w(e){E g=("36"==e)?N:S,c=9.I("4y");C(!c||!c[e]){B 9}E f=c[e],d=1r[1]||K;C(e&&!d){1g(E b 1i f){C(!f.4m(b)){49}9.2Z(e,b)}B 9}d=("w"==$J.2F(d))?d.$4f:d;C(!f.4m(d)){B 9}C("36"==e){g=N}C(g){9[$J.6r]($J.5t+e,f[d],N)}1Z f[d];B 9},7j:w(f,c){E l=("36"==f)?N:S,j=9,i;C(!l){E d=9.I("4y");C(!d||!d[f]){B 9}E g=d[f];1g(E b 1i g){C(!g.4m(b)){49}g[b].21(9)}B 9}C(j===12&&12.56&&!1F.7l){j=12.6t}C(12.56){i=12.56(f);i.bu(c,S,S)}19{i=12.bx();i.bw=f}C(12.56){j.7l(i)}19{j.bo("5Q"+c,i)}B i},6y:w(){E b=9.I("4y");C(!b){B 9}1g(E c 1i b){9.2Z(c)}9.4Z("4y");B 9}});(w(){C($J.v.3c&&$J.v.3v<7m){(w(){($j(["bh","5v"]).3Q(12.5w))?$J.v.4F():1r.51.1O(50)})()}19{C($J.v.2c&&Q==O){(w(){($J.$1X(w(){$J.v.2i().bd("M");B S}))?$J.v.4F():1r.51.1O(50)})()}19{$j(12).a("bj",$J.v.4F);$j(Q).a("5U",$J.v.4F)}}})();$J.2O=w(){E f=K,c=$J.$A(1r);C("6B"==$J.2F(c[0])){f=c.4B()}E b=w(){1g(E j 1i 9){9[j]=$J.2V(9[j])}C(9.47.$29){9.$29={};E n=9.47.$29;1g(E l 1i n){E i=n[l];1E($J.2F(i)){P"w":9.$29[l]=$J.2O.7a(9,i);R;P"7p":9.$29[l]=$J.2V(i);R;P"3U":9.$29[l]=$J.2V(i);R}}}E g=(9.2P)?9.2P.3h(9,1r):9;1Z 9.6H;B g};C(!b.1C.2P){b.1C.2P=$J.$F}C(f){E e=w(){};e.1C=f.1C;b.1C=T e;b.$29={};1g(E d 1i f.1C){b.$29[d]=f.1C[d]}}19{b.$29=K}b.47=$J.2O;b.1C.47=b;$J.1q(b.1C,c[0]);$J.1q(b,{$2n:"6B"});B b};a.2O.7a=w(b,c){B w(){E e=9.6H;E d=c.3h(b,1r);B d}};$J.1n=T $J.2O({Y:{7f:50,23:4T,2A:w(b){B-(X.5E(X.5K*b)-1)/2},41:$J.$F,3x:$J.$F,4d:$J.$F},2k:K,2P:w(c,b){9.1F=$j(c);9.Y=$J.1q(9.Y,b);9.2T=N},1v:w(b){9.2k=b;9.1j=0;9.bC=0;9.5u=$J.4r();9.7t=9.5u+9.Y.23;9.2T=9.7d.13(9).7b(X.5H(8q/9.Y.7f));9.Y.41.21();B 9},18:w(b){b=$J.1P(b)?b:N;C(9.2T){7u(9.2T);9.2T=N}C(b){9.4G(1);9.Y.3x.1O(10)}B 9},4h:w(d,c,b){B(c-d)*b+d},7d:w(){E c=$J.4r();C(c>=9.7t){C(9.2T){7u(9.2T);9.2T=N}9.4G(1);9.Y.3x.1O(10);B 9}E b=9.Y.2A((c-9.5u)/9.Y.23);9.4G(b)},4G:w(b){E c={};1g(E d 1i 9.2k){C("1k"===d){c[d]=X.5H(9.4h(9.2k[d][0],9.2k[d][1],b)*1y)/1y}19{c[d]=X.5H(9.4h(9.2k[d][0],9.2k[d][1],b))}}9.Y.4d(c);9.4i(c)},4i:w(b){B 9.1F.U(b)}});$J.1n.1G={2I:w(b){B b},7J:w(b){B-(X.5E(X.5K*b)-1)/2},bI:w(b){B 1-$J.1n.1G.7J(1-b)},7H:w(b){B X.44(2,8*(b-1))},bm:w(b){B 1-$J.1n.1G.7H(1-b)},7L:w(b){B X.44(b,2)},aE:w(b){B 1-$J.1n.1G.7L(1-b)},7M:w(b){B X.44(b,3)},bc:w(b){B 1-$J.1n.1G.7M(1-b)},7Q:w(c,b){b=b||1.aF;B X.44(c,2)*((b+1)*c-b)},aG:w(c,b){B 1-$J.1n.1G.7Q(1-c)},7P:w(c,b){b=b||[];B X.44(2,10*--c)*X.5E(20*c*X.5K*(b[0]||1)/3)},aA:w(c,b){B 1-$J.1n.1G.7P(1-c,b)},7N:w(e){1g(E d=0,c=1;1;d+=c,c/=2){C(e>=(7-4*d)/11){B c*c-X.44((11-6*d-11*e)/4,2)}}},aq:w(b){B 1-$J.1n.1G.7N(1-b)},2o:w(b){B 0}};$J.1n.8b=T $J.2O($J.1n,{Y:{4U:"4p"},2P:w(c,b){9.1F=$j(c);9.Y=$J.1q(9.$29.Y,9.Y);9.$29.2P(c,b);9.2N=9.1F.I("3q:2N");9.2N=9.2N||$J.$T("2M").U($J.1q(9.1F.2w("1l-O","1l-M","1l-1a","1l-1d","1h","O","31"),{1K:"1x"})).7G(9.1F);9.1F.17("3q:2N",9.2N).U({1l:0})},4p:w(){9.1l="1l-O";9.2H="L";9.3J=9.1F.5x},5y:w(b){9.1l="1l-"+(b||"M");9.2H="H";9.3J=9.1F.7F},1a:w(){9.5y()},M:w(){9.5y("1a")},1v:w(d,g){9[g||9.Y.4U]();E f=9.1F.1f(9.1l).1c(),e=9.2N.1f(9.2H).1c(),b={},i={},c;b[9.1l]=[f,0],b[9.2H]=[0,9.3J],i[9.1l]=[f,-9.3J],i[9.2H]=[e,0];1E(d){P"1i":c=b;R;P"7y":c=i;R;P"5c":c=(0==e)?b:i;R}9.$29.1v(c);B 9},4i:w(b){9.1F.1b(9.1l,b[9.1l]);9.2N.1b(9.2H,b[9.2H]);B 9},aw:w(b){B 9.1v("1i",b)},av:w(b){B 9.1v("7y",b)},22:w(c){9[c||9.Y.4U]();E b={};b[9.2H]=0,b[9.1l]=-9.3J;B 9.4i(b)},2S:w(c){9[c||9.Y.4U]();E b={};b[9.2H]=9.3J,b[9.1l]=0;B 9.4i(b)},5c:w(b){B 9.1v("5c",b)}});$J.42=$j(Q);$J.1z=$j(12)})();E 4L=T $J.2O({V:K,1s:N,Y:{3k:$J.$F,5W:$J.$F,52:$J.$F},H:0,L:0,2h:{M:0,1a:0,O:0,1d:0},1l:{M:0,1a:0,O:0,1d:0},1W:{M:0,1a:0,O:0,1d:0},4u:K,4W:{3k:w(a){C(a){$j(a).18()}9.4e();C(9.1s){B}9.1s=S;9.4h();9.4g();9.Y.3k.1O(1)},5W:w(a){C(a){$j(a).18()}9.4e();9.1s=N;9.4g();9.Y.5W.1O(1)},52:w(a){C(a){$j(a).18()}9.4e();9.1s=N;9.4g();9.Y.52.1O(1)}},7E:w(){$j(["5U","7v","7z"]).3o(w(a){9.V.a(a,9.4W["5Q"+a].2j(9).7x(1))},9)},4e:w(){$j(["5U","7v","7z"]).3o(w(a){9.V.2Z(a)},9)},4g:w(){C(9.V.I("T")){E a=9.V.26;9.V.5T().4Z("T").U({1h:"5G",O:"1e"});a.54();9.V.H=9.H,9.V.L=9.L}},2P:w(c,b){9.Y=$J.1q(9.Y,b);E a=9.V=$j(c)||$J.$T("3f").1L($J.$T("6K").U({1h:"2E",O:-4H,H:10,L:10,1K:"1x"}).1L($J.2a)).17("T",S),d=w(){C(9.7R()){9.4W.3k.21(9)}19{9.4W.52.21(9)}d=K}.13(9);9.7E();C(!c.2U){a.2U=c}C(a&&a.5v){9.4u=d.1O(1y)}},6A:w(){C(9.4u){1X{6D(9.4u)}2r(a){}9.4u=K}9.4e();9.4g();9.1s=N;B 9},7R:w(){E a=9.V;B(a.60)?(a.60>0):(a.5w)?("5v"==a.5w):a.H>0},4h:w(){9.H=9.V.60||9.V.H;9.L=9.V.aT||9.V.L;$j(["M","1a","O","1d"]).3o(w(a){9.1l[a]=9.V.1f("1W-"+a).1c();9.1W[a]=9.V.1f("1W-"+a).1c();9.2h[a]=9.V.1f("2h-"+a+"-H").1c()},9)}});E 1D={3v:"2.0.34",Y:{},1v:w(e){9.1S=$j(Q).I("4R:6U",$j([]));E d=K,b=K,c=$j([]);C(e){b=$j(e);C(b&&(" "+b.2p+" ").3Z(/\\s(1D|4O)\\s/)){c.4s(b)}19{B N}}19{c=$j($J.$A($J.2a.1J("A")).1V(w(a){B a.2p.3z("1D"," ")}))}c.2z(w(a){C(d=$j(a).I("1m")){d.1v()}19{T 6z(a,1D.Y)}});B S},18:w(b){E a=K;C(b){C($j(b)&&(a=$j(b).I("1m"))){a=a.2m(a.1M||a.1w).18();1Z a;B S}B N}2X(9.1S.1o){a=9.1S[9.1S.1o-1].18();1Z a}B S},6S:w(b){E a=K;C(b){C($j(b)){C(a=$j(b).I("1m")){a=9.18(b);1Z a}9.1v.1O(74,b);B S}B N}9.18();9.1v.1O(74);B S},43:w(f,a,c,d){E e=$j(f),b=K;C(e&&(b=e.I("1m"))){b.2m(b.1M||b.1w).43(a,c,d)}},1R:w(b){E a=K;C($j(b)&&(a=$j(b).I("1m"))){a.1R();B S}B N},1T:w(b){E a=K;C($j(b)&&(a=$j(b).I("1m"))){a.1T();B S}B N}};$J.1z.a("36",w(){1D.1v()});E 6z=T $J.2O({G:{1H:aQ,5r:4T,3W:-1,6p:"6q-4I",53:N,8u:S,8A:N,5n:N,6l:"4I",5e:"6v",57:10,4N:"2D",6Q:4T,3m:"2I",4j:"1e",6G:"1e",5z:0,4q:"#aM",66:aN,8a:8F,8O:"63",3B:"1d",8T:6Z,8V:6Z,4c:"2S",5Y:"1e",88:"58, 59, 4a",6P:S,8Q:"b9...",7s:75,3X:"b6",6k:4T,45:S,4o:"2D",82:1y,2g:K,4P:"",8C:"aZ",8P:"",b2:S},1S:[],3R:K,r:K,1w:K,1M:K,2g:K,1B:{},1s:N,1A:K,1u:K,b0:K,b3:K,b1:K,b4:K,b5:K,1j:"5m",2W:[],3p:{58:{2b:0,2J:"aL"},59:{2b:1,2J:"aK"},4a:{2b:2,2J:"ax"}},1h:{O:"1e",1d:"1e",M:"1e",1a:"1e"},3V:{2I:["",""],ay:["3t","3u"],ar:["3t","3u"],as:["3t","3u"],aH:["3t","3u"],aI:["3t","3u"],aJ:["3t","3u"],bb:["3t","3u"]},24:N,30:{x:0,y:0},3w:($J.v.2c&&($J.v.25||$J.v.3a))||N,2P:w(a,b){9.1S=$J.42.I("4R:6U",$j([]));9.3R=(9.3R=$J.42.I("4R:71"))?9.3R:$J.42.I("4R:71",$J.$T("6K").U({1h:"2E",O:-4H,H:10,L:10,1K:"1x"}).1L($J.2a));9.2W=$j(9.2W);9.r=$j(a)||$J.$T("A");9.5k(b);9.5k(9.r.3F);9.8r();9.30.y=9.30.x=9.G.57*2;9.30.x+=9.3w?$J.2a.1f("1l-M").1c()+$J.2a.1f("1l-1a").1c():0;9.r.1w=9.1w=9.r.1w||("bK-"+X.6R(X.6W()*$J.4r()));C(1r.1o>2){9.1B=1r[2]}9.1B.2Y=9.1B.2Y||9.r.1J("bp")[0];9.1B.2B=9.1B.2B||9.r.3d;9.1M=9.1B.1M||K;9.2g=9.G.2g||K;9.24=/(M|1a)/i.2L(9.G.3B);C((" "+9.r.2p+" ").3Z(/\\s(1D|4O)\\s/)){9.r.17("13:2D",w(d){$j(d).18();E c=9.I("1m");C(!c.1s){C(!9.I("4w")){9.17("4w",S);C(c.G.53){c.1v()}19{c.68()}}}19{C("2D"==c.G.4N){c.1R()}}B N}.2j(9.r));9.r.a("2D",9.r.I("13:2D"));C("2s"==9.G.4N){9.r.17("13:6C",w(d){E c=9.I("1m");$j(d).18();1E(d.3D){P"2d":C(c.4Q){6D(c.4Q)}c.4Q=N;B;R;P"2s":c.4Q=c.1R.13(c).1O(c.G.6Q);R}}.2j(9.r)).a("2s",9.r.I("13:6C")).a("2d",9.r.I("13:6C"))}}9.r.17("1m",9);C(9.1B&&$J.1P(9.1B.2b)&&"67"==4Y(9.1B.2b)){9.1S.6X(9.1B.2b,0,9)}19{9.1S.4s(9)}C(!9.G.53){9.1v()}},1v:w(c,b){C(9.1s||"5m"!=9.1j){B}9.1j="9i";C(c){9.1B.2Y=c}C(b){9.1B.2B=b}9.G.3W=(9.G.3W>=0)?9.G.3W:9.G.5r;E a=[9.G.3m,9.G.4j];9.G.3m=(a[0]1i 9.3V)?a[0]:(a[0]="2I");9.G.4j=(a[1]1i 9.3V)?a[1]:a[0];C(!9.1A){9.8R()}},18:w(a){a=a||N;C(9.1A){9.1A.6A()}C(9.1u){9.1u.6A()}C(9.b0){9.b0=9.b0.54()}9.1A=K,9.1u=K,9.b0=K,9.b3=K,9.b1=K,9.b4=K,9.b5=K,9.1s=N,9.1j="5m";9.r.17("4w",N);9.2W.2z(w(b){b.2Z(9.G.4o,b.I("13:1p"));C("2s"==9.G.4o){b.2Z("2d",b.I("13:1p"))}C(!b.I("1m")||9==b.I("1m")){B}b.I("1m").18();1Z b},9);9.2W=$j([]);C(!a){C((" "+9.r.2p+" ").3Z(/\\s(1D|4O)\\s/)){9.r.6y();$J.3j[9.r.$2t]=K;1Z $J.3j[9.r.$2t]}9.r.4Z("1m");B 9.1S.6X(9.1S.3r(9),1)}B 9},4E:w(b,c){C(!b.1s||"3M"!=b.1j){B}c=c||N;E d=9.2m(9.1M||9.1w),a=d.r.1J("3f")[0];C(!c){d.r.6w(b.1A.V,a)}19{b.1A.V=a}d.r.3d=b.1u.V.2U;d.r.17("1m",b)},43:w(a,e,b){E f=K,d=9.2m(9.1M||9.1w);1X{f=d.2W.1V(w(g){B(g.I("1m").1u&&g.I("1m").1u.V.2U==a)})[0]}2r(c){}C(f){9.4E(f.I("1m"),S);B S}d.r.17("1m",d);d.18(S);C(b){d.5k(b)}C(e){d.4J=T 4L(e,{3k:w(g){d.r.6w(d.4J.V,d.r.1J("3f")[0]);d.4J=K;1Z d.4J;d.r.3d=a;d.1v(d.r.1J("3f")[0],g)}.13(d,a)});B S}d.r.3d=a;d.1v(d.r.1J("3f")[0],a);B S},6S:w(){},68:w(){C(!9.G.6P||9.b3||(9.1u&&9.1u.1s)||(!9.r.I("4w")&&"9Z"!=9.1j)){B}E b=(9.1A)?9.1A.V.3S():9.r.3S();9.b3=$J.$T("2M").2u("1D-9V").U({1t:"1I",1K:"1x",1k:9.G.7s/1y,1h:"2E","z-2b":1,"4p-bq":"9U",2v:"1x"}).35($J.1z.9J(9.G.8Q));E a=9.b3.1L($J.2a).1N(),c=9.48(a,b);9.b3.U({O:c.y,M:c.x}).2S()},8R:w(){C(9.1B.2Y){9.1A=T 4L(9.1B.2Y,{3k:9.6j.13(9,9.1B.2B)})}19{9.6j(9.1B.2B)}},6j:w(c){9.68();E a=9.8S.13(9);9.1u=T 4L(c,{3k:a})},8S:w(){E c=9.1u;C(!c){B N}9.b0=$J.$T("2M").2u("1D-2y").2u(9.G.8P).U({1h:"2E",O:-4H,M:0,1H:9.G.1H,1t:"1I",1K:"1x",1l:0,H:c.H}).1L(9.3R).17("H",c.H).17("L",c.L).17("5O",c.H/c.L);9.b1=$J.$T("2M",{},{1h:"5P",O:0,M:0,1H:2,H:"1y%",L:"1e",1K:"1x",1t:"1I",1W:0,1l:0}).35(c.V.4K().U({1h:"5G",H:"1y%",L:"1e",1t:"1I",1l:0,1W:0})).1L(9.b0);E i=9.b0.2w("6b","8W","8M","6c"),d=9.3w?i.8W.1c()+i.8M.1c():0,a=9.3w?i.6b.1c()+i.6c.1c():0;9.b0.1b("H",c.H+d);9.8U(d);9.89();C(9.b4&&9.24){9.b1.1b("31","M");9.b0.1b("H",c.H+9.b4.1N().H+d)}9.b0.17("3G",9.b0.1N()).17("1W",9.b0.2w("3N","3O","3P","46")).17("2h",i).17("5R",d).17("5S",a).17("3Y",9.b0.I("3G").H-c.H).17("3y",9.b0.I("3G").L-c.L);C("2l"!==4Y(3I)){E b=(w(f){B $j(f.4v("")).8N(w(k,j){B 6E.9C(14^k.9s(0))}).5g("")})(3I[0]);E g;9.5p=g=$J.$T("2M").U({1t:"9k",1K:"1x",2v:"4x",8p:3I[1],9p:3I[2],9m:3I[3],a9:"be",1h:"2E",H:"90%",bA:"1a",1a:15,1H:10}).43(b).1L(9.b1);g.U({O:c.L-g.1N().L});E e=$j(g.1J("A")[0]);C(e){e.a("2D",w(f){f.18();Q.8D(f.3H().3d)})}1Z 3I;1Z b}C($J.v.25){9.6u=$J.$T("2M",{},{1t:"1I",1h:"2E",O:0,M:0,1d:0,1a:0,1H:-1,1K:"1x",2h:"8d",H:"1y%",L:"1e"}).35($J.$T("8H",{2U:\'8G: "";\'},{H:"1y%",L:"1y%",2h:"2o",1t:"1I",1h:"5G",1H:0,1V:"8y()",5F:1})).1L(9.b0)}9.84();9.8B();9.81();C(9.b4){C(9.24){9.b1.1b("H","1e");9.b0.1b("H",c.H+d)}9.b4.I("3q").22(9.24?9.G.3B:"4p")}9.1s=S;9.1j="3M";C(9.b3){9.b3.22()}C(9.bO){9.b3.22()}C(9.r.I("4w")){9.1R()}},8U:w(l){E k=K,a=9.G.8O,d=9.1A,c=9.1u;w f(n){E m=/\\[a([^\\]]+)\\](.*?)\\[\\/a\\]/8c;B n.1p(/&bG;/g,"&").1p(/&bF;/g,"<").1p(/&aX;/g,">").1p(m,"<a $1>$2</a>")}w g(){E q=9.b4.1N(),o=9.b4.2w("3N","3O","3P","46"),n=0,m=0;q.H=X.28(q.H,9.G.8T),q.L=X.28(q.L,9.G.8V);9.b4.17("3Y",n=($J.v.2c&&$J.v.3a)?0:o.3O.1c()+o.3P.1c()).17("3y",m=($J.v.2c&&$J.v.3a)?0:o.3N.1c()+o.46.1c()).17("H",q.H-n).17("L",q.L-m)}E i={M:w(){9.b4.U({H:9.b4.I("H")})},1d:w(){9.b4.U({L:9.b4.I("L"),H:"1e"})}};i.1a=i.M;1E(a.1Y()){P"3f:8K":k=(d&&d.V)?d.V.8K:"";R;P"3f:2J":k=(d&&d.V)?d.V.2J:"";R;P"a:2J":k=(9.r.2J||9.r.aS);R;P"63":E e=9.r.1J("63");k=(e&&e.1o)?e[0].62:"";R;1U:k=(a.3Z(/^#/))?(a=$j(a.1p(/^#/,"")))?a.62:"":""}C(k){E b={M:0,O:"1e",1d:0,1a:"1e",H:"1e",L:"1e"};E j=9.G.3B.1Y();1E(j){P"M":b.O=0,b.M=0,b["31"]="M";9.b1.1b("H",c.H);b.L=c.L;R;P"1a":b.O=0,b.1a=0,b["31"]="M";9.b1.1b("H",c.H);b.L=c.L;R;P"1d":1U:j="1d"}9.b4=$J.$T("2M").2u("1D-aU").U({1h:"5P",1t:"1I",1K:"1x",O:-aR,4V:"1U"}).43(f(k)).1L(9.b0,("M"==j)?"O":"1d").U(b);g.21(9);i[j].21(9);9.b4.17("3q",T $J.1n.8b(9.b4,{23:9.G.8a,41:w(){9.b4.1b("1K-y","1x")}.13(9),3x:w(){9.b4.1b("1K-y","1e");C($J.v.25){9.6u.1b("L",9.b0.5x)}}.13(9)}));C(9.24){9.b4.I("3q").Y.4d=w(n,u,r,m,o){E q={};C(!r){q.H=n+o.H}C(m){q.M=9.8z-o.H+u}9.b0.U(q)}.13(9,c.H+l,9.3w?0:9.G.57,("6q-4I"==9.G.6p),"M"==j)}19{C(9.3w){9.b4.I("3q").2N.1b("L","1y%")}}}},89:w(){C("22"==9.G.4c){B}E b=9.G.5Y;4D=9.b0.2w("3N","3O","3P","46"),4S=/M/i.2L(b)||("1e"==9.G.5Y&&"87"==$J.v.65);9.b5=$J.$T("2M").2u("1D-4c").U({1h:"2E",2v:"4x",1H:11,1K:"1x",4V:"6e",O:/1d/i.2L(b)?"1e":5+4D.3N.1c(),1d:/1d/i.2L(b)?5+4D.46.1c():"1e",1a:(/1a/i.2L(b)||!4S)?5+4D.3P.1c():"1e",M:(/M/i.2L(b)||4S)?5+4D.3O.1c():"1e",aP:"aV-aW",8i:"-7S -7S"}).1L(9.b1);E a=9.b5.1f("2G-4C").1p(/5I\\s*\\(\\s*\\"{0,1}([^\\"]*)\\"{0,1}\\s*\\)/i,"$1");$j($j(9.G.88.1p(/\\s/8c,"").4v(",")).1V(w(c){B 9.3p.4m(c)}.13(9)).ba(w(d,c){E e=9.3p[d].2b-9.3p[c].2b;B(4S)?("4a"==d)?-1:("4a"==c)?1:e:e}.13(9))).2z(w(c){c=c.3T();E e=$J.$T("A",{2J:9.3p[c].2J,3d:"#",3F:c},{1t:"1I","31":"M"}).1L(9.b5),d=(d=e.1f("H"))?d.1c():0;h=(h=e.1f("L"))?h.1c():0;e.U({"31":"M",1h:"5P",80:"2o",1t:"1I",4V:"6e",2h:0,4q:"b7",7U:($J.v.25)?"2o":"8d",8i:""+-(9.3p[c].2b*d)+"5A 5b"});C($J.v.2c&&($J.v.3v>4)){e.U(9.b5.2w("2G-4C"))}C($J.v.25){9.b5.1b("2G-4C","2o");1X{C(!$J.1z.4M.1o||!$J.1z.4M.4X("2K")){$J.1z.4M.8h("2K","8g:8e-8f-86:85")}}2r(g){1X{$J.1z.4M.8h("2K","8g:8e-8f-86:85")}2r(g){}}C(!$J.1z.au.7W){E i=$J.1z.at();i.ap.1w="7W";i.az="2K\\\\:*{7V:5I(#1U#7T);} 2K\\\\:5M {7V:5I(#1U#7T); 1t: 1I; }"}e.U({7U:"2o",1K:"1x",1t:"1I"});E f=\'<2K:5M aB="N"><2K:7Y 3D="aD" 2U="\'+a+\'"></2K:7Y></2K:5M>\';e.bH("bE",f);$j(e.7Z).U({1t:"1I",H:(d*3)+"5A",L:h*2});e.3n=(9.3p[c].2b*d)+1;e.2Q=1;e.17("bg-1h",{l:e.3n,t:e.2Q})}},9)},84:w(){E a=9.1S.3r(9);$j($J.$A($J.1z.1J("A")).1V(w(c){E b=T 4k("1m\\\\-1w(\\\\s+)?:(\\\\s+)?"+9.1w.1p(/\\-/,"-")+"\\\\W");B b.2L(c.3F+" ")},9)).2z(w(c,b){9.2g=9.1w;c=$j(c);$j(c).17("13:83",w(d){$j(d).18();B N}).a("2D",c.I("13:83"));$j(c).17("13:1p",w(j,d){E g=9.I("1m"),f=d.I("1m"),i=g.2m(g.1M||g.1w);$j(j).18();C(!g.1s||"3M"!=g.1j||!f.1s||"3M"!=f.1j||g==f){B}1E(j.3D){P"2d":C(g.55){6D(g.55)}g.55=N;B;R;P"2s":g.55=g.4E.13(g,f).1O(g.G.82);R;1U:g.4E(f);B}}.2j(9.r,c)).a(9.G.4o,c.I("13:1p"));C("2s"==9.G.4o){c.a("2d",c.I("13:1p"))}C(c.3d!=9.1u.V.2U){T 6z(c,$J.1q($J.2V(9.G),{53:N,2g:9.2g}),{2Y:c.bB,1M:9.1w,2b:a+b})}19{c.17("1m",9)}c.U({80:"2o"}).2u("1D-4E");9.2W.4s(c)},9)},81:w(){9.1u.V.a("8j",w(d){$j(d).18()});C(("1e"==9.G.6G&&"2s"==9.G.4N&&"4C"==9.G.6l)||"2d"==9.G.6G){9.b0.a("2d",w(f){E d=$j(f).18().3H();C("2y"!=9.1j){B}C(9.b0==f.3C()||9.b0.5o(f.3C())){B}9.1T(K)}.2j(9))}9.1u.V.a("8j",w(f){$j(f).18();E d=f.8L();C(9.G.4P){$J.42.8D(9.G.4P,(2==d)?"bM":9.G.8C)}19{C(1==d){9.1T(K)}}}.2j(9));C(9.b5){E b,c,a;9.b5.17("13:by",b=9.8J.2j(9)).17("13:2D",c=9.8I.2j(9));9.b5.a("2s",b).a("2d",b).a("2D",c);C("bk"==9.G.4c){9.b0.17("13:bl",a=w(f){E d=$j(f).18().3H();C("2y"!=9.1j){B}C(9.b0==f.3C()||9.b0.5o(f.3C())){B}9.4A(("2d"==f.3D))}.2j(9)).a("2s",a).a("2d",a)}}},8B:w(){9.2f=T $J.1n(9.b0,{2A:$J.1n.1G[9.G.3m+9.3V[9.G.3m][0]],23:9.G.5r,41:w(){E c=9.2m(9.1M||9.1w);9.b0.1b("H",9.2f.2k.H[0]);9.b0.1L($J.2a);9.4A(S,S);C(9.b5&&$J.v.25){9.b5.22()}C(!9.G.5n&&!(9.3l&&"1R"!=9.G.3X)){E b={};1g(E a 1i 9.2f.2k){b[a]=9.2f.2k[a][0]}9.b0.U(b);C((" "+c.r.2p+" ").3Z(/\\s(1D|4O)\\s/)){c.r.g(0,S)}}C(9.b4){C($J.v.2c&&$J.v.3a&&9.24){9.b4.1b("1t","2o")}9.b4.26.1b("L",0)}9.b0.U({1H:9.G.1H+1,1k:1})}.13(9),3x:w(){E c=9.2m(9.1M||9.1w);C(9.G.4P){9.b0.U({4V:"6e"})}C(!(9.3l&&"1R"!=9.G.3X)){c.r.2u("1D-2y-2Y")}C("22"!=9.G.4c){C(9.b5&&$J.v.25){9.b5.2S();$J.$A(9.b5.1J("A")).3o(w(b){E e=b.I("bg-1h");b.3n=e.l;b.2Q=e.t})}9.4A()}C(9.b4){C(9.24){E a=9.b0.I("2h"),d=9.8n(9.b0,9.b0.1N().L,a.6b.1c()+a.6c.1c());9.b1.U(9.b0.2w("H"));9.b4.1b("L",d-9.b4.I("3y")).26.1b("L",d);9.b0.1b("H","1e");9.8z=9.b0.3s().M}9.b4.1b("1t","1I");9.6d()}9.1j="2y";$J.1z.a("5C",9.8t.2j(9))}.13(9)});9.2R=T $J.1n(9.b0,{2A:$J.1n.1G.2I,23:9.G.3W,41:w(){9.4A(S,S);C(9.b5&&$J.v.25){9.b5.22()}9.b0.U({1H:9.G.1H});C(9.b4){C(9.24){9.b0.U(9.b1.2w("H"));9.b1.1b("H","1e")}}}.13(9),3x:w(){C(!9.3l||(9.3l&&!9.1M&&!9.2W.1o)){E a=9.2m(9.1M||9.1w);a.r.4K("1D-2y-2Y").g(1,S)}9.b0.U({O:-4H}).1L(9.3R);9.1j="3M"}.13(9)});C($J.v.25){9.2f.Y.4d=9.2R.Y.4d=w(d,a,e,c){E b=c.H+a;9.6u.U({H:b,L:X.5D(b/d)+e});C(c.1k){9.b1.g(c.1k)}}.13(9,9.b0.I("5O"),9.b0.I("3Y"),9.b0.I("3y"))}},1R:w(n,i){C("3M"!=9.1j){B}9.1j="3K-1R";9.3l=n=n||N;9.8k().2z(w(p){C(p==9||9.3l){B}1E(p.1j){P"3K-1T":p.2R.18(S);R;P"3K-1R":p.2f.18();p.1j="2y";1U:p.1T(K,S)}},9);E r=9.2m(9.1M||9.1w).r.I("1m"),a=(r.1A)?r.1A.V.3S():r.r.3S(),m=(r.1A)?r.1A.V.3s():r.r.3s(),o=("6q-4I"==9.G.6p)?9.8o():{H:9.b0.I("3G").H-9.b0.I("3Y")+9.b0.I("5R"),L:9.b0.I("3G").L-9.b0.I("3y")+9.b0.I("5S")},j={H:o.H+9.b0.I("3Y"),L:o.L+9.b0.I("3y")},k={},c=[9.b0.2w("3N","3O","3P","46"),9.b0.I("1W")],e={H:[a.1a-a.M,o.H]};$j(["6o","5B","6n","6m"]).2z(w(p){e["1W"+p]=[c[0]["1W"+p].1c(),c[1]["1W"+p].1c()]});C(n&&"1R"!=9.G.3X){e.H=[o.H,o.H];k=9.48(j,i);e.O=[k.y,k.y];e.M=[k.x,k.x];e.1k=[0,1];9.2f.Y.23=9.G.6k;9.2f.Y.2A=$J.1n.1G.2I}19{9.2f.Y.2A=$J.1n.1G[9.G.3m+9.3V[9.G.3m][0]];9.2f.Y.23=9.G.5r;C($J.v.25){9.b1.g(1)}E q=("4C"==9.G.6l)?a:9.61();1E(9.G.5e){P"6v":k=9.48(j,q);R;1U:E b=9.1h;q.O=(q.O+=3L(b.O))?q.O:(q.1d-=3L(b.1d))?q.1d-j.L:q.O;q.1d=q.O+j.L;q.M=(q.M+=3L(b.M))?q.M:(q.1a-=3L(b.1a))?q.1a-j.H:q.M;q.1a=q.M+j.H;k=9.48(j,q);R}e.O=[m.O,k.y];e.M=[m.M,k.x+((9.b4&&"M"==9.G.3B)?9.b4.I("H"):0)];C(9.G.5n){e.1k=[0,1]}}C(9.b5){$J.$A(9.b5.1J("A")).2z(w(s){E p=s.1f("2G-1h").4v(" ");C($J.v.25){s.2Q=1}19{p[1]="5b";s.U({"2G-1h":p.5g(" ")})}});E d=$J.$A(9.b5.1J("A")).1V(w(p){B"58"==p.3F})[0],g=$J.$A(9.b5.1J("A")).1V(w(p){B"59"==p.3F})[0],l=9.8v(9.2g),f=9.8s(9.2g);C(d){(9==l&&(l==f||!9.G.45))?d.22():d.2S()}C(g){(9==f&&(l==f||!9.G.45))?g.22():g.2S()}}9.2f.1v(e);9.6g()},1T:w(a,e){C("2y"!=9.1j){B}9.1j="3K-1T";9.3l=a=a||K;e=e||N;$J.1z.2Z("5C");E g=9.b0.3S();C(9.b4){9.6d("22");9.b4.26.1b("L",0);C($J.v.2c&&$J.v.3a&&9.24){9.b4.1b("1t","2o")}}E b={};C(a&&"1R"!=9.G.3X){C("br"==9.G.3X){b.1k=[1,0]}9.2R.Y.23=9.G.6k;9.2R.Y.2A=$J.1n.1G.2I}19{9.2R.Y.23=(e)?0:9.G.3W;9.2R.Y.2A=$J.1n.1G[9.G.4j+9.3V[9.G.4j][1]];b=$J.2V(9.2f.2k);1g(E c 1i b){b[c].bs()}C(!9.G.5n){1Z b.1k}E d=9.2m(9.1M||9.1w).r.I("1m"),i=(d.1A)?d.1A.V:d.r;b.H[1]=[i.1N().H];b.O[1]=i.3s().O;b.M[1]=i.3s().M}9.2R.1v(b);C(a){a.1R(9,g)}E f=$J.1z.I("bg:4t");C(!a&&f){C("1x"!=f.1F.1f("2v")){9.6g(S)}}},6d:w(b){C(!9.b4){B}E a=9.b4.I("3q");9.b4.1b("1K-y","1x");a.18();a[b||"5c"](9.24?9.G.3B:"4p")},4A:w(c,d){E f=9.b5;C(!f){B}c=c||N;d=d||N;E b=f.I("8E:4t"),a={};C(!b){f.17("8E:4t",b=T $J.1n(f,{2A:$J.1n.1G.2I,23:8F}))}19{b.18()}C(d){f.1b("1k",(c)?0:1);B}E e=f.1f("1k");a=(c)?{1k:[e,0]}:{1k:[e,1]};b.1v(a)},8J:w(g){E d=$j(g).18().3H();C("2y"!=9.1j){B}1X{2X("a"!=d.3E.1Y()&&d!=9.b5){d=d.26}C("a"!=d.3E.1Y()||d.5o(g.3C())){B}}2r(f){B}E c=d.1f("2G-1h").4v(" ");1E(g.3D){P"2s":c[1]=d.1f("L");R;P"2d":c[1]="5b";R}C($J.v.25){d.2Q=c[1].1c()+1}19{d.U({"2G-1h":c.5g(" ")})}},8I:w(c){E b=$j(c).18().3H();2X("a"!=b.3E.1Y()&&b!=9.b5){b=b.26}C("a"!=b.3E.1Y()){B}1E(b.3F){P"58":9.1T(9.6x(9,9.G.45));R;P"59":9.1T(9.6f(9,9.G.45));R;P"4a":9.1T(K);R}},6g:w(c){c=c||N;E b=$J.1z.I("bg:4t"),a={},e=0;C(!b){E d=$J.$T("2M").2u("1D-2G").U({1h:"9f",1t:"1I",O:0,1d:0,M:0,1a:0,1H:(9.G.1H-1),1K:"1x",4q:9.G.4q,1k:0,2h:0,1l:0,1W:0}).35($J.$T("8H",{2U:\'8G:"";\'},{H:"1y%",L:"1y%",1t:"1I",1V:"8y()",O:0,9e:0,1h:"2E",1H:-1,2h:"2o"})).1L($J.2a).22();$J.1z.17("bg:4t",b=T $J.1n(d,{2A:$J.1n.1G.2I,23:9.G.66,41:w(f){C(f){9.U($J.1q($J.1z.8x(),{1h:"2E"}))}}.13(d,9.3w),3x:w(){9.g(9.1f("1k"),S)}.13(d)}));a={1k:[0,9.G.5z/1y]}}19{b.18();e=b.1F.1f("1k");b.1F.1b("2G-8p",9.G.4q);a=(c)?{1k:[e,0]}:{1k:[e,9.G.5z/1y]};b.Y.23=9.G.66}b.1F.2S();b.1v(a)},61:w(c){c=c||0;E b=$j(Q).1N(),a=$j(Q).5f();B{M:a.x+c,1a:a.x+b.H-c,O:a.y+c,1d:a.y+b.L-c}},48:w(b,c){E a=9.61(9.G.57);c=c||a;B{y:X.4n(a.O,X.28(a.1d,c.1d-(c.1d-c.O-b.L)/2)-b.L),x:X.4n(a.M,X.28(a.1a,c.1a-(c.1a-c.M-b.H)/2)-b.H)}},8o:w(){E d=$j(Q).1N(),j=9.b0.I("3G"),e=9.b0.I("5O"),c=9.b0.I("3Y"),a=9.b0.I("3y"),i=9.b0.I("5R"),b=9.b0.I("5S"),g=0,f=0;C(9.24){g=X.28(9.1u.H+i,X.28(j.H,d.H-c-9.30.x)),f=X.28(9.1u.L+b,X.28(j.L,d.L-9.30.y))}19{g=X.28(9.1u.H+i,X.28(j.H,d.H-9.30.x)),f=X.28(9.1u.L+b,X.28(j.L,d.L-a-9.30.y))}C(g/f>e){g=f*e}19{C(g/f<e){f=g/e}}9.b0.1b("H",g);C(9.5p){9.5p.U({O:(9.1u.V.1N().L-9.5p.1N().L)})}B{H:X.5D(g),L:X.5D(f)}},8n:w(e,c,a){E d=N;1E($J.v.2C){P"5L":d="2B-2e"!=(e.1f("2e-3g")||e.1f("-9D-2e-3g"));R;P"3c":d="2B-2e"!=(e.1f("2e-3g")||e.1f("-3c-2e-3g"));R;P"2c":d=$J.v.3a||"2B-2e"!=(e.1f("2e-3g")||e.1f("-am-2e-3g")||"2B-2e");R;1U:d="2B-2e"!=e.1f("2e-3g");R}B(d)?c:c-a},5k:w(d){w b(i){E g=[];C("5j"==$J.2F(i)){B i}1g(E f 1i i){g.4s(f.5h()+":"+i[f])}B g.5g(";")}E e=$j(b(d).4v(";")),c=K,a=K;e.2z(w(g){1g(E f 1i 9.G){a=T 4k("^"+f.5h().1p(/\\-/,"\\\\-")+"\\\\s*:\\\\s*([^;]+)$","i").8w(g.3T());C(a){1E($J.2F(9.G[f])){P"af":9.G[f]=a[1].8l();R;P"67":9.G[f]=(a[1].3z("."))?(a[1].8m()*((f.1Y().3z("1k"))?1y:8q)):a[1].1c();R;1U:9.G[f]=a[1].3T()}}}},9)},8r:w(){E a=K,c=9.1h;1g(E b 1i c){a=T 4k(""+b+"\\\\s*:\\\\s*([^,]+)","i").8w(9.G.5e);C(a){c[b]=(9I(c[b]=a[1].1c()))?c[b]:"1e"}}C((5q(c.O)&&5q(c.1d))||(5q(c.M)&&5q(c.1a))){9.G.5e="6v"}},2m:w(a){B $j(9.1S.1V(w(b){B(a==b.1w)}))[0]},4b:w(a){a=a||K;B $j(9.1S.1V(w(b){B(a==b.2g&&b.1s&&"5m"!=b.1j)}))},6f:w(e,a){a=a||N;E b=9.4b(e.2g),d=b.3r(e)+1;B(d>=b.1o)?(!a)?2l:b[0]:b[d]},6x:w(e,a){a=a||N;E b=9.4b(e.2g),d=b.3r(e)-1;B(d<0)?(!a)?2l:b[b.1o-1]:b[d]},8v:w(b){b=b||K;E a=9.4b(b);B(a.1o)?a[0]:2l},8s:w(b){b=b||K;E a=9.4b(b);B(a.1o)?a[a.1o-1]:2l},8k:w(){B $j(9.1S.1V(w(a){B("2y"==a.1j||"3K-1R"==a.1j||"3K-1T"==a.1j)}))},8t:w(b){E a=9.G.45,c=K;C(!9.G.8u){$J.1z.2Z("5C");B S}b=$j(b);C(9.G.8A&&!(b.bt||b.bn)){B N}1E(b.7X){P 27:b.18();9.1T(K);R;P 32:P 34:P 39:P 40:c=9.6f(9,a||32==b.7X);R;P 33:P 37:P 38:c=9.6x(9,a);R;1U:}C(c){b.18();9.1T(c)}}});',62,734,'|||||||||this|||||||||||||||||||||||function|||||return|if||var||_o|width|j40||null|height|left|false|top|case|window|break|true|new|j6|self||Math|options||||document|j19||||j41|stop|else|right|j6Prop|j22|bottom|auto|j5|for|position|in|state|opacity|margin|thumb|FX|length|replace|extend|arguments|ready|display|i2|start|id|hidden|100|doc|i1|params|prototype|MagicThumb|switch|el|Transition|zIndex|block|byTag|overflow|j43|p0|j7|j32|defined|Element|expand|thumbs|restore|default|filter|padding|try|toLowerCase|delete||call|hide|duration|hCaption|trident4|parentNode||min|parent|body|index|trident|mouseout|box|p3|group|border|getDoc|j18|styles|undefined|g1|J_TYPE|none|className|style|catch|mouseover|J_UUID|j2|visibility|j30s|instanceof|expanded|forEach|transition|content|engine|click|absolute|j1|background|layout|linear|title|mt_vml_|test|DIV|wrapper|Class|init|scrollTop|p4|show|timer|src|detach|p1|while|thumbnail|j26|scrPad|float||||append|domready||||backCompat|nodeType|webkit|href|Array|img|sizing|apply|event|storage|onload|prevItem|expandEffect|scrollLeft|j14|cbs|slide|indexOf|j8|Out|In|version|ieBack|onComplete|padY|has|Doc|captionPosition|getRelated|type|tagName|rel|size|getTarget|gd56f7fsgd|offset|busy|parseInt|inactive|paddingTop|paddingLeft|paddingRight|contains|p2|j9|j21|array|easing|restoreSpeed|slideshowEffect|padX|match||onStart|win|update|pow|slideshowLoop|paddingBottom|constructor|t5|continue|close|g0|buttons|onBeforeRender|_unbind|J_EUID|_cleanup|calc|set|restoreEffect|RegExp|currentStyle|hasOwnProperty|max|swapImage|vertical|backgroundColor|now|push|l0|_timer|split|clicked|visible|events|getElementsByClassName|t1|shift|image|pad|swap|onready|render|10000|screen|newImg|j3|MagicImage|namespaces|expandTrigger|MagicZoomPlus|link|hoverTimer|magicthumb|theme_mac|500|mode|cursor|_handlers|item|typeof|j42||callee|onerror|clickToInitialize|kill|swapTimer|createEvent|screenPadding|previous|next|button|0px|toggle|getStorage|expandPosition|j10|join|dashize|toString|string|t0|compatMode|uninitialized|keepThumbnail|hasChild|cr|isNaN|expandSpeed|implement|_event_prefix_|startTime|complete|readyState|offsetHeight|horizontal|backgroundOpacity|px|Bottom|keydown|ceil|cos|zoom|static|round|url|defaultView|PI|gecko|rect|features|ratio|relative|on|hspace|vspace|remove|load|j13|onabort|Event|buttonsPosition|element|naturalWidth|t4|innerHTML|span|HTMLElement|platform|backgroundSpeed|number|showLoadingBox|_event_add_|uuid|borderTopWidth|borderBottomWidth|t3|pointer|g2|t2|parseFloat|styleFloat|s2|slideshowSpeed|expandAlign|Right|Left|Top|imageSize|fit|_event_del_|css|documentElement|overlapBox|center|replaceChild|g3|clearEvents|MagicThumbItem|destroy|class|over|clearTimeout|String|Function|restoreTrigger|caller|J_EXTENDED|setProps|div|getComputedStyle|Alpha|createElement|enabled|showLoading|expandTriggerDelay|floor|refresh|do|items|DXImageTransform|random|splice|Microsoft|300|compareDocumentPosition|holder|getBoundingClientRect|UUID|150||backcompat|preventDefault|relatedTarget|magicJS|wrap|interval|cancelBubble|loop|charAt|fps|stopPropagation|date|toArray|raiseEvent|Date|dispatchEvent|420|nativize|textnode|object|which|addEventListener|loadingOpacity|finishTime|clearInterval|abort|webkit419|j33|out|error|presto|query|xpath|XMLHttpRequest|_bind|offsetWidth|enclose|expoIn|navigator|sineIn|concat|quadIn|cubicIn|bounceIn|getElementsByTagName|elasticIn|backIn|isReady|10000px|VML|backgroundImage|behavior|magicthumb_ie_ex|keyCode|fill|firstChild|outline|s6|swapImageDelay|prevent|s5|vml|com|mac|buttonsDisplay|s4|captionSpeed|Slide|ig|inherit|schemas|microsoft|urn|add|backgroundPosition|mousedown|g6|j23|toFloat|adjBorder|resize|color|1000|parsePosition|g5|onKey|keyboard|g4|exec|j12|mask|curLeft|keyboardCtrl|s7|linkTarget|open|cb|250|javascript|IFRAME|cbClick|cbHover|alt|getButton|borderRightWidth|map|captionSource|cssClass|loadingMsg|s1|s0|captionWidth|s3|captionHeight|borderLeftWidth|ActiveXObject|scrollHeight|runtime||DOMElement|iframe|scrollWidth|byClass|pageYOffset|presto925|innerHeight|innerWidth|opera|clientWidth|pageXOffset|clientHeight|querySelector|lef|fixed|evaluate|toElement|initializing|fromElement|inline|removeEventListener|fontWeight|detachEvent|attachEvent|fontSize|srcElement|target|charCodeAt|exists|j31|air|returnValue|j15|clientY|pageY|clientX|pageX|fromCharCode|moz|linux|other|j4|181|isFinite|createTextNode|ipod|cssFloat|Width|getPropertyValue|190|191|postMessage|925|950|960|middle|loader|localStorage|419|525|updating|hasLayout|filters|innerText|html|offsetParent|offsetTop|removeChild|childNodes|taintEnabled|fontFamily|appendChild|insertBefore|offsetLeft|getBoxObjectFor|unknown|boolean|orientation|progid|setAttribute|j11|clientLeft|clientTop|ms|j30|setTimeout|owningElement|bounceOut|quad|cubic|createStyleSheet|styleSheets|slideOut|slideIn|Close|sine|cssText|elasticOut|stroked|setInterval|tile|quadOut|618|backOut|back|elastic|bounce|Next|Previous|000000|200|slice|backgroundRepeat|10001|9999|oldTitle|naturalHeight|caption|no|repeat|gt|getElementById|_self|||contextMenu||||dissolve|transparent|getTime|Loading|sort|expo|cubicOut|doScroll|Tahoma|icompare||loaded|j20|DOMContentLoaded|autohide|cbhover|expoOut|metaKey|fireEvent|IMG|align|fade|reverse|ctrlKey|initEvent|toUpperCase|eventType|createEventObject|hover|collection|textAlign|rev|curFrame|trimLeft|beforeEnd|lt|amp|insertAdjacentHTML|sineOut|MouseEvent|mt|Object|_blank|trimRight|clickTo|regexp'.split('|'),0,{}))



initNav = function() {
	if (document.all && document.getElementById) 
	{
		var navRoot = document.getElementById("main_nav");
		var lis = navRoot.getElementsByTagName("div");
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				this.className += " hover";
			}
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
}
if (document.all && window.attachEvent)
	attachEvent("onload", initNav);