

			  	
	/**
	 * valtozok deklaralasa
	 */	  
		var fejlec			=	'uj_akcio_panel_fejlec';
		var panel			=	'uj_akcio_panel_tartalom';
		var legujabb		=	'uj_termekek_div';
		var akcios			=	'akcios_termekek_div';
		
   
   /**
	* kategoria nyitas
	* @author aqua (info@dws.hu)
	* @since 2008. 05. 26.
	*/		    
		function kat_ny(id) {
			
			/**
			 * valtozok deklaralasa
			 */	
				var div_fejlec		=	document.getElementById(fejlec);
				
				var div_panel		=	document.getElementById(panel);
				var div_legujabb 	= 	document.getElementById(legujabb);
				var div_akcios 		= 	document.getElementById(akcios);			
			
			
			/**
			 * legujabb
			 */	
				if (id == legujabb) {
					
					if (div_legujabb.style.display == 'none'	&&	
						div_panel.style.display    == '') 	 	 {
					
						div_legujabb.style.display 	= 	'';
						div_akcios.style.display 	= 	'none';
						$.cookie("ua", "101", { path: '/', expires: 10 });
						
					}
				
					else if (div_legujabb.style.display == 'none'	&&	
							 div_panel.style.display  	== 'none') 	 {	
						
						div_panel.style.display 	= 	''; 	
						div_legujabb.style.display 	= 	'';
						$.cookie("ua", "100", { path: '/', expires: 10 });
												 	
							 	
					}		 				
					
					else {
						
						div_legujabb.style.display 	= 	'none';
						div_panel.style.display 	= 	'none';
						$.cookie("ua", "111", { path: '/', expires: 10 });
						
					}
					
					div_fejlec.style.backgroundImage = "url('./resources/image/vaz/hu/hatter-termek-uj-akcios-kereses-01.jpg')";
					
				}
			
			
			/**
			 * akcios
			 */	
				if (id == akcios) {
					
					if (div_akcios.style.display == 'none'	&&	
						div_panel.style.display  == '') 	 {
					
						div_legujabb.style.display 	= 	'none';
						div_akcios.style.display 	= 	'';
						$.cookie("ua", '201', { path: '/', expires: 10 });
						
					}
					
					else if (div_akcios.style.display == 'none'		&&	
							 div_panel.style.display  == 'none') 	 {	
						
						div_panel.style.display 	= 	''; 	
						div_akcios.style.display 	= 	'';
						$.cookie("ua", '200', { path: '/', expires: 10 });
												 	
							 	
					}		 				
					
					else {
						
						div_akcios.style.display 	= 	'none';
						div_panel.style.display 	= 	'none';
						$.cookie("ua", '211', { path: '/', expires: 10 });
						
					}
					
					div_fejlec.style.backgroundImage = "url('./resources/image/vaz/hu/hatter-termek-uj-akcios-kereses-02.jpg')";
					
				}	
			
		}



	/**
	 * e-mail cim csere 
	 */
		function email(cim, link, url) {

			var nev 	= cim;
			var domain	= new Array();
			domain[0] 	= "dublino.hu";
			domain[1] 	= "dublino.at";
			domain[2] 	= "dublino.ro";
			domain[3] 	= "dublino.sk";
			
			switch (link) {
			
				case 0:
				default:
					document.write(nev + '@' + domain[url]);
						break;
					
				case 1:	
					document.write('<a href=\"mailto:' + nev + '@' + domain[url] + '\" title=\"' + nev + '@' + domain[url] + '\">' + nev + '@' + domain[url] + '</a>');
						break;
						
				case 2:	
					document.write('<a href=\"mailto:' + nev + '@' + domain[url] + '\" title=\"' + nev + '@' + domain[url] + '\"><b>' + nev + '@' + domain[url] + '</b></a>');
						break;									
						
			}			
			
		}
		

	/**
	 * checkbox csere
	 */	
		function checkbox(i) {
			
			id = document.getElementById(i);
			
			switch (i) {
			
				case 'szures_sorrend_csokkeno':

					document.getElementById('szures_sorrend_csokkeno').checked = true;
					document.getElementById('szures_sorrend_novekvo').checked = false;
						
						break;
				
				case 'szures_sorrend_novekvo':

					document.getElementById('szures_sorrend_csokkeno').checked = false;
					document.getElementById('szures_sorrend_novekvo').checked = true;
					
						break;
					
			}
			
			
		}

(function(){
/*
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
 * $Rev: 5685 $
 */

// Map over jQuery in case of overwrite
var _jQuery = window.jQuery,
// Map over the $ in case of overwrite
	_$ = window.$;

var jQuery = window.jQuery = window.$ = function( selector, context ) {
	// The jQuery object is actually just the init constructor 'enhanced'
	return new jQuery.fn.init( selector, context );
};

// A simple way to check for HTML strings or ID strings
// (both of which we optimize for)
var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,

// Is it a simple selector
	isSimple = /^.[^:#\[\.]*$/,

// Will speed up references to undefined, and allows munging its name.
	undefined;

jQuery.fn = jQuery.prototype = {
	init: function( selector, context ) {
		// Make sure that a selection was provided
		selector = selector || document;

		// Handle $(DOMElement)
		if ( selector.nodeType ) {
			this[0] = selector;
			this.length = 1;
			return this;
		}
		// Handle HTML strings
		if ( typeof selector == "string" ) {
			// Are we dealing with HTML string or an ID?
			var match = quickExpr.exec( selector );

			// Verify a match, and that no context was specified for #id
			if ( match && (match[1] || !context) ) {

				// HANDLE: $(html) -> $(array)
				if ( match[1] )
					selector = jQuery.clean( [ match[1] ], context );

				// HANDLE: $("#id")
				else {
					var elem = document.getElementById( match[3] );

					// Make sure an element was located
					if ( elem ){
						// Handle the case where IE and Opera return items
						// by name instead of ID
						if ( elem.id != match[3] )
							return jQuery().find( selector );

						// Otherwise, we inject the element directly into the jQuery object
						return jQuery( elem );
					}
					selector = [];
				}

			// HANDLE: $(expr, [context])
			// (which is just equivalent to: $(content).find(expr)
			} else
				return jQuery( context ).find( selector );

		// HANDLE: $(function)
		// Shortcut for document ready
		} else if ( jQuery.isFunction( selector ) )
			return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );

		return this.setArray(jQuery.makeArray(selector));
	},

	// The current version of jQuery being used
	jquery: "1.2.6",

	// The number of elements contained in the matched element set
	size: function() {
		return this.length;
	},

	// The number of elements contained in the matched element set
	length: 0,

	// Get the Nth element in the matched element set OR
	// Get the whole matched element set as a clean array
	get: function( num ) {
		return num == undefined ?

			// Return a 'clean' array
			jQuery.makeArray( this ) :

			// Return just the object
			this[ num ];
	},

	// Take an array of elements and push it onto the stack
	// (returning the new matched element set)
	pushStack: function( elems ) {
		// Build a new jQuery matched element set
		var ret = jQuery( elems );

		// Add the old object onto the stack (as a reference)
		ret.prevObject = this;

		// Return the newly-formed element set
		return ret;
	},

	// Force the current matched set of elements to become
	// the specified array of elements (destroying the stack in the process)
	// You should use pushStack() in order to do this, but maintain the stack
	setArray: function( elems ) {
		// Resetting the length to 0, then using the native Array push
		// is a super-fast way to populate an object with array-like properties
		this.length = 0;
		Array.prototype.push.apply( this, elems );

		return this;
	},

	// Execute a callback for every element in the matched set.
	// (You can seed the arguments with an array of args, but this is
	// only used internally.)
	each: function( callback, args ) {
		return jQuery.each( this, callback, args );
	},

	// Determine the position of an element within
	// the matched set of elements
	index: function( elem ) {
		var ret = -1;

		// Locate the position of the desired element
		return jQuery.inArray(
			// If it receives a jQuery object, the first element is used
			elem && elem.jquery ? elem[0] : elem
		, this );
	},

	attr: function( name, value, type ) {
		var options = name;

		// Look for the case where we're accessing a style value
		if ( name.constructor == String )
			if ( value === undefined )
				return this[0] && jQuery[ type || "attr" ]( this[0], name );

			else {
				options = {};
				options[ name ] = value;
			}

		// Check to see if we're setting style values
		return this.each(function(i){
			// Set all the styles
			for ( name in options )
				jQuery.attr(
					type ?
						this.style :
						this,
					name, jQuery.prop( this, options[ name ], type, i, name )
				);
		});
	},

	css: function( key, value ) {
		// ignore negative width and height values
		if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
			value = undefined;
		return this.attr( key, value, "curCSS" );
	},

	text: function( text ) {
		if ( typeof text != "object" && text != null )
			return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );

		var ret = "";

		jQuery.each( text || this, function(){
			jQuery.each( this.childNodes, function(){
				if ( this.nodeType != 8 )
					ret += this.nodeType != 1 ?
						this.nodeValue :
						jQuery.fn.text( [ this ] );
			});
		});

		return ret;
	},

	wrapAll: function( html ) {
		if ( this[0] )
			// The elements to wrap the target around
			jQuery( html, this[0].ownerDocument )
				.clone()
				.insertBefore( this[0] )
				.map(function(){
					var elem = this;

					while ( elem.firstChild )
						elem = elem.firstChild;

					return elem;
				})
				.append(this);

		return this;
	},

	wrapInner: function( html ) {
		return this.each(function(){
			jQuery( this ).contents().wrapAll( html );
		});
	},

	wrap: function( html ) {
		return this.each(function(){
			jQuery( this ).wrapAll( html );
		});
	},

	append: function() {
		return this.domManip(arguments, true, false, function(elem){
			if (this.nodeType == 1)
				this.appendChild( elem );
		});
	},

	prepend: function() {
		return this.domManip(arguments, true, true, function(elem){
			if (this.nodeType == 1)
				this.insertBefore( elem, this.firstChild );
		});
	},

	before: function() {
		return this.domManip(arguments, false, false, function(elem){
			this.parentNode.insertBefore( elem, this );
		});
	},

	after: function() {
		return this.domManip(arguments, false, true, function(elem){
			this.parentNode.insertBefore( elem, this.nextSibling );
		});
	},

	end: function() {
		return this.prevObject || jQuery( [] );
	},

	find: function( selector ) {
		var elems = jQuery.map(this, function(elem){
			return jQuery.find( selector, elem );
		});

		return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ?
			jQuery.unique( elems ) :
			elems );
	},

	clone: function( events ) {
		// Do the clone
		var ret = this.map(function(){
			if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) {
				// IE copies events bound via attachEvent when
				// using cloneNode. Calling detachEvent on the
				// clone will also remove the events from the orignal
				// In order to get around this, we use innerHTML.
				// Unfortunately, this means some modifications to
				// attributes in IE that are actually only stored
				// as properties will not be copied (such as the
				// the name attribute on an input).
				var clone = this.cloneNode(true),
					container = document.createElement("div");
				container.appendChild(clone);
				return jQuery.clean([container.innerHTML])[0];
			} else
				return this.cloneNode(true);
		});

		// Need to set the expando to null on the cloned set if it exists
		// removeData doesn't work here, IE removes it from the original as well
		// this is primarily for IE but the data expando shouldn't be copied over in any browser
		var clone = ret.find("*").andSelf().each(function(){
			if ( this[ expando ] != undefined )
				this[ expando ] = null;
		});

		// Copy the events from the original to the clone
		if ( events === true )
			this.find("*").andSelf().each(function(i){
				if (this.nodeType == 3)
					return;
				var events = jQuery.data( this, "events" );

				for ( var type in events )
					for ( var handler in events[ type ] )
						jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
			});

		// Return the cloned set
		return ret;
	},

	filter: function( selector ) {
		return this.pushStack(
			jQuery.isFunction( selector ) &&
			jQuery.grep(this, function(elem, i){
				return selector.call( elem, i );
			}) ||

			jQuery.multiFilter( selector, this ) );
	},

	not: function( selector ) {
		if ( selector.constructor == String )
			// test special case where just one selector is passed in
			if ( isSimple.test( selector ) )
				return this.pushStack( jQuery.multiFilter( selector, this, true ) );
			else
				selector = jQuery.multiFilter( selector, this );

		var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
		return this.filter(function() {
			return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
		});
	},

	add: function( selector ) {
		return this.pushStack( jQuery.unique( jQuery.merge(
			this.get(),
			typeof selector == 'string' ?
				jQuery( selector ) :
				jQuery.makeArray( selector )
		)));
	},

	is: function( selector ) {
		return !!selector && jQuery.multiFilter( selector, this ).length > 0;
	},

	hasClass: function( selector ) {
		return this.is( "." + selector );
	},

	val: function( value ) {
		if ( value == undefined ) {

			if ( this.length ) {
				var elem = this[0];

				// We need to handle select boxes special
				if ( jQuery.nodeName( elem, "select" ) ) {
					var index = elem.selectedIndex,
						values = [],
						options = elem.options,
						one = elem.type == "select-one";

					// Nothing was selected
					if ( index < 0 )
						return null;

					// Loop through all the selected options
					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
						var option = options[ i ];

						if ( option.selected ) {
							// Get the specifc value for the option
							value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value;

							// We don't need an array for one selects
							if ( one )
								return value;

							// Multi-Selects return an array
							values.push( value );
						}
					}

					return values;

				// Everything else, we just grab the value
				} else
					return (this[0].value || "").replace(/\r/g, "");

			}

			return undefined;
		}

		if( value.constructor == Number )
			value += '';

		return this.each(function(){
			if ( this.nodeType != 1 )
				return;

			if ( value.constructor == Array && /radio|checkbox/.test( this.type ) )
				this.checked = (jQuery.inArray(this.value, value) >= 0 ||
					jQuery.inArray(this.name, value) >= 0);

			else if ( jQuery.nodeName( this, "select" ) ) {
				var values = jQuery.makeArray(value);

				jQuery( "option", this ).each(function(){
					this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
						jQuery.inArray( this.text, values ) >= 0);
				});

				if ( !values.length )
					this.selectedIndex = -1;

			} else
				this.value = value;
		});
	},

	html: function( value ) {
		return value == undefined ?
			(this[0] ?
				this[0].innerHTML :
				null) :
			this.empty().append( value );
	},

	replaceWith: function( value ) {
		return this.after( value ).remove();
	},

	eq: function( i ) {
		return this.slice( i, i + 1 );
	},

	slice: function() {
		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
	},

	map: function( callback ) {
		return this.pushStack( jQuery.map(this, function(elem, i){
			return callback.call( elem, i, elem );
		}));
	},

	andSelf: function() {
		return this.add( this.prevObject );
	},

	data: function( key, value ){
		var parts = key.split(".");
		parts[1] = parts[1] ? "." + parts[1] : "";

		if ( value === undefined ) {
			var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);

			if ( data === undefined && this.length )
				data = jQuery.data( this[0], key );

			return data === undefined && parts[1] ?
				this.data( parts[0] ) :
				data;
		} else
			return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
				jQuery.data( this, key, value );
			});
	},

	removeData: function( key ){
		return this.each(function(){
			jQuery.removeData( this, key );
		});
	},

	domManip: function( args, table, reverse, callback ) {
		var clone = this.length > 1, elems;

		return this.each(function(){
			if ( !elems ) {
				elems = jQuery.clean( args, this.ownerDocument );

				if ( reverse )
					elems.reverse();
			}

			var obj = this;

			if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) )
				obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") );

			var scripts = jQuery( [] );

			jQuery.each(elems, function(){
				var elem = clone ?
					jQuery( this ).clone( true )[0] :
					this;

				// execute all scripts after the elements have been injected
				if ( jQuery.nodeName( elem, "script" ) )
					scripts = scripts.add( elem );
				else {
					// Remove any inner scripts for later evaluation
					if ( elem.nodeType == 1 )
						scripts = scripts.add( jQuery( "script", elem ).remove() );

					// Inject the elements into the document
					callback.call( obj, elem );
				}
			});

			scripts.each( evalScript );
		});
	}
};

// Give the init function the jQuery prototype for later instantiation
jQuery.fn.init.prototype = jQuery.fn;

function evalScript( i, elem ) {
	if ( elem.src )
		jQuery.ajax({
			url: elem.src,
			async: false,
			dataType: "script"
		});

	else
		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );

	if ( elem.parentNode )
		elem.parentNode.removeChild( elem );
}

function now(){
	return +new Date;
}

jQuery.extend = jQuery.fn.extend = function() {
	// copy reference to target object
	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;

	// Handle a deep copy situation
	if ( target.constructor == Boolean ) {
		deep = target;
		target = arguments[1] || {};
		// skip the boolean and the target
		i = 2;
	}

	// Handle case when target is a string or something (possible in deep copy)
	if ( typeof target != "object" && typeof target != "function" )
		target = {};

	// extend jQuery itself if only one argument is passed
	if ( length == i ) {
		target = this;
		--i;
	}

	for ( ; i < length; i++ )
		// Only deal with non-null/undefined values
		if ( (options = arguments[ i ]) != null )
			// Extend the base object
			for ( var name in options ) {
				var src = target[ name ], copy = options[ name ];

				// Prevent never-ending loop
				if ( target === copy )
					continue;

				// Recurse if we're merging object values
				if ( deep && copy && typeof copy == "object" && !copy.nodeType )
					target[ name ] = jQuery.extend( deep, 
						// Never move original objects, clone them
						src || ( copy.length != null ? [ ] : { } )
					, copy );

				// Don't bring in undefined values
				else if ( copy !== undefined )
					target[ name ] = copy;

			}

	// Return the modified object
	return target;
};

var expando = "jQuery" + now(), uuid = 0, windowData = {},
	// exclude the following css properties to add px
	exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
	// cache defaultView
	defaultView = document.defaultView || {};

jQuery.extend({
	noConflict: function( deep ) {
		window.$ = _$;

		if ( deep )
			window.jQuery = _jQuery;

		return jQuery;
	},

	// See test/unit/core.js for details concerning this function.
	isFunction: function( fn ) {
		return !!fn && typeof fn != "string" && !fn.nodeName &&
			fn.constructor != Array && /^[\s[]?function/.test( fn + "" );
	},

	// check if an element is in a (or is an) XML document
	isXMLDoc: function( elem ) {
		return elem.documentElement && !elem.body ||
			elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
	},

	// Evalulates a script in a global context
	globalEval: function( data ) {
		data = jQuery.trim( data );

		if ( data ) {
			// Inspired by code by Andrea Giammarchi
			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
			var head = document.getElementsByTagName("head")[0] || document.documentElement,
				script = document.createElement("script");

			script.type = "text/javascript";
			if ( jQuery.browser.msie )
				script.text = data;
			else
				script.appendChild( document.createTextNode( data ) );

			// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
			// This arises when a base node is used (#2709).
			head.insertBefore( script, head.firstChild );
			head.removeChild( script );
		}
	},

	nodeName: function( elem, name ) {
		return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
	},

	cache: {},

	data: function( elem, name, data ) {
		elem = elem == window ?
			windowData :
			elem;

		var id = elem[ expando ];

		// Compute a unique ID for the element
		if ( !id )
			id = elem[ expando ] = ++uuid;

		// Only generate the data cache if we're
		// trying to access or manipulate it
		if ( name && !jQuery.cache[ id ] )
			jQuery.cache[ id ] = {};

		// Prevent overriding the named cache with undefined values
		if ( data !== undefined )
			jQuery.cache[ id ][ name ] = data;

		// Return the named cache data, or the ID for the element
		return name ?
			jQuery.cache[ id ][ name ] :
			id;
	},

	removeData: function( elem, name ) {
		elem = elem == window ?
			windowData :
			elem;

		var id = elem[ expando ];

		// If we want to remove a specific section of the element's data
		if ( name ) {
			if ( jQuery.cache[ id ] ) {
				// Remove the section of cache data
				delete jQuery.cache[ id ][ name ];

				// If we've removed all the data, remove the element's cache
				name = "";

				for ( name in jQuery.cache[ id ] )
					break;

				if ( !name )
					jQuery.removeData( elem );
			}

		// Otherwise, we want to remove all of the element's data
		} else {
			// Clean up the element expando
			try {
				delete elem[ expando ];
			} catch(e){
				// IE has trouble directly removing the expando
				// but it's ok with using removeAttribute
				if ( elem.removeAttribute )
					elem.removeAttribute( expando );
			}

			// Completely remove the data cache
			delete jQuery.cache[ id ];
		}
	},

	// args is for internal usage only
	each: function( object, callback, args ) {
		var name, i = 0, length = object.length;

		if ( args ) {
			if ( length == undefined ) {
				for ( name in object )
					if ( callback.apply( object[ name ], args ) === false )
						break;
			} else
				for ( ; i < length; )
					if ( callback.apply( object[ i++ ], args ) === false )
						break;

		// A special, fast, case for the most common use of each
		} else {
			if ( length == undefined ) {
				for ( name in object )
					if ( callback.call( object[ name ], name, object[ name ] ) === false )
						break;
			} else
				for ( var value = object[0];
					i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
		}

		return object;
	},

	prop: function( elem, value, type, i, name ) {
		// Handle executable functions
		if ( jQuery.isFunction( value ) )
			value = value.call( elem, i );

		// Handle passing in a number to a CSS property
		return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ?
			value + "px" :
			value;
	},

	className: {
		// internal only, use addClass("class")
		add: function( elem, classNames ) {
			jQuery.each((classNames || "").split(/\s+/), function(i, className){
				if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
					elem.className += (elem.className ? " " : "") + className;
			});
		},

		// internal only, use removeClass("class")
		remove: function( elem, classNames ) {
			if (elem.nodeType == 1)
				elem.className = classNames != undefined ?
					jQuery.grep(elem.className.split(/\s+/), function(className){
						return !jQuery.className.has( classNames, className );
					}).join(" ") :
					"";
		},

		// internal only, use hasClass("class")
		has: function( elem, className ) {
			return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
		}
	},

	// A method for quickly swapping in/out CSS properties to get correct calculations
	swap: function( elem, options, callback ) {
		var old = {};
		// Remember the old values, and insert the new ones
		for ( var name in options ) {
			old[ name ] = elem.style[ name ];
			elem.style[ name ] = options[ name ];
		}

		callback.call( elem );

		// Revert the old values
		for ( var name in options )
			elem.style[ name ] = old[ name ];
	},

	css: function( elem, name, force ) {
		if ( name == "width" || name == "height" ) {
			var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];

			function getWH() {
				val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
				var padding = 0, border = 0;
				jQuery.each( which, function() {
					padding += parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
					border += parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
				});
				val -= Math.round(padding + border);
			}

			if ( jQuery(elem).is(":visible") )
				getWH();
			else
				jQuery.swap( elem, props, getWH );

			return Math.max(0, val);
		}

		return jQuery.curCSS( elem, name, force );
	},

	curCSS: function( elem, name, force ) {
		var ret, style = elem.style;

		// A helper method for determining if an element's values are broken
		function color( elem ) {
			if ( !jQuery.browser.safari )
				return false;

			// defaultView is cached
			var ret = defaultView.getComputedStyle( elem, null );
			return !ret || ret.getPropertyValue("color") == "";
		}

		// We need to handle opacity special in IE
		if ( name == "opacity" && jQuery.browser.msie ) {
			ret = jQuery.attr( style, "opacity" );

			return ret == "" ?
				"1" :
				ret;
		}
		// Opera sometimes will give the wrong display answer, this fixes it, see #2037
		if ( jQuery.browser.opera && name == "display" ) {
			var save = style.outline;
			style.outline = "0 solid black";
			style.outline = save;
		}

		// Make sure we're using the right name for getting the float value
		if ( name.match( /float/i ) )
			name = styleFloat;

		if ( !force && style && style[ name ] )
			ret = style[ name ];

		else if ( defaultView.getComputedStyle ) {

			// Only "float" is needed here
			if ( name.match( /float/i ) )
				name = "float";

			name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();

			var computedStyle = defaultView.getComputedStyle( elem, null );

			if ( computedStyle && !color( elem ) )
				ret = computedStyle.getPropertyValue( name );

			// If the element isn't reporting its values properly in Safari
			// then some display: none elements are involved
			else {
				var swap = [], stack = [], a = elem, i = 0;

				// Locate all of the parent display: none elements
				for ( ; a && color(a); a = a.parentNode )
					stack.unshift(a);

				// Go through and make them visible, but in reverse
				// (It would be better if we knew the exact display type that they had)
				for ( ; i < stack.length; i++ )
					if ( color( stack[ i ] ) ) {
						swap[ i ] = stack[ i ].style.display;
						stack[ i ].style.display = "block";
					}

				// Since we flip the display style, we have to handle that
				// one special, otherwise get the value
				ret = name == "display" && swap[ stack.length - 1 ] != null ?
					"none" :
					( computedStyle && computedStyle.getPropertyValue( name ) ) || "";

				// Finally, revert the display styles back
				for ( i = 0; i < swap.length; i++ )
					if ( swap[ i ] != null )
						stack[ i ].style.display = swap[ i ];
			}

			// We should always get a number back from opacity
			if ( name == "opacity" && ret == "" )
				ret = "1";

		} else if ( elem.currentStyle ) {
			var camelCase = name.replace(/\-(\w)/g, function(all, letter){
				return letter.toUpperCase();
			});

			ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];

			// From the awesome hack by Dean Edwards
			// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291

			// If we're not dealing with a regular pixel number
			// but a number that has a weird ending, we need to convert it to pixels
			if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
				// Remember the original values
				var left = style.left, rsLeft = elem.runtimeStyle.left;

				// Put in the new values to get a computed value out
				elem.runtimeStyle.left = elem.currentStyle.left;
				style.left = ret || 0;
				ret = style.pixelLeft + "px";

				// Revert the changed values
				style.left = left;
				elem.runtimeStyle.left = rsLeft;
			}
		}

		return ret;
	},

	clean: function( elems, context ) {
		var ret = [];
		context = context || document;
		// !context.createElement fails in IE with an error but returns typeof 'object'
		if (typeof context.createElement == 'undefined')
			context = context.ownerDocument || context[0] && context[0].ownerDocument || document;

		jQuery.each(elems, function(i, elem){
			if ( !elem )
				return;

			if ( elem.constructor == Number )
				elem += '';

			// Convert html string into DOM nodes
			if ( typeof elem == "string" ) {
				// Fix "XHTML"-style tags in all browsers
				elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
						all :
						front + "></" + tag + ">";
				});

				// Trim whitespace, otherwise indexOf won't work as expected
				var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");

				var wrap =
					// option or optgroup
					!tags.indexOf("<opt") &&
					[ 1, "<select multiple='multiple'>", "</select>" ] ||

					!tags.indexOf("<leg") &&
					[ 1, "<fieldset>", "</fieldset>" ] ||

					tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
					[ 1, "<table>", "</table>" ] ||

					!tags.indexOf("<tr") &&
					[ 2, "<table><tbody>", "</tbody></table>" ] ||

				 	// <thead> matched above
					(!tags.indexOf("<td") || !tags.indexOf("<th")) &&
					[ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||

					!tags.indexOf("<col") &&
					[ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||

					// IE can't serialize <link> and <script> tags normally
					jQuery.browser.msie &&
					[ 1, "div<div>", "</div>" ] ||

					[ 0, "", "" ];

				// Go to html and back, then peel off extra wrappers
				div.innerHTML = wrap[1] + elem + wrap[2];

				// Move to the right depth
				while ( wrap[0]-- )
					div = div.lastChild;

				// Remove IE's autoinserted <tbody> from table fragments
				if ( jQuery.browser.msie ) {

					// String was a <table>, *may* have spurious <tbody>
					var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ?
						div.firstChild && div.firstChild.childNodes :

						// String was a bare <thead> or <tfoot>
						wrap[1] == "<table>" && tags.indexOf("<tbody") < 0 ?
							div.childNodes :
							[];

					for ( var j = tbody.length - 1; j >= 0 ; --j )
						if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
							tbody[ j ].parentNode.removeChild( tbody[ j ] );

					// IE completely kills leading whitespace when innerHTML is used
					if ( /^\s/.test( elem ) )
						div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );

				}

				elem = jQuery.makeArray( div.childNodes );
			}

			if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) )
				return;

			if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options )
				ret.push( elem );

			else
				ret = jQuery.merge( ret, elem );

		});

		return ret;
	},

	attr: function( elem, name, value ) {
		// don't set attributes on text and comment nodes
		if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
			return undefined;

		var notxml = !jQuery.isXMLDoc( elem ),
			// Whether we are setting (or getting)
			set = value !== undefined,
			msie = jQuery.browser.msie;

		// Try to normalize/fix the name
		name = notxml && jQuery.props[ name ] || name;

		// Only do all the following if this is a node (faster for style)
		// IE elem.getAttribute passes even for style
		if ( elem.tagName ) {

			// These attributes require special treatment
			var special = /href|src|style/.test( name );

			// Safari mis-reports the default selected property of a hidden option
			// Accessing the parent's selectedIndex property fixes it
			if ( name == "selected" && jQuery.browser.safari )
				elem.parentNode.selectedIndex;

			// If applicable, access the attribute via the DOM 0 way
			if ( name in elem && notxml && !special ) {
				if ( set ){
					// We can't allow the type property to be changed (since it causes problems in IE)
					if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
						throw "type property can't be changed";

					elem[ name ] = value;
				}

				// browsers index elements by id/name on forms, give priority to attributes.
				if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
					return elem.getAttributeNode( name ).nodeValue;

				return elem[ name ];
			}

			if ( msie && notxml &&  name == "style" )
				return jQuery.attr( elem.style, "cssText", value );

			if ( set )
				// convert the value to a string (all browsers do this but IE) see #1070
				elem.setAttribute( name, "" + value );

			var attr = msie && notxml && special
					// Some attributes require a special call on IE
					? elem.getAttribute( name, 2 )
					: elem.getAttribute( name );

			// Non-existent attributes return null, we normalize to undefined
			return attr === null ? undefined : attr;
		}

		// elem is actually elem.style ... set the style

		// IE uses filters for opacity
		if ( msie && name == "opacity" ) {
			if ( set ) {
				// IE has trouble with opacity if it does not have layout
				// Force it by setting the zoom level
				elem.zoom = 1;

				// Set the alpha filter to set the opacity
				elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
					(parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
			}

			return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
				(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
				"";
		}

		name = name.replace(/-([a-z])/ig, function(all, letter){
			return letter.toUpperCase();
		});

		if ( set )
			elem[ name ] = value;

		return elem[ name ];
	},

	trim: function( text ) {
		return (text || "").replace( /^\s+|\s+$/g, "" );
	},

	makeArray: function( array ) {
		var ret = [];

		if( array != null ){
			var i = array.length;
			//the window, strings and functions also have 'length'
			if( i == null || array.split || array.setInterval || array.call )
				ret[0] = array;
			else
				while( i )
					ret[--i] = array[i];
		}

		return ret;
	},

	inArray: function( elem, array ) {
		for ( var i = 0, length = array.length; i < length; i++ )
		// Use === because on IE, window == document
			if ( array[ i ] === elem )
				return i;

		return -1;
	},

	merge: function( first, second ) {
		// We have to loop this way because IE & Opera overwrite the length
		// expando of getElementsByTagName
		var i = 0, elem, pos = first.length;
		// Also, we need to make sure that the correct elements are being returned
		// (IE returns comment nodes in a '*' query)
		if ( jQuery.browser.msie ) {
			while ( elem = second[ i++ ] )
				if ( elem.nodeType != 8 )
					first[ pos++ ] = elem;

		} else
			while ( elem = second[ i++ ] )
				first[ pos++ ] = elem;

		return first;
	},

	unique: function( array ) {
		var ret = [], done = {};

		try {

			for ( var i = 0, length = array.length; i < length; i++ ) {
				var id = jQuery.data( array[ i ] );

				if ( !done[ id ] ) {
					done[ id ] = true;
					ret.push( array[ i ] );
				}
			}

		} catch( e ) {
			ret = array;
		}

		return ret;
	},

	grep: function( elems, callback, inv ) {
		var ret = [];

		// Go through the array, only saving the items
		// that pass the validator function
		for ( var i = 0, length = elems.length; i < length; i++ )
			if ( !inv != !callback( elems[ i ], i ) )
				ret.push( elems[ i ] );

		return ret;
	},

	map: function( elems, callback ) {
		var ret = [];

		// Go through the array, translating each of the items to their
		// new value (or values).
		for ( var i = 0, length = elems.length; i < length; i++ ) {
			var value = callback( elems[ i ], i );

			if ( value != null )
				ret[ ret.length ] = value;
		}

		return ret.concat.apply( [], ret );
	}
});

var userAgent = navigator.userAgent.toLowerCase();

// Figure out what browser is being used
jQuery.browser = {
	version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
	safari: /webkit/.test( userAgent ),
	opera: /opera/.test( userAgent ),
	msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
	mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
};

var styleFloat = jQuery.browser.msie ?
	"styleFloat" :
	"cssFloat";

jQuery.extend({
	// Check to see if the W3C box model is being used
	boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat",

	props: {
		"for": "htmlFor",
		"class": "className",
		"float": styleFloat,
		cssFloat: styleFloat,
		styleFloat: styleFloat,
		readonly: "readOnly",
		maxlength: "maxLength",
		cellspacing: "cellSpacing"
	}
});

jQuery.each({
	parent: function(elem){return elem.parentNode;},
	parents: function(elem){return jQuery.dir(elem,"parentNode");},
	next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
	prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
	nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
	prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
	siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
	children: function(elem){return jQuery.sibling(elem.firstChild);},
	contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
}, function(name, fn){
	jQuery.fn[ name ] = function( selector ) {
		var ret = jQuery.map( this, fn );

		if ( selector && typeof selector == "string" )
			ret = jQuery.multiFilter( selector, ret );

		return this.pushStack( jQuery.unique( ret ) );
	};
});

jQuery.each({
	appendTo: "append",
	prependTo: "prepend",
	insertBefore: "before",
	insertAfter: "after",
	replaceAll: "replaceWith"
}, function(name, original){
	jQuery.fn[ name ] = function() {
		var args = arguments;

		return this.each(function(){
			for ( var i = 0, length = args.length; i < length; i++ )
				jQuery( args[ i ] )[ original ]( this );
		});
	};
});

jQuery.each({
	removeAttr: function( name ) {
		jQuery.attr( this, name, "" );
		if (this.nodeType == 1)
			this.removeAttribute( name );
	},

	addClass: function( classNames ) {
		jQuery.className.add( this, classNames );
	},

	removeClass: function( classNames ) {
		jQuery.className.remove( this, classNames );
	},

	toggleClass: function( classNames ) {
		jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames );
	},

	remove: function( selector ) {
		if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) {
			// Prevent memory leaks
			jQuery( "*", this ).add(this).each(function(){
				jQuery.event.remove(this);
				jQuery.removeData(this);
			});
			if (this.parentNode)
				this.parentNode.removeChild( this );
		}
	},

	empty: function() {
		// Remove element nodes and prevent memory leaks
		jQuery( ">*", this ).remove();

		// Remove any remaining nodes
		while ( this.firstChild )
			this.removeChild( this.firstChild );
	}
}, function(name, fn){
	jQuery.fn[ name ] = function(){
		return this.each( fn, arguments );
	};
});

jQuery.each([ "Height", "Width" ], function(i, name){
	var type = name.toLowerCase();

	jQuery.fn[ type ] = function( size ) {
		// Get window width or height
		return this[0] == window ?
			// Opera reports document.body.client[Width/Height] properly in both quirks and standards
			jQuery.browser.opera && document.body[ "client" + name ] ||

			// Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)
			jQuery.browser.safari && window[ "inner" + name ] ||

			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
			document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] :

			// Get document width or height
			this[0] == document ?
				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
				Math.max(
					Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]),
					Math.max(document.body["offset" + name], document.documentElement["offset" + name])
				) :

				// Get or set width or height on the element
				size == undefined ?
					// Get width or height on the element
					(this.length ? jQuery.css( this[0], type ) : null) :

					// Set the width or height on the element (default to pixels if value is unitless)
					this.css( type, size.constructor == String ? size : size + "px" );
	};
});

// Helper function used by the dimensions and offset modules
function num(elem, prop) {
	return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
		"(?:[\\w*_-]|\\\\.)" :
		"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
	quickChild = new RegExp("^>\\s*(" + chars + "+)"),
	quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
	quickClass = new RegExp("^([#.]?)(" + chars + "*)");

jQuery.extend({
	expr: {
		"": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},
		"#": function(a,i,m){return a.getAttribute("id")==m[2];},
		":": {
			// Position Checks
			lt: function(a,i,m){return i<m[3]-0;},
			gt: function(a,i,m){return i>m[3]-0;},
			nth: function(a,i,m){return m[3]-0==i;},
			eq: function(a,i,m){return m[3]-0==i;},
			first: function(a,i){return i==0;},
			last: function(a,i,m,r){return i==r.length-1;},
			even: function(a,i){return i%2==0;},
			odd: function(a,i){return i%2;},

			// Child Checks
			"first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},
			"last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
			"only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},

			// Parent Checks
			parent: function(a){return a.firstChild;},
			empty: function(a){return !a.firstChild;},

			// Text Check
			contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},

			// Visibility
			visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
			hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},

			// Form attributes
			enabled: function(a){return !a.disabled;},
			disabled: function(a){return a.disabled;},
			checked: function(a){return a.checked;},
			selected: function(a){return a.selected||jQuery.attr(a,"selected");},

			// Form elements
			text: function(a){return "text"==a.type;},
			radio: function(a){return "radio"==a.type;},
			checkbox: function(a){return "checkbox"==a.type;},
			file: function(a){return "file"==a.type;},
			password: function(a){return "password"==a.type;},
			submit: function(a){return "submit"==a.type;},
			image: function(a){return "image"==a.type;},
			reset: function(a){return "reset"==a.type;},
			button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");},
			input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},

			// :has()
			has: function(a,i,m){return jQuery.find(m[3],a).length;},

			// :header
			header: function(a){return /h\d/i.test(a.nodeName);},

			// :animated
			animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
		}
	},

	// The regular expressions that power the parsing engine
	parse: [
		// Match: [@value='test'], [@foo]
		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,

		// Match: :contains('foo')
		/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,

		// Match: :even, :last-child, #id, .class
		new RegExp("^([:.#]*)(" + chars + "+)")
	],

	multiFilter: function( expr, elems, not ) {
		var old, cur = [];

		while ( expr && expr != old ) {
			old = expr;
			var f = jQuery.filter( expr, elems, not );
			expr = f.t.replace(/^\s*,\s*/, "" );
			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
		}

		return cur;
	},

	find: function( t, context ) {
		// Quickly handle non-string expressions
		if ( typeof t != "string" )
			return [ t ];

		// check to make sure context is a DOM element or a document
		if ( context && context.nodeType != 1 && context.nodeType != 9)
			return [ ];

		// Set the correct context (if none is provided)
		context = context || document;

		// Initialize the search
		var ret = [context], done = [], last, nodeName;

		// Continue while a selector expression exists, and while
		// we're no longer looping upon ourselves
		while ( t && last != t ) {
			var r = [];
			last = t;

			t = jQuery.trim(t);

			var foundToken = false,

			// An attempt at speeding up child selectors that
			// point to a specific element tag
				re = quickChild,

				m = re.exec(t);

			if ( m ) {
				nodeName = m[1].toUpperCase();

				// Perform our own iteration and filter
				for ( var i = 0; ret[i]; i++ )
					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
						if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) )
							r.push( c );

				ret = r;
				t = t.replace( re, "" );
				if ( t.indexOf(" ") == 0 ) continue;
				foundToken = true;
			} else {
				re = /^([>+~])\s*(\w*)/i;

				if ( (m = re.exec(t)) != null ) {
					r = [];

					var merge = {};
					nodeName = m[2].toUpperCase();
					m = m[1];

					for ( var j = 0, rl = ret.length; j < rl; j++ ) {
						var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
						for ( ; n; n = n.nextSibling )
							if ( n.nodeType == 1 ) {
								var id = jQuery.data(n);

								if ( m == "~" && merge[id] ) break;

								if (!nodeName || n.nodeName.toUpperCase() == nodeName ) {
									if ( m == "~" ) merge[id] = true;
									r.push( n );
								}

								if ( m == "+" ) break;
							}
					}

					ret = r;

					// And remove the token
					t = jQuery.trim( t.replace( re, "" ) );
					foundToken = true;
				}
			}

			// See if there's still an expression, and that we haven't already
			// matched a token
			if ( t && !foundToken ) {
				// Handle multiple expressions
				if ( !t.indexOf(",") ) {
					// Clean the result set
					if ( context == ret[0] ) ret.shift();

					// Merge the result sets
					done = jQuery.merge( done, ret );

					// Reset the context
					r = ret = [context];

					// Touch up the selector string
					t = " " + t.substr(1,t.length);

				} else {
					// Optimize for the case nodeName#idName
					var re2 = quickID;
					var m = re2.exec(t);

					// Re-organize the results, so that they're consistent
					if ( m ) {
						m = [ 0, m[2], m[3], m[1] ];

					} else {
						// Otherwise, do a traditional filter check for
						// ID, class, and element selectors
						re2 = quickClass;
						m = re2.exec(t);
					}

					m[2] = m[2].replace(/\\/g, "");

					var elem = ret[ret.length-1];

					// Try to do a global search by ID, where we can
					if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
						// Optimization for HTML document case
						var oid = elem.getElementById(m[2]);

						// Do a quick check for the existence of the actual ID attribute
						// to avoid selecting by the name attribute in IE
						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
						if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
							oid = jQuery('[@id="'+m[2]+'"]', elem)[0];

						// Do a quick check for node name (where applicable) so
						// that div#foo searches will be really fast
						ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
					} else {
						// We need to find all descendant elements
						for ( var i = 0; ret[i]; i++ ) {
							// Grab the tag name being searched for
							var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];

							// Handle IE7 being really dumb about <object>s
							if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
								tag = "param";

							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
						}

						// It's faster to filter by class and be done with it
						if ( m[1] == "." )
							r = jQuery.classFilter( r, m[2] );

						// Same with ID filtering
						if ( m[1] == "#" ) {
							var tmp = [];

							// Try to find the element with the ID
							for ( var i = 0; r[i]; i++ )
								if ( r[i].getAttribute("id") == m[2] ) {
									tmp = [ r[i] ];
									break;
								}

							r = tmp;
						}

						ret = r;
					}

					t = t.replace( re2, "" );
				}

			}

			// If a selector string still exists
			if ( t ) {
				// Attempt to filter it
				var val = jQuery.filter(t,r);
				ret = r = val.r;
				t = jQuery.trim(val.t);
			}
		}

		// An error occurred with the selector;
		// just return an empty set instead
		if ( t )
			ret = [];

		// Remove the root context
		if ( ret && context == ret[0] )
			ret.shift();

		// And combine the results
		done = jQuery.merge( done, ret );

		return done;
	},

	classFilter: function(r,m,not){
		m = " " + m + " ";
		var tmp = [];
		for ( var i = 0; r[i]; i++ ) {
			var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
			if ( !not && pass || not && !pass )
				tmp.push( r[i] );
		}
		return tmp;
	},

	filter: function(t,r,not) {
		var last;

		// Look for common filter expressions
		while ( t && t != last ) {
			last = t;

			var p = jQuery.parse, m;

			for ( var i = 0; p[i]; i++ ) {
				m = p[i].exec( t );

				if ( m ) {
					// Remove what we just matched
					t = t.substring( m[0].length );

					m[2] = m[2].replace(/\\/g, "");
					break;
				}
			}

			if ( !m )
				break;

			// :not() is a special case that can be optimized by
			// keeping it out of the expression list
			if ( m[1] == ":" && m[2] == "not" )
				// optimize if only one selector found (most common case)
				r = isSimple.test( m[3] ) ?
					jQuery.filter(m[3], r, true).r :
					jQuery( r ).not( m[3] );

			// We can get a big speed boost by filtering by class here
			else if ( m[1] == "." )
				r = jQuery.classFilter(r, m[2], not);

			else if ( m[1] == "[" ) {
				var tmp = [], type = m[3];

				for ( var i = 0, rl = r.length; i < rl; i++ ) {
					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];

					if ( z == null || /href|src|selected/.test(m[2]) )
						z = jQuery.attr(a,m[2]) || '';

					if ( (type == "" && !!z ||
						 type == "=" && z == m[5] ||
						 type == "!=" && z != m[5] ||
						 type == "^=" && z && !z.indexOf(m[5]) ||
						 type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
						 (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
							tmp.push( a );
				}

				r = tmp;

			// We can get a speed boost by handling nth-child here
			} else if ( m[1] == ":" && m[2] == "nth-child" ) {
				var merge = {}, tmp = [],
					// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
					test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
						m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
						!/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
					// calculate the numbers (first)n+(last) including if they are negative
					first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0;

				// loop through all the elements left in the jQuery object
				for ( var i = 0, rl = r.length; i < rl; i++ ) {
					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);

					if ( !merge[id] ) {
						var c = 1;

						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
							if ( n.nodeType == 1 )
								n.nodeIndex = c++;

						merge[id] = true;
					}

					var add = false;

					if ( first == 0 ) {
						if ( node.nodeIndex == last )
							add = true;
					} else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 )
						add = true;

					if ( add ^ not )
						tmp.push( node );
				}

				r = tmp;

			// Otherwise, find the expression to execute
			} else {
				var fn = jQuery.expr[ m[1] ];
				if ( typeof fn == "object" )
					fn = fn[ m[2] ];

				if ( typeof fn == "string" )
					fn = eval("false||function(a,i){return " + fn + ";}");

				// Execute it against the current filter
				r = jQuery.grep( r, function(elem, i){
					return fn(elem, i, m, r);
				}, not );
			}
		}

		// Return an array of filtered elements (r)
		// and the modified expression string (t)
		return { r: r, t: t };
	},

	dir: function( elem, dir ){
		var matched = [],
			cur = elem[dir];
		while ( cur && cur != document ) {
			if ( cur.nodeType == 1 )
				matched.push( cur );
			cur = cur[dir];
		}
		return matched;
	},

	nth: function(cur,result,dir,elem){
		result = result || 1;
		var num = 0;

		for ( ; cur; cur = cur[dir] )
			if ( cur.nodeType == 1 && ++num == result )
				break;

		return cur;
	},

	sibling: function( n, elem ) {
		var r = [];

		for ( ; n; n = n.nextSibling ) {
			if ( n.nodeType == 1 && n != elem )
				r.push( n );
		}

		return r;
	}
});
/*
 * A number of helper functions used for managing events.
 * Many of the ideas behind this code orignated from
 * Dean Edwards' addEvent library.
 */
jQuery.event = {

	// Bind an event to an element
	// Original by Dean Edwards
	add: function(elem, types, handler, data) {
		if ( elem.nodeType == 3 || elem.nodeType == 8 )
			return;

		// For whatever reason, IE has trouble passing the window object
		// around, causing it to be cloned in the process
		if ( jQuery.browser.msie && elem.setInterval )
			elem = window;

		// Make sure that the function being executed has a unique ID
		if ( !handler.guid )
			handler.guid = this.guid++;

		// if data is passed, bind to handler
		if( data != undefined ) {
			// Create temporary function pointer to original handler
			var fn = handler;

			// Create unique handler function, wrapped around original handler
			handler = this.proxy( fn, function() {
				// Pass arguments and context to original handler
				return fn.apply(this, arguments);
			});

			// Store data in unique handler
			handler.data = data;
		}

		// Init the element's event structure
		var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
			handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
				// Handle the second event of a trigger and when
				// an event is called after a page has unloaded
				if ( typeof jQuery != "undefined" && !jQuery.event.triggered )
					return jQuery.event.handle.apply(arguments.callee.elem, arguments);
			});
		// Add elem as a property of the handle function
		// This is to prevent a memory leak with non-native
		// event in IE.
		handle.elem = elem;

		// Handle multiple events separated by a space
		// jQuery(...).bind("mouseover mouseout", fn);
		jQuery.each(types.split(/\s+/), function(index, type) {
			// Namespaced event handlers
			var parts = type.split(".");
			type = parts[0];
			handler.type = parts[1];

			// Get the current list of functions bound to this event
			var handlers = events[type];

			// Init the event handler queue
			if (!handlers) {
				handlers = events[type] = {};

				// Check for a special event handler
				// Only use addEventListener/attachEvent if the special
				// events handler returns false
				if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false ) {
					// Bind the global event handler to the element
					if (elem.addEventListener)
						elem.addEventListener(type, handle, false);
					else if (elem.attachEvent)
						elem.attachEvent("on" + type, handle);
				}
			}

			// Add the function to the element's handler list
			handlers[handler.guid] = handler;

			// Keep track of which events have been used, for global triggering
			jQuery.event.global[type] = true;
		});

		// Nullify elem to prevent memory leaks in IE
		elem = null;
	},

	guid: 1,
	global: {},

	// Detach an event or set of events from an element
	remove: function(elem, types, handler) {
		// don't do events on text and comment nodes
		if ( elem.nodeType == 3 || elem.nodeType == 8 )
			return;

		var events = jQuery.data(elem, "events"), ret, index;

		if ( events ) {
			// Unbind all events for the element
			if ( types == undefined || (typeof types == "string" && types.charAt(0) == ".") )
				for ( var type in events )
					this.remove( elem, type + (types || "") );
			else {
				// types is actually an event object here
				if ( types.type ) {
					handler = types.handler;
					types = types.type;
				}

				// Handle multiple events seperated by a space
				// jQuery(...).unbind("mouseover mouseout", fn);
				jQuery.each(types.split(/\s+/), function(index, type){
					// Namespaced event handlers
					var parts = type.split(".");
					type = parts[0];

					if ( events[type] ) {
						// remove the given handler for the given type
						if ( handler )
							delete events[type][handler.guid];

						// remove all handlers for the given type
						else
							for ( handler in events[type] )
								// Handle the removal of namespaced events
								if ( !parts[1] || events[type][handler].type == parts[1] )
									delete events[type][handler];

						// remove generic event handler if no more handlers exist
						for ( ret in events[type] ) break;
						if ( !ret ) {
							if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) {
								if (elem.removeEventListener)
									elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
								else if (elem.detachEvent)
									elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
							}
							ret = null;
							delete events[type];
						}
					}
				});
			}

			// Remove the expando if it's no longer used
			for ( ret in events ) break;
			if ( !ret ) {
				var handle = jQuery.data( elem, "handle" );
				if ( handle ) handle.elem = null;
				jQuery.removeData( elem, "events" );
				jQuery.removeData( elem, "handle" );
			}
		}
	},

	trigger: function(type, data, elem, donative, extra) {
		// Clone the incoming data, if any
		data = jQuery.makeArray(data);

		if ( type.indexOf("!") >= 0 ) {
			type = type.slice(0, -1);
			var exclusive = true;
		}

		// Handle a global trigger
		if ( !elem ) {
			// Only trigger if we've ever bound an event for it
			if ( this.global[type] )
				jQuery("*").add([window, document]).trigger(type, data);

		// Handle triggering a single element
		} else {
			// don't do events on text and comment nodes
			if ( elem.nodeType == 3 || elem.nodeType == 8 )
				return undefined;

			var val, ret, fn = jQuery.isFunction( elem[ type ] || null ),
				// Check to see if we need to provide a fake event, or not
				event = !data[0] || !data[0].preventDefault;

			// Pass along a fake event
			if ( event ) {
				data.unshift({
					type: type,
					target: elem,
					preventDefault: function(){},
					stopPropagation: function(){},
					timeStamp: now()
				});
				data[0][expando] = true; // no need to fix fake event
			}

			// Enforce the right trigger type
			data[0].type = type;
			if ( exclusive )
				data[0].exclusive = true;

			// Trigger the event, it is assumed that "handle" is a function
			var handle = jQuery.data(elem, "handle");
			if ( handle )
				val = handle.apply( elem, data );

			// Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
			if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
				val = false;

			// Extra functions don't get the custom event object
			if ( event )
				data.shift();

			// Handle triggering of extra function
			if ( extra && jQuery.isFunction( extra ) ) {
				// call the extra function and tack the current return value on the end for possible inspection
				ret = extra.apply( elem, val == null ? data : data.concat( val ) );
				// if anything is returned, give it precedence and have it overwrite the previous value
				if (ret !== undefined)
					val = ret;
			}

			// Trigger the native events (except for clicks on links)
			if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
				this.triggered = true;
				try {
					elem[ type ]();
				// prevent IE from throwing an error for some hidden elements
				} catch (e) {}
			}

			this.triggered = false;
		}

		return val;
	},

	handle: function(event) {
		// returned undefined or false
		var val, ret, namespace, all, handlers;

		event = arguments[0] = jQuery.event.fix( event || window.event );

		// Namespaced event handlers
		namespace = event.type.split(".");
		event.type = namespace[0];
		namespace = namespace[1];
		// Cache this now, all = true means, any handler
		all = !namespace && !event.exclusive;

		handlers = ( jQuery.data(this, "events") || {} )[event.type];

		for ( var j in handlers ) {
			var handler = handlers[j];

			// Filter the functions by class
			if ( all || handler.type == namespace ) {
				// Pass in a reference to the handler function itself
				// So that we can later remove it
				event.handler = handler;
				event.data = handler.data;

				ret = handler.apply( this, arguments );

				if ( val !== false )
					val = ret;

				if ( ret === false ) {
					event.preventDefault();
					event.stopPropagation();
				}
			}
		}

		return val;
	},

	fix: function(event) {
		if ( event[expando] == true )
			return event;

		// store a copy of the original event object
		// and "clone" to set read-only properties
		var originalEvent = event;
		event = { originalEvent: originalEvent };
		var 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 timeStamp toElement type view wheelDelta which".split(" ");
		for ( var i=props.length; i; i-- )
			event[ props[i] ] = originalEvent[ props[i] ];

		// Mark it as fixed
		event[expando] = true;

		// add preventDefault and stopPropagation since
		// they will not work on the clone
		event.preventDefault = function() {
			// if preventDefault exists run it on the original event
			if (originalEvent.preventDefault)
				originalEvent.preventDefault();
			// otherwise set the returnValue property of the original event to false (IE)
			originalEvent.returnValue = false;
		};
		event.stopPropagation = function() {
			// if stopPropagation exists run it on the original event
			if (originalEvent.stopPropagation)
				originalEvent.stopPropagation();
			// otherwise set the cancelBubble property of the original event to true (IE)
			originalEvent.cancelBubble = true;
		};

		// Fix timeStamp
		event.timeStamp = event.timeStamp || now();

		// Fix target property, if necessary
		if ( !event.target )
			event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either

		// check if target is a textnode (safari)
		if ( event.target.nodeType == 3 )
			event.target = event.target.parentNode;

		// Add relatedTarget, if necessary
		if ( !event.relatedTarget && event.fromElement )
			event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;

		// Calculate pageX/Y if missing and clientX/Y available
		if ( event.pageX == null && event.clientX != null ) {
			var doc = document.documentElement, body = document.body;
			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
			event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
		}

		// Add which for key events
		if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
			event.which = event.charCode || event.keyCode;

		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
		if ( !event.metaKey && event.ctrlKey )
			event.metaKey = event.ctrlKey;

		// Add which for click: 1 == left; 2 == middle; 3 == right
		// Note: button is not normalized, so don't use it
		if ( !event.which && event.button )
			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));

		return event;
	},

	proxy: function( fn, proxy ){
		// Set the guid of unique handler to the same of original handler, so it can be removed
		proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
		// So proxy can be declared as an argument
		return proxy;
	},

	special: {
		ready: {
			setup: function() {
				// Make sure the ready event is setup
				bindReady();
				return;
			},

			teardown: function() { return; }
		},

		mouseenter: {
			setup: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler);
				return true;
			},

			teardown: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
				return true;
			},

			handler: function(event) {
				// If we actually just moused on to a sub-element, ignore it
				if ( withinElement(event, this) ) return true;
				// Execute the right handlers by setting the event type to mouseenter
				event.type = "mouseenter";
				return jQuery.event.handle.apply(this, arguments);
			}
		},

		mouseleave: {
			setup: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler);
				return true;
			},

			teardown: function() {
				if ( jQuery.browser.msie ) return false;
				jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
				return true;
			},

			handler: function(event) {
				// If we actually just moused on to a sub-element, ignore it
				if ( withinElement(event, this) ) return true;
				// Execute the right handlers by setting the event type to mouseleave
				event.type = "mouseleave";
				return jQuery.event.handle.apply(this, arguments);
			}
		}
	}
};

jQuery.fn.extend({
	bind: function( type, data, fn ) {
		return type == "unload" ? this.one(type, data, fn) : this.each(function(){
			jQuery.event.add( this, type, fn || data, fn && data );
		});
	},

	one: function( type, data, fn ) {
		var one = jQuery.event.proxy( fn || data, function(event) {
			jQuery(this).unbind(event, one);
			return (fn || data).apply( this, arguments );
		});
		return this.each(function(){
			jQuery.event.add( this, type, one, fn && data);
		});
	},

	unbind: function( type, fn ) {
		return this.each(function(){
			jQuery.event.remove( this, type, fn );
		});
	},

	trigger: function( type, data, fn ) {
		return this.each(function(){
			jQuery.event.trigger( type, data, this, true, fn );
		});
	},

	triggerHandler: function( type, data, fn ) {
		return this[0] && jQuery.event.trigger( type, data, this[0], false, fn );
	},

	toggle: function( fn ) {
		// Save reference to arguments for access in closure
		var args = arguments, i = 1;

		// link all the functions, so any of them can unbind this click handler
		while( i < args.length )
			jQuery.event.proxy( fn, args[i++] );

		return this.click( jQuery.event.proxy( fn, function(event) {
			// Figure out which function to execute
			this.lastToggle = ( this.lastToggle || 0 ) % i;

			// Make sure that clicks stop
			event.preventDefault();

			// and execute the function
			return args[ this.lastToggle++ ].apply( this, arguments ) || false;
		}));
	},

	hover: function(fnOver, fnOut) {
		return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut);
	},

	ready: function(fn) {
		// Attach the listeners
		bindReady();

		// If the DOM is already ready
		if ( jQuery.isReady )
			// Execute the function immediately
			fn.call( document, jQuery );

		// Otherwise, remember the function for later
		else
			// Add the function to the wait list
			jQuery.readyList.push( function() { return fn.call(this, jQuery); } );

		return this;
	}
});

jQuery.extend({
	isReady: false,
	readyList: [],
	// Handle when the DOM is ready
	ready: function() {
		// Make sure that the DOM is not already loaded
		if ( !jQuery.isReady ) {
			// Remember that the DOM is ready
			jQuery.isReady = true;

			// If there are functions bound, to execute
			if ( jQuery.readyList ) {
				// Execute all of them
				jQuery.each( jQuery.readyList, function(){
					this.call( document );
				});

				// Reset the list of functions
				jQuery.readyList = null;
			}

			// Trigger any bound ready events
			jQuery(document).triggerHandler("ready");
		}
	}
});

var readyBound = false;

function bindReady(){
	if ( readyBound ) return;
	readyBound = true;

	// Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
	if ( document.addEventListener && !jQuery.browser.opera)
		// Use the handy event callback
		document.addEventListener( "DOMContentLoaded", jQuery.ready, false );

	// If IE is used and is not in a frame
	// Continually check to see if the document is ready
	if ( jQuery.browser.msie && window == top ) (function(){
		if (jQuery.isReady) return;
		try {
			// If IE is used, use the trick by Diego Perini
			// http://javascript.nwbox.com/IEContentLoaded/
			document.documentElement.doScroll("left");
		} catch( error ) {
			setTimeout( arguments.callee, 0 );
			return;
		}
		// and execute any waiting functions
		jQuery.ready();
	})();

	if ( jQuery.browser.opera )
		document.addEventListener( "DOMContentLoaded", function () {
			if (jQuery.isReady) return;
			for (var i = 0; i < document.styleSheets.length; i++)
				if (document.styleSheets[i].disabled) {
					setTimeout( arguments.callee, 0 );
					return;
				}
			// and execute any waiting functions
			jQuery.ready();
		}, false);

	if ( jQuery.browser.safari ) {
		var numStyles;
		(function(){
			if (jQuery.isReady) return;
			if ( document.readyState != "loaded" && document.readyState != "complete" ) {
				setTimeout( arguments.callee, 0 );
				return;
			}
			if ( numStyles === undefined )
				numStyles = jQuery("style, link[rel=stylesheet]").length;
			if ( document.styleSheets.length != numStyles ) {
				setTimeout( arguments.callee, 0 );
				return;
			}
			// and execute any waiting functions
			jQuery.ready();
		})();
	}

	// A fallback to window.onload, that will always work
	jQuery.event.add( window, "load", jQuery.ready );
}

jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
	"mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
	"submit,keydown,keypress,keyup,error").split(","), function(i, name){

	// Handle event binding
	jQuery.fn[name] = function(fn){
		return fn ? this.bind(name, fn) : this.trigger(name);
	};
});

// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function(event, elem) {
	// Check if mouse(over|out) are still within the same parent element
	var parent = event.relatedTarget;
	// Traverse up the tree
	while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
	// Return true if we actually just moused on to a sub-element
	return parent == elem;
};

// Prevent memory leaks in IE
// And prevent errors on refresh with events like mouseover in other browsers
// Window isn't included so as not to unbind existing unload events
jQuery(window).bind("unload", function() {
	jQuery("*").add(document).unbind();
});
jQuery.fn.extend({
	// Keep a copy of the old load
	_load: jQuery.fn.load,

	load: function( url, params, callback ) {
		if ( typeof url != 'string' )
			return this._load( url );

		var off = url.indexOf(" ");
		if ( off >= 0 ) {
			var selector = url.slice(off, url.length);
			url = url.slice(0, off);
		}

		callback = callback || function(){};

		// Default to a GET request
		var type = "GET";

		// If the second parameter was provided
		if ( params )
			// If it's a function
			if ( jQuery.isFunction( params ) ) {
				// We assume that it's the callback
				callback = params;
				params = null;

			// Otherwise, build a param string
			} else {
				params = jQuery.param( params );
				type = "POST";
			}

		var self = this;

		// Request the remote document
		jQuery.ajax({
			url: url,
			type: type,
			dataType: "html",
			data: params,
			complete: function(res, status){
				// If successful, inject the HTML into all the matched elements
				if ( status == "success" || status == "notmodified" )
					// See if a selector was specified
					self.html( selector ?
						// Create a dummy div to hold the results
						jQuery("<div/>")
							// inject the contents of the document in, removing the scripts
							// to avoid any 'Permission Denied' errors in IE
							.append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))

							// Locate the specified elements
							.find(selector) :

						// If not, just inject the full result
						res.responseText );

				self.each( callback, [res.responseText, status, res] );
			}
		});
		return this;
	},

	serialize: function() {
		return jQuery.param(this.serializeArray());
	},
	serializeArray: function() {
		return this.map(function(){
			return jQuery.nodeName(this, "form") ?
				jQuery.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(i, elem){
			var val = jQuery(this).val();
			return val == null ? null :
				val.constructor == Array ?
					jQuery.map( val, function(val, i){
						return {name: elem.name, value: val};
					}) :
					{name: elem.name, value: val};
		}).get();
	}
});

// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
	jQuery.fn[o] = function(f){
		return this.bind(o, f);
	};
});

var jsc = now();

jQuery.extend({
	get: function( url, data, callback, type ) {
		// shift arguments if data argument was ommited
		if ( jQuery.isFunction( data ) ) {
			callback = data;
			data = null;
		}

		return jQuery.ajax({
			type: "GET",
			url: url,
			data: data,
			success: callback,
			dataType: type
		});
	},

	getScript: function( url, callback ) {
		return jQuery.get(url, null, callback, "script");
	},

	getJSON: function( url, data, callback ) {
		return jQuery.get(url, data, callback, "json");
	},

	post: function( url, data, callback, type ) {
		if ( jQuery.isFunction( data ) ) {
			callback = data;
			data = {};
		}

		return jQuery.ajax({
			type: "POST",
			url: url,
			data: data,
			success: callback,
			dataType: type
		});
	},

	ajaxSetup: function( settings ) {
		jQuery.extend( jQuery.ajaxSettings, settings );
	},

	ajaxSettings: {
		url: location.href,
		global: true,
		type: "GET",
		timeout: 0,
		contentType: "application/x-www-form-urlencoded",
		processData: true,
		async: true,
		data: null,
		username: null,
		password: null,
		accepts: {
			xml: "application/xml, text/xml",
			html: "text/html",
			script: "text/javascript, application/javascript",
			json: "application/json, text/javascript",
			text: "text/plain",
			_default: "*/*"
		}
	},

	// Last-Modified header cache for next request
	lastModified: {},

	ajax: function( s ) {
		// Extend the settings, but re-extend 's' so that it can be
		// checked again later (in the test suite, specifically)
		s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));

		var jsonp, jsre = /=\?(&|$)/g, status, data,
			type = s.type.toUpperCase();

		// convert data if not already a string
		if ( s.data && s.processData && typeof s.data != "string" )
			s.data = jQuery.param(s.data);

		// Handle JSONP Parameter Callbacks
		if ( s.dataType == "jsonp" ) {
			if ( type == "GET" ) {
				if ( !s.url.match(jsre) )
					s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
			} else if ( !s.data || !s.data.match(jsre) )
				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
			s.dataType = "json";
		}

		// Build temporary JSONP function
		if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
			jsonp = "jsonp" + jsc++;

			// Replace the =? sequence both in the query string and the data
			if ( s.data )
				s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
			s.url = s.url.replace(jsre, "=" + jsonp + "$1");

			// We need to make sure
			// that a JSONP style response is executed properly
			s.dataType = "script";

			// Handle JSONP-style loading
			window[ jsonp ] = function(tmp){
				data = tmp;
				success();
				complete();
				// Garbage collect
				window[ jsonp ] = undefined;
				try{ delete window[ jsonp ]; } catch(e){}
				if ( head )
					head.removeChild( script );
			};
		}

		if ( s.dataType == "script" && s.cache == null )
			s.cache = false;

		if ( s.cache === false && type == "GET" ) {
			var ts = now();
			// try replacing _= if it is there
			var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
			// if nothing was replaced, add timestamp to the end
			s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
		}

		// If data is available, append data to url for get requests
		if ( s.data && type == "GET" ) {
			s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;

			// IE likes to send both get and post data, prevent this
			s.data = null;
		}

		// Watch for a new set of requests
		if ( s.global && ! jQuery.active++ )
			jQuery.event.trigger( "ajaxStart" );

		// Matches an absolute URL, and saves the domain
		var remote = /^(?:\w+:)?\/\/([^\/?#]+)/;

		// If we're requesting a remote document
		// and trying to load JSON or Script with a GET
		if ( s.dataType == "script" && type == "GET"
				&& remote.test(s.url) && remote.exec(s.url)[1] != location.host ){
			var head = document.getElementsByTagName("head")[0];
			var script = document.createElement("script");
			script.src = s.url;
			if (s.scriptCharset)
				script.charset = s.scriptCharset;

			// Handle Script loading
			if ( !jsonp ) {
				var done = false;

				// Attach handlers for all browsers
				script.onload = script.onreadystatechange = function(){
					if ( !done && (!this.readyState ||
							this.readyState == "loaded" || this.readyState == "complete") ) {
						done = true;
						success();
						complete();
						head.removeChild( script );
					}
				};
			}

			head.appendChild(script);

			// We handle everything using the script element injection
			return undefined;
		}

		var requestDone = false;

		// Create the request object; Microsoft failed to properly
		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
		var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

		// Open the socket
		// Passing null username, generates a login popup on Opera (#2865)
		if( s.username )
			xhr.open(type, s.url, s.async, s.username, s.password);
		else
			xhr.open(type, s.url, s.async);

		// Need an extra try/catch for cross domain requests in Firefox 3
		try {
			// Set the correct header, if data is being sent
			if ( s.data )
				xhr.setRequestHeader("Content-Type", s.contentType);

			// Set the If-Modified-Since header, if ifModified mode.
			if ( s.ifModified )
				xhr.setRequestHeader("If-Modified-Since",
					jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );

			// Set header so the called script knows that it's an XMLHttpRequest
			xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");

			// Set the Accepts header for the server, depending on the dataType
			xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
				s.accepts[ s.dataType ] + ", */*" :
				s.accepts._default );
		} catch(e){}

		// Allow custom headers/mimetypes
		if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
			// cleanup active request counter
			s.global && jQuery.active--;
			// close opended socket
			xhr.abort();
			return false;
		}

		if ( s.global )
			jQuery.event.trigger("ajaxSend", [xhr, s]);

		// Wait for a response to come back
		var onreadystatechange = function(isTimeout){
			// The transfer is complete and the data is available, or the request timed out
			if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
				requestDone = true;

				// clear poll interval
				if (ival) {
					clearInterval(ival);
					ival = null;
				}

				status = isTimeout == "timeout" && "timeout" ||
					!jQuery.httpSuccess( xhr ) && "error" ||
					s.ifModified && jQuery.httpNotModified( xhr, s.url ) && "notmodified" ||
					"success";

				if ( status == "success" ) {
					// Watch for, and catch, XML document parse errors
					try {
						// process the data (runs the xml through httpData regardless of callback)
						data = jQuery.httpData( xhr, s.dataType, s.dataFilter );
					} catch(e) {
						status = "parsererror";
					}
				}

				// Make sure that the request was successful or notmodified
				if ( status == "success" ) {
					// Cache Last-Modified header, if ifModified mode.
					var modRes;
					try {
						modRes = xhr.getResponseHeader("Last-Modified");
					} catch(e) {} // swallow exception thrown by FF if header is not available

					if ( s.ifModified && modRes )
						jQuery.lastModified[s.url] = modRes;

					// JSONP handles its own success callback
					if ( !jsonp )
						success();
				} else
					jQuery.handleError(s, xhr, status);

				// Fire the complete handlers
				complete();

				// Stop memory leaks
				if ( s.async )
					xhr = null;
			}
		};

		if ( s.async ) {
			// don't attach the handler to the request, just poll it instead
			var ival = setInterval(onreadystatechange, 13);

			// Timeout checker
			if ( s.timeout > 0 )
				setTimeout(function(){
					// Check to see if the request is still happening
					if ( xhr ) {
						// Cancel the request
						xhr.abort();

						if( !requestDone )
							onreadystatechange( "timeout" );
					}
				}, s.timeout);
		}

		// Send the data
		try {
			xhr.send(s.data);
		} catch(e) {
			jQuery.handleError(s, xhr, null, e);
		}

		// firefox 1.5 doesn't fire statechange for sync requests
		if ( !s.async )
			onreadystatechange();

		function success(){
			// 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", [xhr, s] );
		}

		function complete(){
			// Process result
			if ( s.complete )
				s.complete(xhr, status);

			// The request was completed
			if ( s.global )
				jQuery.event.trigger( "ajaxComplete", [xhr, s] );

			// Handle the global AJAX counter
			if ( s.global && ! --jQuery.active )
				jQuery.event.trigger( "ajaxStop" );
		}

		// return XMLHttpRequest to allow aborting the request etc.
		return xhr;
	},

	handleError: function( s, xhr, status, e ) {
		// If a local callback was specified, fire it
		if ( s.error ) s.error( xhr, status, e );

		// Fire the global callback
		if ( s.global )
			jQuery.event.trigger( "ajaxError", [xhr, s, e] );
	},

	// Counter for holding the number of active queries
	active: 0,

	// Determines if an XMLHttpRequest was successful or not
	httpSuccess: function( xhr ) {
		try {
			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
			return !xhr.status && location.protocol == "file:" ||
				( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223 ||
				jQuery.browser.safari && xhr.status == undefined;
		} catch(e){}
		return false;
	},

	// Determines if an XMLHttpRequest returns NotModified
	httpNotModified: function( xhr, url ) {
		try {
			var xhrRes = xhr.getResponseHeader("Last-Modified");

			// Firefox always returns 200. check Last-Modified date
			return xhr.status == 304 || xhrRes == jQuery.lastModified[url] ||
				jQuery.browser.safari && xhr.status == undefined;
		} catch(e){}
		return false;
	},

	httpData: function( xhr, type, filter ) {
		var ct = xhr.getResponseHeader("content-type"),
			xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
			data = xml ? xhr.responseXML : xhr.responseText;

		if ( xml && data.documentElement.tagName == "parsererror" )
			throw "parsererror";
			
		// Allow a pre-filtering function to sanitize the response
		if( filter )
			data = filter( data, type );

		// 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" )
			data = eval("(" + data + ")");

		return data;
	},

	// Serialize an array of form elements or a set of
	// key/values into a query string
	param: function( a ) {
		var s = [];

		// If an array was passed in, assume that it is an array
		// of form elements
		if ( a.constructor == Array || a.jquery )
			// Serialize the form elements
			jQuery.each( a, function(){
				s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) );
			});

		// Otherwise, assume that it's an object of key/value pairs
		else
			// Serialize the key/values
			for ( var j in a )
				// If the value is an array then the key names need to be repeated
				if ( a[j] && a[j].constructor == Array )
					jQuery.each( a[j], function(){
						s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) );
					});
				else
					s.push( encodeURIComponent(j) + "=" + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ) );

		// Return the resulting serialization
		return s.join("&").replace(/%20/g, "+");
	}

});
jQuery.fn.extend({
	show: function(speed,callback){
		return speed ?
			this.animate({
				height: "show", width: "show", opacity: "show"
			}, speed, callback) :

			this.filter(":hidden").each(function(){
				this.style.display = this.oldblock || "";
				if ( jQuery.css(this,"display") == "none" ) {
					var elem = jQuery("<" + this.tagName + " />").appendTo("body");
					this.style.display = elem.css("display");
					// handle an edge condition where css is - div { display:none; } or similar
					if (this.style.display == "none")
						this.style.display = "block";
					elem.remove();
				}
			}).end();
	},

	hide: function(speed,callback){
		return speed ?
			this.animate({
				height: "hide", width: "hide", opacity: "hide"
			}, speed, callback) :

			this.filter(":visible").each(function(){
				this.oldblock = this.oldblock || jQuery.css(this,"display");
				this.style.display = "none";
			}).end();
	},

	// Save the old toggle function
	_toggle: jQuery.fn.toggle,

	toggle: function( fn, fn2 ){
		return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
			this._toggle.apply( this, arguments ) :
			fn ?
				this.animate({
					height: "toggle", width: "toggle", opacity: "toggle"
				}, fn, fn2) :
				this.each(function(){
					jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
				});
	},

	slideDown: function(speed,callback){
		return this.animate({height: "show"}, speed, callback);
	},

	slideUp: function(speed,callback){
		return this.animate({height: "hide"}, speed, callback);
	},

	slideToggle: function(speed, callback){
		return this.animate({height: "toggle"}, speed, callback);
	},

	fadeIn: function(speed, callback){
		return this.animate({opacity: "show"}, speed, callback);
	},

	fadeOut: function(speed, callback){
		return this.animate({opacity: "hide"}, speed, callback);
	},

	fadeTo: function(speed,to,callback){
		return this.animate({opacity: to}, speed, callback);
	},

	animate: function( prop, speed, easing, callback ) {
		var optall = jQuery.speed(speed, easing, callback);

		return this[ optall.queue === false ? "each" : "queue" ](function(){
			if ( this.nodeType != 1)
				return false;

			var opt = jQuery.extend({}, optall), p,
				hidden = jQuery(this).is(":hidden"), self = this;

			for ( p in prop ) {
				if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
					return opt.complete.call(this);

				if ( p == "height" || p == "width" ) {
					// Store display property
					opt.display = jQuery.css(this, "display");

					// Make sure that nothing sneaks out
					opt.overflow = this.style.overflow;
				}
			}

			if ( opt.overflow != null )
				this.style.overflow = "hidden";

			opt.curAnim = jQuery.extend({}, prop);

			jQuery.each( prop, function(name, val){
				var e = new jQuery.fx( self, opt, name );

				if ( /toggle|show|hide/.test(val) )
					e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
				else {
					var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
						start = e.cur(true) || 0;

					if ( parts ) {
						var end = parseFloat(parts[2]),
							unit = parts[3] || "px";

						// We need to compute starting value
						if ( unit != "px" ) {
							self.style[ name ] = (end || 1) + unit;
							start = ((end || 1) / e.cur(true)) * start;
							self.style[ name ] = start + unit;
						}

						// If a +=/-= token was provided, we're doing a relative animation
						if ( parts[1] )
							end = ((parts[1] == "-=" ? -1 : 1) * end) + start;

						e.custom( start, end, unit );
					} else
						e.custom( start, val, "" );
				}
			});

			// For JS strict compliance
			return true;
		});
	},

	queue: function(type, fn){
		if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) {
			fn = type;
			type = "fx";
		}

		if ( !type || (typeof type == "string" && !fn) )
			return queue( this[0], type );

		return this.each(function(){
			if ( fn.constructor == Array )
				queue(this, type, fn);
			else {
				queue(this, type).push( fn );

				if ( queue(this, type).length == 1 )
					fn.call(this);
			}
		});
	},

	stop: function(clearQueue, gotoEnd){
		var timers = jQuery.timers;

		if (clearQueue)
			this.queue([]);

		this.each(function(){
			// go in reverse order so anything added to the queue during the loop is ignored
			for ( var i = timers.length - 1; i >= 0; i-- )
				if ( timers[i].elem == this ) {
					if (gotoEnd)
						// force the next step to be the last
						timers[i](true);
					timers.splice(i, 1);
				}
		});

		// start the next in the queue if the last step wasn't forced
		if (!gotoEnd)
			this.dequeue();

		return this;
	}

});

var queue = function( elem, type, array ) {
	if ( elem ){

		type = type || "fx";

		var q = jQuery.data( elem, type + "queue" );

		if ( !q || array )
			q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) );

	}
	return q;
};

jQuery.fn.dequeue = function(type){
	type = type || "fx";

	return this.each(function(){
		var q = queue(this, type);

		q.shift();

		if ( q.length )
			q[0].call( this );
	});
};

jQuery.extend({

	speed: function(speed, easing, fn) {
		var opt = speed && speed.constructor == Object ? speed : {
			complete: fn || !fn && easing ||
				jQuery.isFunction( speed ) && speed,
			duration: speed,
			easing: fn && easing || easing && easing.constructor != Function && easing
		};

		opt.duration = (opt.duration && opt.duration.constructor == Number ?
			opt.duration :
			jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def;

		// Queueing
		opt.old = opt.complete;
		opt.complete = function(){
			if ( opt.queue !== false )
				jQuery(this).dequeue();
			if ( jQuery.isFunction( opt.old ) )
				opt.old.call( this );
		};

		return opt;
	},

	easing: {
		linear: function( p, n, firstNum, diff ) {
			return firstNum + diff * p;
		},
		swing: function( p, n, firstNum, diff ) {
			return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
		}
	},

	timers: [],
	timerId: null,

	fx: function( elem, options, prop ){
		this.options = options;
		this.elem = elem;
		this.prop = prop;

		if ( !options.orig )
			options.orig = {};
	}

});

jQuery.fx.prototype = {

	// Simple function for setting a style value
	update: function(){
		if ( this.options.step )
			this.options.step.call( this.elem, this.now, this );

		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );

		// Set display property to block for height/width animations
		if ( this.prop == "height" || this.prop == "width" )
			this.elem.style.display = "block";
	},

	// Get the current size
	cur: function(force){
		if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
			return this.elem[ this.prop ];

		var r = parseFloat(jQuery.css(this.elem, this.prop, force));
		return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
	},

	// Start an animation from one number to another
	custom: function(from, to, unit){
		this.startTime = now();
		this.start = from;
		this.end = to;
		this.unit = unit || this.unit || "px";
		this.now = this.start;
		this.pos = this.state = 0;
		this.update();

		var self = this;
		function t(gotoEnd){
			return self.step(gotoEnd);
		}

		t.elem = this.elem;

		jQuery.timers.push(t);

		if ( jQuery.timerId == null ) {
			jQuery.timerId = setInterval(function(){
				var timers = jQuery.timers;

				for ( var i = 0; i < timers.length; i++ )
					if ( !timers[i]() )
						timers.splice(i--, 1);

				if ( !timers.length ) {
					clearInterval( jQuery.timerId );
					jQuery.timerId = null;
				}
			}, 13);
		}
	},

	// Simple 'show' function
	show: function(){
		// Remember where we started, so that we can go back to it later
		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
		this.options.show = true;

		// Begin the animation
		this.custom(0, this.cur());

		// Make sure that we start at a small width/height to avoid any
		// flash of content
		if ( this.prop == "width" || this.prop == "height" )
			this.elem.style[this.prop] = "1px";

		// Start by showing the element
		jQuery(this.elem).show();
	},

	// Simple 'hide' function
	hide: function(){
		// Remember where we started, so that we can go back to it later
		this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
		this.options.hide = true;

		// Begin the animation
		this.custom(this.cur(), 0);
	},

	// Each step of an animation
	step: function(gotoEnd){
		var t = now();

		if ( gotoEnd || t > this.options.duration + this.startTime ) {
			this.now = this.end;
			this.pos = this.state = 1;
			this.update();

			this.options.curAnim[ this.prop ] = true;

			var done = true;
			for ( var i in this.options.curAnim )
				if ( this.options.curAnim[i] !== true )
					done = false;

			if ( done ) {
				if ( this.options.display != null ) {
					// Reset the overflow
					this.elem.style.overflow = this.options.overflow;

					// Reset the display
					this.elem.style.display = this.options.display;
					if ( jQuery.css(this.elem, "display") == "none" )
						this.elem.style.display = "block";
				}

				// Hide the element if the "hide" operation was done
				if ( this.options.hide )
					this.elem.style.display = "none";

				// Reset the properties, if the item has been hidden or shown
				if ( this.options.hide || this.options.show )
					for ( var p in this.options.curAnim )
						jQuery.attr(this.elem.style, p, this.options.orig[p]);
			}

			if ( done )
				// Execute the complete function
				this.options.complete.call( this.elem );

			return false;
		} else {
			var n = t - this.startTime;
			this.state = n / this.options.duration;

			// Perform the easing function, defaults to swing
			this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
			this.now = this.start + ((this.end - this.start) * this.pos);

			// Perform the next step of the animation
			this.update();
		}

		return true;
	}

};

jQuery.extend( jQuery.fx, {
	speeds:{
		slow: 600,
 		fast: 200,
 		// Default speed
 		def: 400
	},
	step: {
		scrollLeft: function(fx){
			fx.elem.scrollLeft = fx.now;
		},

		scrollTop: function(fx){
			fx.elem.scrollTop = fx.now;
		},

		opacity: function(fx){
			jQuery.attr(fx.elem.style, "opacity", fx.now);
		},

		_default: function(fx){
			fx.elem.style[ fx.prop ] = fx.now + fx.unit;
		}
	}
});
// The Offset Method
// Originally By Brandon Aaron, part of the Dimension Plugin
// http://jquery.com/plugins/project/dimensions
jQuery.fn.offset = function() {
	var left = 0, top = 0, elem = this[0], results;

	if ( elem ) with ( jQuery.browser ) {
		var parent       = elem.parentNode,
		    offsetChild  = elem,
		    offsetParent = elem.offsetParent,
		    doc          = elem.ownerDocument,
		    safari2      = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent),
		    css          = jQuery.curCSS,
		    fixed        = css(elem, "position") == "fixed";

		// Use getBoundingClientRect if available
		if ( elem.getBoundingClientRect ) {
			var box = elem.getBoundingClientRect();

			// Add the document scroll offsets
			add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));

			// IE adds the HTML element's border, by default it is medium which is 2px
			// IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
			// IE 7 standards mode, the border is always 2px
			// This border/offset is typically represented by the clientLeft and clientTop properties
			// However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
			// Therefore this method will be off by 2px in IE while in quirksmode
			add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );

		// Otherwise loop through the offsetParents and parentNodes
		} else {

			// Initial element offsets
			add( elem.offsetLeft, elem.offsetTop );

			// Get parent offsets
			while ( offsetParent ) {
				// Add offsetParent offsets
				add( offsetParent.offsetLeft, offsetParent.offsetTop );

				// Mozilla and Safari > 2 does not include the border on offset parents
				// However Mozilla adds the border for table or table cells
				if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 )
					border( offsetParent );

				// Add the document scroll offsets if position is fixed on any offsetParent
				if ( !fixed && css(offsetParent, "position") == "fixed" )
					fixed = true;

				// Set offsetChild to previous offsetParent unless it is the body element
				offsetChild  = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
				// Get next offsetParent
				offsetParent = offsetParent.offsetParent;
			}

			// Get parent scroll offsets
			while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
				// Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
				if ( !/^inline|table.*$/i.test(css(parent, "display")) )
					// Subtract parent scroll offsets
					add( -parent.scrollLeft, -parent.scrollTop );

				// Mozilla does not add the border for a parent that has overflow != visible
				if ( mozilla && css(parent, "overflow") != "visible" )
					border( parent );

				// Get next parent
				parent = parent.parentNode;
			}

			// Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild
			// Mozilla doubles body offsets with a non-absolutely positioned offsetChild
			if ( (safari2 && (fixed || css(offsetChild, "position") == "absolute")) ||
				(mozilla && css(offsetChild, "position") != "absolute") )
					add( -doc.body.offsetLeft, -doc.body.offsetTop );

			// Add the document scroll offsets if position is fixed
			if ( fixed )
				add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
					Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
		}

		// Return an object with top and left properties
		results = { top: top, left: left };
	}

	function border(elem) {
		add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) );
	}

	function add(l, t) {
		left += parseInt(l, 10) || 0;
		top += parseInt(t, 10) || 0;
	}

	return results;
};


jQuery.fn.extend({
	position: function() {
		var left = 0, top = 0, results;

		if ( this[0] ) {
			// Get *real* offsetParent
			var offsetParent = this.offsetParent(),

			// Get correct offsets
			offset       = this.offset(),
			parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();

			// Subtract element margins
			// note: when an element has margin: auto the offsetLeft and marginLeft 
			// are the same in Safari causing offset.left to incorrectly be 0
			offset.top  -= num( this, 'marginTop' );
			offset.left -= num( this, 'marginLeft' );

			// Add offsetParent borders
			parentOffset.top  += num( offsetParent, 'borderTopWidth' );
			parentOffset.left += num( offsetParent, 'borderLeftWidth' );

			// Subtract the two offsets
			results = {
				top:  offset.top  - parentOffset.top,
				left: offset.left - parentOffset.left
			};
		}

		return results;
	},

	offsetParent: function() {
		var offsetParent = this[0].offsetParent;
		while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
			offsetParent = offsetParent.offsetParent;
		return jQuery(offsetParent);
	}
});


// Create scrollLeft and scrollTop methods
jQuery.each( ['Left', 'Top'], function(i, name) {
	var method = 'scroll' + name;
	
	jQuery.fn[ method ] = function(val) {
		if (!this[0]) return;

		return val != undefined ?

			// Set the scroll offset
			this.each(function() {
				this == window || this == document ?
					window.scrollTo(
						!i ? val : jQuery(window).scrollLeft(),
						 i ? val : jQuery(window).scrollTop()
					) :
					this[ method ] = val;
			}) :

			// Return the scroll offset
			this[0] == window || this[0] == document ?
				self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
					jQuery.boxModel && document.documentElement[ method ] ||
					document.body[ method ] :
				this[0][ method ];
	};
});
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Height", "Width" ], function(i, name){

	var tl = i ? "Left"  : "Top",  // top or left
		br = i ? "Right" : "Bottom"; // bottom or right

	// innerHeight and innerWidth
	jQuery.fn["inner" + name] = function(){
		return this[ name.toLowerCase() ]() +
			num(this, "padding" + tl) +
			num(this, "padding" + br);
	};

	// outerHeight and outerWidth
	jQuery.fn["outer" + name] = function(margin) {
		return this["inner" + name]() +
			num(this, "border" + tl + "Width") +
			num(this, "border" + br + "Width") +
			(margin ?
				num(this, "margin" + tl) + num(this, "margin" + br) : 0);
	};

});})();


/*
// 	ClearBox Config File (JavaScript)
*/

var

	// CB layout:
	
		CB_WindowColor='#fff',				// color of the CB window (note: you have to change the rounded-corner PNGs too!), transparent is also working
		CB_MinWidth=120,				// minimum (only at images) or initial width of CB window
		CB_MinHeight=120,				// initial heigth of CB window
		CB_WinPadd=15,					// padding of the CB window from sides of the browser 
		CB_RoundPix=12,					// change this setting only if you are generating new PNGs for rounded corners
		CB_ImgBorder=0,					// border size around the picture in CB window
		CB_ImgBorderColor='#ddd',			// border color around the picture in CB window
		CB_Padd=4,					// padding around inside the CB window
	
		CB_BodyMarginLeft=0,				//
		CB_BodyMarginRight=0,				// if you set margin to <body>,
		CB_BodyMarginTop=0,				// please change these settings!
		CB_BodyMarginBottom=0,				//
	
		CB_ShowThumbnails='auto',			// it tells CB how to show the thumbnails ('auto', 'always' or 'off') thumbnails are only in picture-mode!
		CB_ThumbsBGColor='#000',			// color of the thumbnail layer
		CB_ThumbsBGOpacity=.35,				// opacity of the thumbnail layer
		CB_ActThumbOpacity=.65,				// thumbnail opacity of the current viewed image
	
		CB_SlideShowBarColor='#fff',			// color of the slideshow bar
		CB_SlideShowBarOpacity=.5,			// opacity of the slideshow bar
		CB_SlideShowBarPadd=17,				// padding of the slideshow bar (left and right)
		CB_SlideShowBarTop=2,				// position of the slideshow bar from the top of the picture
	
		CB_SimpleDesign='off',				// if it's 'on', CB doesn't show the frame but only the content - really nice ;)
	
		CB_CloseBtnTop=-10,				// vertical position of the close button in picture mode
		CB_CloseBtnRight=-14,				// horizontal position of the close button in picture mode
		CB_CloseBtn2Top=-20,				// vertical position of the close button in content mode
		CB_CloseBtn2Right=-30,				// horizontal position of the close button in content mode
	
		CB_OSD='on',					// turns on OSD
	
	// CB font, text and navigation (at the bottom of CB window) settings:
	
		CB_FontT='Verdana',				//
		CB_FontSizeT=12,				// these variables are referring to the title or caption line
		CB_FontColorT='#777',				// 
		CB_FontWeightT='normal',			//
	
		CB_FontC='arial',				//
		CB_FontSizeC=11,				// these variables are referring to
		CB_FontColorC='#aaa',				// comment lines under the title
		CB_FontWeightC='normal',			//
		CB_TextAlignC='justify',			//
	      	CB_TxtHMax=42,					// maximum height of the comment box in pixels
	
		CB_FontG='arial',				//
		CB_FontSizeG=11,				// these variables are referring to the gallery name
		CB_FontColorG='#999',				//
		CB_FontWeightG='normal',			//
	
		CB_TextH=35,					// default height of the text area under the content in CB window (adding a comment will modify this setting), if you change the font sizes, you maybe have to change this setting
		CB_PadT=10,					// space in pixels between the content and the title or caption line
	
		CB_ShowURL='off',				// it shows the url of the content if no title or caption is given
		CB_ItemNum='on',				// it shows the ordinal number of the content in galleries
		CB_ItemNumBracket='()',				// whatever you want ;)
	
		CB_ShowGalName='on',				// it shows gallery name
		CB_TextNav='on',				// it shows previous and next navigation
		CB_NavTextImgPrvNxt='on',			// it shows previous and next buttons instead of text
		CB_ShowDL='off',					// it shows download controls
		CB_NavTextImgDL='on',				// it shows download buttons instead of text
	
		CB_ImgRotation='off',				// it shows the image rotation controls
		CB_NavTextImgRot='off',				// it shows the image rotation buttons instead of text
	
	// Settings of the document-hiding layer:
	
		CB_HideColor='#000',				// color of the layer
		CB_HideOpacity=.85,				// opacity (0 is invisible, 1 is 100% color) of the layer
		CB_HideOpacitySpeed=400,			// speed of fading
		CB_CloseOnH='on',				// CB will close, if you click on background
	
	// CB animation settings:
	
		CB_Animation='double',				// 'double', 'normal', 'off', 'grow' or 'warp' (high cpu usage)
		CB_ImgOpacitySpeed=450,				// speed of content fading (in ms)
		CB_TextOpacitySpeed=350,			// speed of text fading under the picture (in ms)
		CB_AnimSpeed=400,				// speed of the resizing animation of CB window (in ms)
		CB_ImgTextFade='on',				// turns on or off the fading of content and text
		CB_FlashHide='off',				// it hides flash animations on the page before CB starts
		CB_SelectsHide='on',				// it hides select boxes on the page before CB starts
		CB_SlShowTime=5,				// default speed of the slideshow (in sec)
		CB_Preload='on',				// preload neighbour pictures in galleries
	
	// Images using by CB settings:
	
		CB_PictureStart='start.png',			//
		CB_PicturePause='pause.png',			//
		CB_PictureClose='close.png',			// filenames of some images using by clearbox
		CB_PictureNext='next.png',			// (there are other images specified in clearbox.css!)
		CB_PicturePrev='prev.png',			//
	
	// CB professional settings:
	
		CB_PicDir='./resources/image/clearbox',	// CHANGE ONLY IF YOU CHANGED THE DEFAULT DIRECTORY-STRUCTURE OF CB!
	
		CB_AllowedToRun='on',					// if 'off', CB won't start (you can change this variable without reload!)
		CB_AllowExtFunctLoad='off',				// if 'on', CB will run a function named CB_ExternalFunctionLoad(); every time after a new content has loaded (useful for audit, etc)
		CB_AllowExtFunctPageLoad='off',				// if 'on', CB will run a function named CB_ExternalFunctionPageLoad(); after your page has fully loaded
		CB_AllowExtFunctCBClose='off'				// if 'on', CB will run a function named CB_ExternalFunctionCBClose(); after CB window has closed

;

//                  
// 	ClearBox Language File (JavaScript)
//

var

	CB_NavTextPrv='',		// text of previous image
	CB_NavTextNxt='',		// text of next image
	CB_NavTextFull='',		// text of original size (only at pictures)
	CB_NavTextOpen='',		// text of open content in a new browser window
	CB_NavTextDL='',		// text of download picture or any other content
	CB_NavTextClose='',		// text of close CB
	CB_NavTextStart='',		// text of start slideshow
	CB_NavTextStop='',		// text of stop slideshow
	CB_NavTextRotR='',		// text of rotation right
	CB_NavTextRotL=''		// text of rotation left
	
	/*
		CB_NavTextPrv='előző',									// text of previous image
		CB_NavTextNxt='következő',								// text of next image
		CB_NavTextFull='teljes méretű kép megtekintése',		// text of original size (only at pictures)
		CB_NavTextOpen='megnyitás a böngészőben',				// text of open content in a new browser window
		CB_NavTextDL='letöltés',								// text of download picture or any other content
		CB_NavTextClose='clearbox ablak bezárása',				// text of close CB
		CB_NavTextStart='slideshow elindítása',					// text of start slideshow
		CB_NavTextStop='slideshow megállítása',					// text of stop slideshow
		CB_NavTextRotR='kép elforgatása jobbra 90 fokkal',		// text of rotation right
		CB_NavTextRotL='kép elforgatása balra 90 fokkal'		// text of rotation left	
	*/	

;

function $CB(){if(arguments.length==1)return get$CB(arguments[0]);var b=[];$c(arguments).each(function(a){b.push(get$CB(a))});return b;function get$CB(a){if(typeof a=='string')a=document.getElementById(a);return a}};Function.prototype.lancol=function(a){var b=this;return function(){return b.apply(a,arguments)}};Kiterjeszt=function(a,b){for(kifejezes in b)a[kifejezes]=b[kifejezes];return a};if(!window.CBEE)var CBEE=new Object();var Osztaly={letrehoz:function(){return function(){this.azonnallefut.apply(this,arguments)}}};eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('F bD=\'3.b8\';F 1I=r.8O?Y:1a;F 4f=18.1Q.M(\'6X 6\')?Y:1a;F 8Q=(18.1Q.M(\'6X 6\')||18.1Q.M(\'6X 7\'))?Y:1a;F 2Y=18.1Q.M(\'9I\')?Y:1a;F 3D=18.1Q.M(\'4D\')?Y:1a;F 5E=18.1Q.M(\'9S\')?Y:1a;F 4O=0;7N*=97;F q;F 1k=\'ar P c5 9Q 1z\';F 2i=\'c2\';F 2V=\'ba\';F 8b=\'5W 63 6d 7q 6r 6B 6R\';F 2y,3s,2M=65,4U,1J,3Y,6P=1a,5f=0,1l=5C=0,2q=5o=3U=2X,3y=1,5K,3W=Y,8v=2T=-50,54,5m,4M=\'\',2U,an,6W,3f,3P,5O=0,5Q=\'\',3w,4I=9U+ao,4t=bN+bY,47,1Z,5w=0,1L,3F=\'4F\',6L,6w,C,J,4l,35,1B,Z,2r,2s,2x,2C,u,q,3J,4j,43,2Z,32;F 9W=17 2J();h(1A==\'1X\'){1A=\'7Q\';65=1}h(5M==\'G\'){2X=0;41=0}h(15.M(\'a3\')==E){15+=\'/\'}h(!1I)r.9D(9J.9O);h(1A==\'3A\'||1I){3o=\'1X\'}F 3C=5G;F 3T=5S;F 4Q=6S;F 3H=3K;F 3l=3Z;F 59=5A;F 5e=5I;h(9B==\'G\'){5G=\'<1k 1g="3b" L="\'+15+\'7l.P" 1r="\'+3C+\'" 1H="\'+3C+\'" />\';5S=\'<1k 1g="3b" L="\'+15+\'8W.P" 1r="\'+3T+\'" 1H="\'+3T+\'" />\'}h(a2==\'G\'){6S=\'<1k 1g="3b" L="\'+15+\'6b.P" 1r="\'+4Q+\'" 1H="\'+4Q+\'" />\';3K=\'<1k 1g="3b" L="\'+15+\'6b.P" 1r="\'+3H+\'" 1H="\'+3H+\'" />\';3Z=\'<1k 1g="3b" L="\'+15+\'8f.P" 1r="\'+3l+\'" 1H="\'+3l+\'" />\'}h(bF==\'G\'){5A=\'<1k 1g="3b" L="\'+15+\'8h.P" 1r="\'+59+\'" 1H="\'+59+\'" />\';5I=\'<1k 1g="3b" L="\'+15+\'8r.P" 1r="\'+5e+\'" 1H="\'+5e+\'" />\'}w 1N(a,b){S 84(8a(a,b),b)}w 84(a,b){b=b||"\\\\s";S a.5d(17 91("^["+b+"]+","g"),"")}w 8a(a,b){b=b||"\\\\s";S a.5d(17 91("["+b+"]+$","g"),"")}w 9v(a,b){h(4g 19.3r!=\'45\'){19.3r(a,b,1a)}y h(4g r.3r!=\'45\'){r.3r(a,b,1a)}y h(4g 19.8H!=\'45\'){19.8H("G"+a,b)}}9v(\'bn\',7V);w 7V(){6P=Y}w 7u(){q=E;5Z();61()}7u();w 5Z(){F a;h((!1I&&r.1c)||(3s&&1I&&3s.1P(\'</1c>\')!=-1)){h(a){4h(a)}r.1c.o.bc="be";h(1y!=0&&4G!=\'8Y\'){F b=\'<T 1g="af" o="O: \'+1y+\'B; U: \'+1y+\'B;"></T>\'}y{F b=\'\'}h(1I){4M=\'<1k I="6q" 1r="" L="\'+15+\'2E.P" />\'}y{4M=\'<T I="6q"></T>\'}F c=r.2u(\'1c\').8J(0);h(r.z(\'4E\')){c.9a(r.z(\'4E\'))}h(3o==\'G\'){D=\'<7e I="5U"></7e><1k I="7O" 1r="" L="\'+15+\'2E.P" />\'}y{D=\'<1k I="5U" 1r="" L="\'+15+\'2E.P" />\'}F d=r.5a("T");d.3I(\'I\',\'8M\');c.1S(d);F e=r.5a("T");e.3I(\'I\',\'8S\');c.1S(e);F f=r.5a("T");f.3I(\'I\',\'4E\');c.1S(f);r.z(\'4E\').V=\'<T I="6f"></T><T I="6j"></T><T I="9d"></T><9p 9L="0" 9N="0" I="9t"><3R I="4j"><1u I="5h">\'+b+\'</1u><1u I="5n"></1u><1u I="57">\'+b+\'</1u></3R><3R I="aa"><1u I="2Z"></1u><1u I="8B" aO="36" bB="2m"><T I="62"><T I="7s"><1k I="6I" 1r="\'+6K+\'" 1H="\'+6K+\'" L="\'+15+8Z+\'" /><T I="83"></T>\'+4M+\'<T I="6O"><T I="9c"></T></T>\'+D+\'<T I="5b"><1k I="5T" 1r="" L="\'+15+7i+\'" /><1k I="6U" 1r="" L="\'+15+7p+\'" /><T I="7L"></T><1k I="6e" 1r="\'+5J+\'" 1H="\'+5J+\'" L="\'+15+82+\'" /><1k I="5y" 1r="\'+5z+\'" 1H="\'+5z+\'" L="\'+15+8k+\'" /><a I="8u"></a><a I="8y"></a></T></T><T I="8A"><T I="8C"></T><T I="8G"></T><T I="8K"></T></T></T></1u><1u I="32"></1u></3R><3R I="43"><1u I="5c">\'+b+\'</1u><1u I="4k"></1u><1u I="4V">\'+b+\'</1u></3R></9p>\';h(4f&&1y==0){5Q=1}h(1I&&1y<2){5O=6}r.z(\'62\').o.8U=2P+\'B\';4c=r.z(\'6q\');2b=r.z(\'7L\');2b.o.4b=b4;2b.o.20=9l;2b.o.1o=\'3L(20=\'+9l*3d+\')\';35=r.z(\'9t\');2S=r.z(\'6O\');46=r.z(\'9c\');h(4L==\'1X\'){4c.o.K=\'R\'}1n=r.z(\'6f\');1n.o.4b=9C;1n.o.20=0;1n.o.1o=\'3L(20=0)\';6v=17 1T.3a(1n,{1U:8P,2z:w(){1M()}});6v.56();77=17 1T.3a(1n,{1U:8P,2z:w(){1n.o.O=\'2j\';1n.o.U=\'2j\';3W=Y;3w=\'1X\';h(a4==\'G\'){a6()}h(6y==\'G\'){5P()}h(6E==\'G\'){6G()}}});2n=r.z(\'6j\');2n.o.20=.75;2n.o.1o=\'3L(20=75)\';Z=r.z(\'5U\');h(3o==\'G\'){2L=r.z(\'7O\');2L.o.K=\'R\'}Z.o.7n=1b+\'B 7B \'+7J;3e=r.z(\'7s\');1O=r.z(\'6I\');1O.1E=w(){3X()};1O.1K=w(){22(6K)};1O.25=w(){1W()};28=r.z(\'5y\');28.1E=w(){5B();S 1a};28.1K=w(){22(5z)};28.25=w(){1W()};24=r.z(\'6e\');24.1E=w(){8E();S 1a};24.1K=w(){22(5J)};24.25=w(){1W()};1G=r.z(\'9d\');1G.o.4b=9E;1G.o.20=8I;1G.o.1o=\'3L(20=\'+8I*3d+\')\';2N=r.z(\'5T\');2N.1K=w(){2N.o.W=\'1x\';22(3C)};2N.25=w(){2N.o.W=\'1w\';1W()};2N.1E=w(){h(1L==\'G\'){23()}1M(u-1);1Y();S 1a};2G=r.z(\'6U\');2G.1K=w(){2G.o.W=\'1x\';22(3T)};2G.25=w(){2G.o.W=\'1w\';1W()};2G.1E=w(){h(1L==\'G\'){23()}1M(u+1);1Y();S 1a};2r=r.z(\'8u\');2r.1K=w(){2N.o.W=\'1x\';22(3C)};2r.25=w(){2N.o.W=\'1w\';1W()};2r.o.2v=\'4P(\'+15+\'2E.P)\';2s=r.z(\'8y\');2s.1K=w(){2G.o.W=\'1x\';22(3T)};2s.25=w(){2G.o.W=\'1w\';1W()};2s.o.2v=\'4P(\'+15+\'2E.P)\';1B=r.z(\'8A\');1B.o.U=2q+\'B\';1B.o.93=41+\'B\';h(5M==\'G\'){1B.o.K=\'R\';2X=0}y{1B.o.K=\'1m\'}1R=r.z(\'8M\');1R.o.42=9j;1R.o.4m=9n;1R.o.4w=9r+\'B\';1R.V="X";1h=r.z(\'8C\');1h.o.42=9j;1h.o.4m=9n;1h.o.6h=b2;1h.o.4w=9r+\'B\';1h.o.U=1R.2p;2e=r.z(\'8G\');2e.o.42=78;2e.o.4m=8n;2e.o.6h=ap;2e.o.4w=7d+\'B\';2e.o.6t=7K;2c=r.z(\'8S\');2c.o.42=78;2c.o.4m=8n;2c.o.4w=7d+\'B\';2c.o.6t=7K;1s=r.z(\'8K\');1s.o.42=ab;1s.o.4m=bW;1s.o.6h=aN;1s.o.4w=aP+\'B\';4j=r.z(\'4j\').o;4j.U=1y+\'B\';43=r.z(\'43\').o;43.U=1y+\'B\';2Z=r.z(\'2Z\').o;2Z.O=1y+5Q+\'B\';32=r.z(\'32\').o;32.O=1y+\'B\';1i=r.z(\'83\');r.z(\'8B\').o.4b=4G;r.z(\'62\').o.4b=4G;h(3t==\'G\'){4n=17 1T.3a(1B,{1U:7R,2z:w(){h(1I){1B.o.6i(\'1o\')}3u()}});4n.56();8L=17 1T.3a(1B,{1U:7R/2});6k=17 1T.3a(Z,{1U:6m,2z:w(){h(1I){Z.o.6i(\'1o\')}h(1A!=\'3z\'){3B()}}});6k.56();92=17 1T.3a(Z,{1U:6m/2,2z:w(){49();3y=1}})}5D=r.z(\'5b\').o;h(4L==\'6A\'){4c.1K=w(){85();S};2b.1K=w(){5x();S};1B.1K=w(){5x();S};1n.1K=w(){5x();S}}h(2Y){4I=0;4t=0}h(3D){4t=0}r.z(\'6O\').a8=7b;h(ak==\'G\'){am()}F j=17 2J(\'2E.P\',\'8f.P\',\'6b.P\',\'8W.P\',\'7l.P\',\'8r.P\',\'8h.P\',\'aq.P\',\'ca.P\',\'az.P\',\'aB.P\',\'aI.P\',\'aK.P\',\'9q.P\',\'aU.P\',\'aY.P\',\'b1.P\',\'b3.P\',\'b5.P\',\'bl.P\',\'9s.P\',\'9u.1z\',\'71.1z\',\'72.1z\',\'73.1z\',\'9w.1z\',\'9y.1z\',\'9z.1z\',\'7g.1z\',8k,82,8Z,7p,7i);F k=17 2J();1j(F i=0;i<j.Q;i++){k[i]=17 4i();k[i].L=15+j[i]}2x=C=3g;2C=J=7D-2X;h(4f){7H()}h(4G==\'8Y\'&&1y==0){r.z(\'5h\').o.34=\'\';r.z(\'5n\').o.34=\'\';r.z(\'57\').o.34=\'\';r.z(\'2Z\').o.34=\'\';r.z(\'32\').o.34=\'\';r.z(\'5c\').o.34=\'\';r.z(\'4k\').o.34=\'\';r.z(\'4V\').o.34=\'\';h(4f){r.z(\'4k\').o.1o=\'\'}}S}y{3s=r.2u(\'2f\')[0].V;3s=3s.44();a=4s(\'5Z()\',9T)}}w 61(){F a;1Z=r.2u(\'a\');1j(F i=4O;i<1Z.Q;i++){4O++;1V=1Z[i].40;h(1V.3i(0,8)==\'2g\'){2F=\'\';4T=1V.1P(\'[\');4X=1V.1P(\']\');h(1V!=\'2g\'){h(4T!=-1&&4X!=-1){D=1V.3i(4T+1,4X).H(\',,\');1j(F j=0;j<D.Q;j++){h(D[j].M(\'O\')!=E){3c=2h.3M(21(D[j].H(\'=\')[1])*1);h(3O(3c)==Y){2F+=\'O 55 "\'+1N((D[j].H(\'=\')[1]),\' \')+\'" 3Q 69 a 4v\'}}h(D[j].M(\'U\')!=E){3m=2h.3M(21(D[j].H(\'=\')[1])*1);h(3O(3m)==Y){2F+=\'U 55 "\'+1N((D[j].H(\'=\')[1]),\' \')+\'" 3Q 69 a 4v\'}}h(D[j].M(\'4B\')!=E){3n=2h.3M(21(D[j].H(\'=\')[1])*1);h(3O(3n)==Y){2F+=\'4B 55 "\'+1N((D[j].H(\'=\')[1]),\' \')+\'" 3Q 69 a 4v\'}}}}y{2F+=\'ac ae ag ai, 95: \';h(4T==-1){2F+=\' [ \'}h(4X==-1){2F+=\' ] \'}}}h(2F!=\'\'){3S(\'6l 6n at \'+(i+1)+\'. <a>! \'+2F+\'!\')}y{1Z[i].1E=w(){9h(\'2t=\'+26.4x(\'2t\',2)+\',,\'+26.40.3i(26.40.1P(\'[\')+1,26.40.1P(\']\')));S 1a}}}}h(6P==1a){a=4s(\'61()\',3d)}y{4O=0;h(a){4h(a)}h(r.z(\'6f\')){6x();6z();1n.o.U=2k+4t+\'B\'}S}}w 6D(a,b){q[a]=17 2J();1t=3c=3m=3n=E;1j(F i=0;i<b.Q;i++){h(b[i].M(\'3q=\')!=E){q[0]=1N(b[i].H(\'3q=\')[1],\' \')}h(b[i].M(\'2t=\')!=E){q[a][0]=1N(b[i].H(\'2t=\')[1],\' \').5d(/=/g,\'\\=\')}h(b[i].M(\'3p=\')!=E){1t=b[i].H(\'=\')[1].5d(/ /g,\'\')}h(b[i].M(\'1H=\')!=E){q[a][2]=1N(b[i].H(\'1H=\')[1],\' \')}h(b[i].M(\'6V=\')!=E){q[a][8]=1N(b[i].H(\'6V=\')[1],\' \')}h(b[i].M(\'8p=\')!=E){q[a][9]=1N(b[i].H(\'8p=\')[1],\' \')}h(b[i].M(\'O=\')!=E){3c=2h.3M(21(b[i].H(\'=\')[1])*1);h(3O(3c)==Y){3c=E}q[a][3]=3c}h(b[i].M(\'U=\')!=E){3m=2h.3M(21(b[i].H(\'=\')[1])*1);h(3O(3m)==Y){3m=E}q[a][4]=3m}h(b[i].M(\'4u=\')!=E){q[a][5]=1N(b[i].H(\'4u=\')[1],\' \')}h(b[i].M(\'5X=\')!=E){q[a][10]=1N(b[i].H(\'5X=\')[1],\' \')}h(b[i].M(\'6o\')!=E){q[a][11]=\'6o\'}h(b[i].M(\'2f=\')!=E){q[a][12]=1N(b[i].H(\'2f=\')[1],\' \')}h(b[i].M(\'4B=\')!=E){3n=2h.3M(21(b[i].H(\'=\')[1])*1);h(3O(3n)==Y){3n=E}q[a][6]=3n}h(b[i].M(\'60\')!=E){q[a][7]=\'60\'}}h(1t!=\'1C\'&&1t!=\'2i\'&&1t!=\'3h\'&&1t!=\'2A\'&&1t!=\'2B\'&&1t!=\'2f\'&&1t!=\'2V\'&&1t!=\'3j\'){1D=q[a][0].H(\'.\')[q[a][0].H(\'.\').Q-1];1D=1D.44();h(q[a][0].M(\'2B#\')!=E){1t=\'2B\'}y h(q[a][0].M(\'as\')!=E){1t=\'2f\'}y h(1k.M(1D)!=E){1t=\'1C\'}y h(2i.M(1D)!=E||q[a][0].M(\'3h.3x\')!=E){1t=\'2i\'}y h(2V.M(1D)!=E){1t=\'2V\'}y h(8b.M(1D)!=E){1t=\'3j\'}y{1t=\'2A\'}}q[a][1]=1t}w 9h(a){h(bm==\'G\'){3W=1a;5K=\'1X\';h(a.M(\'3q=\')!=E){31=1N(a.H(\'3q=\')[1].H(\',,\')[0],\' \')}y{31=\'2g\'}96=1N(a.H(\'2t=\')[1].H(\',,\')[0],\' \');h(31==\'E\'){31=\'2g\'}h(q&&q[0]==31&&31!=\'2g\'){}y{q=17 2J();q[0]=31;h(q[0]==\'2g\'){6D(1,a.H(\',,\'))}y{1Z=r.2u(\'a\');k=1;1j(F l=0;l<1Z.Q;l++){1V=1Z[l].40;h(1V.M(\'3q\')!=E){7y=1N(1V.3i(1V.1P(\'[\')+1,1V.1P(\']\')).H(\'3q=\')[1].H(\',,\')[0],\' \');h(31==7y){D=1V.3i(1V.1P(\'[\')+1,1V.1P(\']\'));h(D.M(\'2t=\')==E){D+=\',,2t\\=\'+1Z[l].4x(\'2t\',2)}h(D.M(\'1H=\')==E){D+=\',,1H\\=\'+1Z[l].4x(\'1H\')}h(D.M(\'4u=\')==E){5m=\'68\';1j(m=0;m<1Z[l].4K.Q;m++){h(1Z[l].4K[m].L!=45){5m=1Z[l].4K[m].L}}D+=\',,4u\\=\'+5m}D=D.H(\',,\');6D(k,D);k++}}}}}u=1;aR(q[u][0]!=96){u++}9e();h(6y==\'G\'){87()}h(6E==\'G\'){9g()}7A()}}w 7A(a){9i();6v.1F(0,9m);1n.o.U=2k+4t+\'B\'}w 9i(){6Q();Z.o.O=2x+\'B\';Z.o.U=2C+\'B\';Z.o.K=\'1m\';Z.o.W=\'1w\';35.o.W=\'1x\'}w 6Q(){28.o.K=\'R\';24.o.K=\'R\';1O.o.K=\'R\';2r.o.K=\'R\';2s.o.K=\'R\'}w 1M(a){h(u){F b=u}3w=\'1X\';F c;h(3y!=1){c=4s(\'1M(\'+a+\')\',5)}y{h(c){4h(c)}1O.o.K=\'R\';3u();h(a){h(C>3f){Z.o.O=C+\'B\'}h(J>3P){Z.o.U=J+\'B\'}u=21(a)}2x=C;2C=J;h(q[u][3]!=E){C=q[u][3]}y{C=9o}h(q[u][4]!=E){J=q[u][4]}y{J=9o}49();h(q[u][1]==\'1C\'){6Q();3J=17 4i();3J.7C=w(){6c();8d()};3J.L=q[u][0]}y{Z.L=15+\'2E.P\';h(q[u][1]==\'2A\'){h(1I){1i.V=\'<2A I="27" a0="0"></2A>\'}y{F d=r.5a(\'2A\');d.3I(\'I\',\'27\');1i.1S(d)}}h(q[u][1]==\'2i\'){h(18.5v&&18.33&&18.33.Q){d=\'<3v I="27" 3p="5r/x-7a-2i" L="\'+q[u][0]+\'" O="\'+C+\'" U="\'+J+\'" 5t="3N" 4y="Y" 4z="4A" />\'}y{d=\'<2W I="27" 4H="4J:7r-7t-7v-7x-7z" O="\'+C+\'" U="\'+J+\'"><1p 1f="7F" 1q="\'+q[u][0]+\'" /><1p 1f="4z" 1q="4A" /><1p 1f="4y" 1q="Y" /><1p 1f="5t" 1q="3N" />\'}1i.V=d}h(q[u][1]==\'3h\'){h(18.5v&&18.33&&18.33.Q){d=\'<3v I="27" 3p="5r/x-7a-2i" L="4p://4S.3h.3x/v/\'+q[u][0]+\'" O="\'+C+\'" U="\'+J+\'" 5t="3N" 4y="Y" 4z="4A" />\'}y{d=\'<2W I="27" 4H="4J:7r-7t-7v-7x-7z" O="\'+C+\'" U="\'+J+\'"><1p 1f="7F" 1q="4p://4S.3h.3x/v/\'+q[u][0]+\'" /><1p 1f="4z" 1q="4A" /><1p 1f="4y" 1q="Y" /><1p 1f="5t" 1q="3N" />\'}1i.V=d}h(q[u][1]==\'2V\'){h(18.5v&&18.33&&18.33.Q){d=\'<3v I="27" L="\'+q[u][0]+\'" 5Y="Y" 4r="7S" 7U="Y" 7W="Y" 3p="bV/2V" 7Y="4p://4S.80.3x/2V/4W/" />\'}y{d=\'<2W I="27" 4H="4J:c4-c9-aT-9V-ah" aZ="4p://4S.80.3x/aj/b0.9X"><1p 1f="L" 1q="\'+q[u][0]+\'" /><1p 1f="7W" 1q="Y" /><1p 1f="5Y" 1q="Y" /><1p 1f="4r" 1q="7S" /><1p 1f="7U" 1q="Y" /></2W>\'}1i.V=\'<p 1g="86">88 4Z 8c 26 8e, 4Z 8g 8i 4W 67 bg 8m 8o 1j 8q 8s!</p>\'+d}h(q[u][1]==\'3j\'){h(18.5v&&18.33&&18.33.Q){d=\'<3v I="27" 7Y="4p://bs.3x/ay/a5/bw/4W/" 3p="5r/x-aA" L="\'+q[u][0]+\'" 5Y="Y" by="Y" 9G="Y" />\'}y{d=\'<2W I="27" 4H="4J:bA-aC-bC-a7-bE" 3p="5r/x-aE"><1p 1f="4P" 1q="\'+q[u][0]+\'" /><1p 1f="bI" 1q="Y" /><1p 1f="bK" 1q="Y" /><1p 1f="a9" 1q="bM" /><1p 1f="aH" 1q="3d" /><1p 1f="bO" 1q="Y" /></2W>\'}1i.V=\'<p 1g="86">88 4Z 8c 26 8e, 4Z 8g 8i 4W 67 bQ bS 8m 8o 1j 8q 8s!</p>\'+d}h(q[u][1]==\'2f\'){h(q[u][12]){1i.V=\'<T I="27">\'+q[u][12]+\'</T>\'}y{3S(\'6l 6n: 52 bU aL \\\'2f=\\\' 55! 8w...\');3X();S}}h(q[u][1]==\'2B\'){h(r.z(q[u][0].H(\'#\')[1])){h(q[u][3]==E){C=r.z(q[u][0].H(\'#\')[1]).2D}h(q[u][4]==E){J=r.z(q[u][0].H(\'#\')[1]).2p}F d=r.z(q[u][0].H(\'#\')[1]).bX(Y);1i.1S(d);1v=1i.4K[0];1v.o.W=\'1x\'}y{3S(\'6l 6n: bZ ad c1 "\'+q[u][0].H(\'#\')[1]+\'" 3Q 95! 8w...\');3X();S}}y{1v=r.z(\'27\')}h(1I&&q[u][1]==\'2i\'){}y h(3t==\'G\'){58=17 1T.3a(1v,{1U:6m,2z:w(){h(1I){1v.o.6i(\'1o\')}h(3D){1v.o.20=\'1\'}1O.o.K=\'1m\';Z.o.W=\'1w\';4n.1F(0,1)}});58.56()}4l=C/J;3E();3W=1a;4e(\'52\')}S}}w 8d(){h(q[u][3]!=E){C=q[u][3]}y{C=3J.O}h(q[u][4]!=E){J=q[u][4]}y{J=3J.U}h(3o==\'G\'){h(!q[u][13]){q[u][13]=0}y h(q[u][13]==90||q[u][13]==6p){D=J;J=C;C=D}}3f=C;3P=J;4l=C/J;h(1A==\'3z\'){2x=3g;2C=7D}3E();Z.L=q[u][0];4e();S}w 3E(){h(C>29-(2*(1y+1b+2P+5j))){C=29-(2*(1y+1b+2P+5j));h(q[u][1]!=\'2A\'&&q[u][1]!=\'2B\'){J=2h.5l(C/4l)}}h(5f==1){D=1l}y{D=0}h(J>2a-(2*(1y+1b+2P+5j))-2X-41-D){J=2a-(2*(1y+1b+2P+5j))-2X-41-D;h(q[u][1]!=\'2A\'&&q[u][1]!=\'2B\'){C=2h.5l(4l*J)}}h(J<0){J=1}h(C<0){C=1}S}w 4e(a){D=C+2*1b;h(q[u][1]==\'1C\'&&C<3g){D=3g+2*1b}h(q[u][8]&&q[u][8]!=\'E\'&&5M==\'1X\'){h(1l==0){5f=1;2c.o.O=D+\'B\';2c.V=q[u][8];1l=2c.2p;h(1l>3k){1l=3k}3E();4e(a)}y{2c.o.O=D+\'B\';h(1l<2c.2p){1l=2c.2p;h(1l>=3k){1l=3k;3E();2q=3U+1l;5q(a)}y{1l=2c.2p;3E();4e(a)}}y{h(1l<3k){2q=3U+1l}h(1l==3k){2q=3U+3k}5q(a)}}}y{5f=0;2q=3U;5q(a)}}w 5q(a){3e.o.O=\'\';h(q[u][1]==\'1C\'&&1A!=\'3z\'&&1A!=\'3A\'){h(C<3g){3f=C;C=3g}}h(2x==C&&2C==J&&1l==5C){2M=1}y{2M=65}6W=1;h(1A==\'7Q\'){5s(a)}y h(1A==\'3z\'){5s(a);h(!a){6F()}h(3o==\'G\'){6H()}}y h(1A==\'3A\'){h(!a){Z.o.W=\'1x\';Z.o.20=1;Z.o.1o=\'3L(20=3d)\'}5s(a)}y h(1A==\'1X\'){6J();3e.o.U=J+(2*1b)+\'B\';Z.o.O=C+\'B\';Z.o.U=J+\'B\'}y h(1A==\'9Y\'){99(a)}S}w 99(a){5u=17 1T.6N(Z,{1U:2M,2z:w(){9f(a)}});5u.1F(2x,C)}w 9f(a){51=17 1T.4C(Z,{1U:2M,2z:w(){h(a==\'52\'){3B()}y{6T()}}});51.1F(2C,J);53=17 1T.4C(1B,{1U:2M});53.1F(5o,2q)}w 5s(a){5u=17 1T.6N(Z,{1U:2M,2z:w(){h(a==\'52\'){3B()}y{6T()}}});5u.1F(2x,C);51=17 1T.4C(Z,{1U:2M});51.1F(2C,J);53=17 1T.4C(1B,{1U:2M});53.1F(5o,2q)}w 4N(){1L=\'1X\';3F=\'4F\';23()}w 23(){1G.o.O=\'2j\';1L=\'1X\';5w=0;1G.o.K=\'R\'}w 6Y(){h(q[u][6]){6g=q[u][6]*97}y{6g=7N}1L=\'G\';h(18.1Q.1P(\'4D/2\')!=-1){1G.o.2m=(21((29-C)/2)+5V+38-1b)+\'B\';1G.o.36=(21((2a-J-2X-1l)/2)+7E+39-1b-5)+\'B\'}y{h(8Q){D=1}y{D=0}h(4f){16=1}y{16=0}1G.o.2m=35.aw+1y+1b+2P+5V+16+\'B\';1G.o.36=35.ax+1y+1b+2P+7E+D+\'B\'}8j=17 1T.6N(1G,{1U:6g,2z:w(){5w=0;1G.o.O=5w+\'B\';h(1L==\'G\'){h(u==q.Q-1){1M(1)}y{1M(u+1)}1Y()}}});8j.1F(0,C-(2*(1b+5V)))}w 5B(){28.o.K=\'R\';24.o.K=\'1m\';3F=\'7G\';1G.o.K=\'1m\';6Y()}w 8E(){24.o.K=\'R\';1G.o.K=\'R\';28.o.K=\'1m\';4N()}w aD(a){h(!a){a=u}h(q){h(q[a]){D=\'aF aG q 8l \'+(q.Q-1)+\' 7m aM 8O.\\n\';D+=\'aQ 1f (q[0]) 3Q: \'+q[0]+\'\\n\';D+=\'aS \'+a+\'. 8J 7I 67 3q (aW u=\'+a+\') 3Q:\\n\\n\';1j(t=0;t<14;t++){5L(t){1e 0:{16=\'2t\';1d}1e 1:{16=\'3p\';1d}1e 2:{16=\'1H\';1d}1e 3:{16=\'O\';1d}1e 4:{16=\'U\';1d}1e 5:{16=\'4u\';1d}1e 6:{16=\'4B\';1d}1e 7:{16=\'60\';1d}1e 8:{16=\'6V\';1d}1e 9:{16=\'b7\';1d}1e 10:{16=\'5X\';1d}1e 11:{16=\'6o\';1d}1e 12:{16=\'2f\';1d}1e 13:{16=\'b9 7I 1C\';1d}}D+=\'q[\'+a+\'][\'+t+\']:\\n\';D+=\'\\bb 1f\\t= \'+16+\'\\n\';D+=\'\\bd\\t\\t\';h(3D){D+=\'\\t\'}D+=\'= \';h(!q[a][t]){D+=\'E (N/A)\'}y h(q[a][t]==\'E\'){D+=\'\\\'E\\\' (bh)\'}y{D+=q[a][t]}D+=\'\\n\'}3S(D)}y{3S(\'q 8l bj \'+(q.Q-1)+\' 7m, q[\'+a+\'] 8t\\\'t 7o!\')}}y{3S(\'q 8t\\\'t 7o! bp G br 2g-bt bv bx bz!\')}}w 22(a){h(6j==\'G\'){2n.V=a;2n.o.36=39+10+\'B\';2n.o.4R=-(2n.2D/2)+\'B\';2n.o.8U=\'7M 8x 7M 8x\';2n.o.W=\'1x\'}}w 1W(){2n.o.W=\'1w\'}w 3B(){h(q[u][1]==\'2A\'){1v.L=q[u][0]}h(bH==\'G\'){bJ()}h(q[u][1]==\'1C\'){1O.o.36=bL+\'B\';1O.o.76=bP+\'B\'}y{1O.o.36=bR+\'B\';1O.o.76=bT+\'B\'}h(q[u][1]==\'1C\'){h(q.Q<3){3F=\'4F\';28.o.K=\'R\';24.o.K=\'R\'}y{h(3F==\'4F\'){28.o.K=\'1m\';24.o.K=\'R\';h(q[u][7]){5B()}}y{24.o.K=\'1m\';28.o.K=\'R\';1G.o.K=\'1m\';6Y()}}5D.K=\'1m\';2r.o.U=J+\'B\';2s.o.U=J+\'B\';2x=C;2C=J;2b.o.O=C+(2*1b)+\'B\';2b.o.U=J+(2*1b)+\'B\';8z();h(3t==\'G\'){4n.1F(0,1)}y{1B.o.W=\'1x\';3u()}h(4L==\'3N\'){2S.o.K=\'1m\'}}y{h(3F==\'7G\'){4N()}24.o.K=\'R\';28.o.K=\'R\';1G.o.K=\'R\';5F();1i.o.K=\'1m\';1i.o.O=C+\'B\';1i.o.U=J+\'B\';1v.o.36=\'2j\';1v.o.2m=\'2j\';h((q[u][1]==\'2B\')&&(r.z(q[u][0].H(\'#\')[1]).2D>C||r.z(q[u][0].H(\'#\')[1]).2p>J)){1i.o.6s=\'6A\';1v.o.O=r.z(q[u][0].H(\'#\')[1]).2D+\'B\';1v.o.U=r.z(q[u][0].H(\'#\')[1]).2p+\'B\'}y h(q[u][1]!=\'2B\'&&q[u][1]!=\'2f\'){1v.o.O=C+\'B\';1v.o.U=J+\'B\'}h(q[u][1]==\'2f\'&&(1v.2D>C||1v.2p>J)){1i.o.6s=\'6A\'}1i.o.7n=\'7B \'+1b+\'B \'+7J;h(3t==\'1X\'){1B.o.W=\'1x\';1v.o.W=\'1x\';1O.o.K=\'1m\';3u()}y{h((1I&&q[u][1]==\'2i\')||(2Y&&q[u][1]==\'3j\')){1v.o.W=\'1x\';1O.o.K=\'1m\';3u();4n.1F(0,1)}y{h(q[u][1]==\'2B\'){58.1F(0,.c0)}y{58.1F(0,1)}}}}1h.o.6t=\'2m\';5F();1O.o.K=\'1m\';h(q[u][2]&&q[u][2]!=\'E\'){1R.V=\'\';1R.1S(r.2K(q[u][2]));h(1R.2D>C+(2*1b)){8D(q[u][2])}y{1h.1S(r.2K(q[u][2]))}}y{h(c6==\'G\'){1h.1S(r.2K((q[u][0].H(\'/\'))[(q[u][0].H(\'/\').Q)-1]))}y{1h.V=\'&c8;\'}}h(q[u][8]&&q[u][8]!=\'E\'){2e.o.K=\'1m\';2e.o.U=1l+\'B\';2e.V=q[u][8]}y{2e.o.K=\'R\'}h(7P==\'G\'&&q[0]!=\'2g\'){1s.1S(r.2K(q[0]))}h(8F==\'G\'&&q.Q>2){1s.1S(r.2K(\' \'+7f.3i(0,1)+u+\'/\'+(q.Q-1)+7f.3i(1,2)+\' \'))}h(aV==\'G\'){5L(q[u][1]){1e\'2i\':{D=3K;2y=3H;1d}1e\'2A\':{D=3K;2y=3H;1d}1e\'1C\':{h(3f>C||3P>J){D=6S;2y=4Q}y{D=3K;2y=3H}1d}1e\'2V\':{D=3Z;2y=3l;1d}1e\'3j\':{D=3Z;2y=3l;1d}1e\'3h\':{D=3K;2y=3l;1d}}h(q[u][10]&&q[u][10]!=\'E\'){16=q[u][10];D=3Z;2y=3l}y{16=q[u][0]}h(q[u][11]==E){6u=\'aX="9M"\'}y{6u=\'\'}h((!q[u][10]||q[u][10]==\'E\')&&(q[u][1]==\'2B\'||q[u][1]==\'2f\')){5N=1a}y{5N=Y}h((7P==\'G\'||8F==\'G\')&&5N==Y){h(q[0]!=\'2g\'){1s.V+=\'<2o 1g="48"> | </2o>\'}1s.V+=\' <a 1K="22(2y);" 25="1W();" 1g="37" \'+6u+\' 2t="\'+16+\'">\'+D+\'</a>\'}}h(37==\'G\'&&q[0]!=\'2g\'){1s.V+=\'<2o 1g="48"> | </2o>\'}5b();3w=\'G\';6W=0;5o=2q;5C=1l;h(3o==\'G\'&&q[u][1]==\'1C\'){1s.V+=\'<2o 1g="48"> | </2o>\';1s.V+=\' <a 1K="22(5e);" 25="1W();" 1g="37" I="7T" 1f="al">\'+5I+\'</a>\';1s.V+=\' <a 1K="22(59);" 25="1W();" 1g="37" I="8N" 1f="9F">\'+5A+\'</a>\';r.z(\'8N\').1E=w(){q[u][13]+=90;h(q[u][13]==b6){q[u][13]=0}h(1L==\'G\'){23()}1M(u);1Y();S 1a};r.z(\'7T\').1E=w(){q[u][13]-=90;h(q[u][13]==-90){q[u][13]=6p}h(1L==\'G\'){23()}1M(u);1Y();S 1a}}}w 49(){1l=0;3w=\'1X\';2b.o.O=\'2j\';2b.o.U=\'2j\';2b.o.W=\'1w\';3y=0;2r.o.K=\'R\';2s.o.K=\'R\';5D.K=\'R\';2N.o.W=\'1w\';2G.o.W=\'1w\';1O.o.K=\'R\';1h.V=\'\';2e.V=\'\';1s.V=\'\';h(C==3g&&1A!=\'3z\'&&1A!=\'3A\'){3e.o.O=C+2*1b+\'B\'}1B.o.O=\'2j\';1B.o.W=\'1w\';2S.o.O=\'2j\';2S.o.K=\'R\';79();4c.o.W=\'1w\';28.o.K=\'R\';24.o.K=\'R\';1i.V=\'\';1i.o.K=\'R\';1i.o.6s=\'\';1W()}w 8z(){h(q[0]!=\'2g\'){D=17 2J();1j(i=1;i<q.Q;i++){h(!q[i][5]){q[i][5]=\'68\'}1D=q[i][0].H(\'.\')[q[i][0].H(\'.\').Q-1];5g=q[i][5].H(\'.\')[q[i][5].H(\'.\').Q-1];1D=1D.44();5g=5g.44();h(q[i][5]==\'68\'||(q[i][1]==\'1C\'&&1k.M(5g)==E)){16=15+\'9Z\'+q[i][1]+\'.P\';h(q[i][1]==\'2i\'&&q[i][0].M(\'3h\')!=E){16=15+\'9s.P\'}h(q[i][1]==\'3j\'){16=15+\'9q\';h(1D.M(\'5W\')!=E){16+=\'5W\'}h(1D.M(\'7q\')!=E||1D.M(\'6d\')!=E){16+=\'6d\'}h(1D.M(\'63\')!=E){16+=\'63\'}h(1D.M(\'6r\')!=E){16+=\'6r\'}h(1D.M(\'6B\')!=E){16+=\'6B\'}h(1D.M(\'6R\')!=E){16+=\'6R\'}16+=\'.P\'}}y{16=q[i][5]}D.3V(16)}8R(D)}}w 8R(a){1J=17 2J();3Y=17 2J();1j(i=0;i<a.Q;i++){1J[i]=17 4i();1J[i].L=a[i];3Y[i]=1a}4U=0;64(1J)}w 64(){F a;h(4U==1J.Q){h(a){4h(a)}4c.o.W=\'1x\';2S.o.O=C+(2*1b)+\'B\';2S.o.36=J-70+\'B\';F b=\'\';F c=10;F d=0;F e=7;F f=e;2U=2*e+2;1j(i=0;i<1J.Q;i++){d=2h.5l(1J[i].O/1J[i].U*50);h(d<1){d=50}2U+=d}2U+=(q.Q-2)*c;1j(i=0;i<1J.Q;i++){h(i==u-1){b+=\'<1k o="2m: \'+f+\'B; 20: \'+8T+\'; 1o: 3L(20=\'+(8T*3d)+\');" L="\'+1J[i].L+\'" U="50" 1g="7X" I="bf" 1r="\'+(i+1)+\' / \'+(q.Q-1)+\'" />\'}y{b+=\'<a 1E="h(1L==\\\'G\\\'){23();}1M(\'+(i+1)+\');1Y();"><1k o="2m: \'+f+\'B;" L="\'+1J[i].L+\'" U="50" 1g="7X" 1r="\'+(i+1)+\' / \'+(q.Q-1)+\'" /></a>\'}f+=2h.5l(1J[i].O/1J[i].U*50)+c}46.o.O=2U+\'B\';46.V=b;46.o.4R=(C-2U)/2+\'B\'}y{1j(i=0;i<=1J.Q;i++){h(3Y[i]==1a&&1J[i].a1){3Y[i]=Y;4U++}}a=4s(\'64()\',5)}}w 5b(){h(u>1){h(8V==\'G\'&&q[u-1][1]==\'1C\'){7h=17 4i();7h.L=q[u-1][0]}h(37==\'G\'){1s.V+=\' <a 1K="22(3C);" 25="1W();" 1g="37" 1E="h(1L==\\\'G\\\'){23();}1M(\'+(u-1)+\');1Y();" 1r="&bi;">\'+5G+\'</a>\'}h(q[u][1]==\'1C\'){2r.o.K=\'1m\';2r.1E=w(){h(1L==\'G\'){23()}1M(u-1);1Y();S 1a}}}h(u<q.Q-1){h(8V==\'G\'&&q[u+1][1]==\'1C\'){8X=17 4i();8X.L=q[u+1][0]}h(37==\'G\'){1s.V+=\' <a 1K="22(3T);" 25="1W();" 1g="37" 1E="h(1L==\\\'G\\\'){23();}1M(\'+(u+1)+\');1Y();" 1r="&bk;">\'+5S+\'</a>\'}h(q[u][1]==\'1C\'){2s.o.K=\'1m\';2s.1E=w(){h(1L==\'G\'){23()}1M(u+1);1Y();S 1a}}}S}w 3X(){5K=\'G\';h(1I&&q[u][1]==\'3j\'){1v.4P=\'\';1i.9a(1i.av)}49();4N();1h.V=\'\';1s.V=\'\';Z.L=15+\'2E.P\';2x=C;2C=J;3e.o.U=J+(2*1b)+\'B\';Z.o.K=\'R\';35.o.W=\'1w\';7Z();6c();3y=1;S}w 7Z(){77.1F(9m,0);h(6y==\'G\'){5P()}h(6E==\'G\'){6G()}S}w 5F(){1B.o.O=C+(2*1b)+\'B\'}w 6T(){h(C>3f){3e.o.O=C+(2*1b)+\'B\';Z.o.O=3f+\'B\'}h(J>3P){3e.o.U=J+(2*1b)+\'B\';Z.o.U=3P+\'B\'}h(1A!=\'3A\'){1h.V=\'\';1s.V=\'\';h(3o==\'G\'){6H()}y{Z.L=q[u][0]}h(3t==\'G\'&&1A!=\'3z\'){6F()}y{Z.o.W=\'1x\';3B()}}y{3B()}}w 6H(){2L.L=q[u][0];h(2L.O==0&&5E){2L.7C=w(){6C()}}y{6C()}}w 6C(){F a=Z.bo(\'2d\');Z.3I(\'O\',C);Z.3I(\'U\',J);a.bq(q[u][13]*2h.9P/7w);5L(q[u][13]){1e 0:{a.5i(2L,0,0,C,J);1d}1e 90:{a.5i(2L,0,-C,J,C);1d}1e 7w:{a.5i(2L,-C,-J,C,J);1d}1e 6p:{a.5i(2L,-J,0,J,C);1d}}}w 6F(){6k.1F(0,1)}w 1Y(){h(1A!=\'3A\'&&3t==\'G\'&&q[u][1]==\'1C\'){8L.1F(1,0);92.1F(1,0)}y{Z.o.W=\'1w\';49();3y=1}}w 3u(){h(q[u][9]&&q[u][9]!=\'E\'){h(q[u][9]==\'G\'){1n.1E=w(){3X();S 1a}}h(q[u][9]==\'1X\'){1n.1E=\'\'}}y{h(bu==\'G\'){1n.1E=w(){3X();S 1a}}}}w 6c(){1n.1E=\'\'}w 85(){h(4L!=\'3N\'){2b.o.W=\'1x\'}2S.o.K=\'1m\';S}w 5x(){2b.o.W=\'1w\';2S.o.K=\'R\';S}w 9e(){6x();6z();81();h(2a>2k){2k=2a}h((18.1Q.1P("94")!=-1||18.1Q.1P("4D/2")!=-1)&&29!=2l){47=19.66+19.5k-2k}y{47=0}h(18.1Q.1P("4D/3")!=-1){47+=1}6J();h(4I==0){h(2l>29){1n.o.O=2l+\'B\'}y{1n.o.O=\'3d%\'}h(2Y&&21(18.1Q.H(\'/\')[1].H(\' (\')[0].H(\'.\')[0]+18.1Q.H(\'/\')[1].H(\' (\')[0].H(\'.\')[1])>98){h(r.1c.5H<19.5k){29-=19.4o-r.1c.4a}h(38>0){1n.o.O=2l+38+\'B\'}}}y{1n.o.O=2l+4I+\'B\'}S}w 7b(e){h(2U>C){h(1I){4q=7j.bG}y{4q=e.9R}h(4q<0){4q=0}46.o.4R=((29-C)/2-4q)/(C/(2U-C-(2*1b)))+\'B\'}}w 8D(a){1R.V=\'\';1R.1S(r.2K(a));1R.V+=\' | \';1R.1S(r.2K(a));1R.V+=\' | \';1h.V=\'\';1h.1S(r.2K(a));1h.V+=\'<2o 1g="48"> | </2o>\';1h.1S(r.2K(a));1h.V+=\'<2o 1g="48"> | </2o>\';5R()}w 5R(){h(2T<0){2T++}y{h(2T<1R.2D/2){1h.o.2m=-2T+\'B\';2T++}y{1h.o.2m=\'2j\';2T=0}}54=4s(\'5R()\',30)}w 79(){h(54){4h(54)}1h.o.2m=\'2j\';2T=8v}w 6J(){6L=21(38-(C+(2*(1y+1b+2P)))/2);6w=21(39-(5O+J+2X+41+(2*(1y+1b+2P))+(2q-3U))/2);35.o.4R=6L+\'B\';35.o.93=(6w-(47/2))+\'B\';S}w 6z(){26.2l=0;26.2k=0;h(19.4o&&19.6M){2l=19.4o+19.6M;2k=19.5k+19.66}y h(r.1c.6a>r.1c.2D){2l=r.1c.6a;2k=r.1c.5H}y{2l=r.1c.2D;2k=r.1c.2p}h(1I||2Y){2l=r.1c.6a;2k=r.1c.5H}h(3D||18.1Q.1P(\'94\')!=-1){2l=29+19.6M;2k=2a+19.66}S}w 6x(){26.29=0;26.2a=0;h(r.2w&&(r.2w.4a||r.2w.3G)){29=r.2w.4a;2a=r.2w.3G}y h(4g(19.4o)==\'4v\'){29=19.4o;2a=19.5k}y h(r.1c&&(r.1c.4a||r.1c.3G)){29=r.1c.4a;2a=r.1c.3G;S}h(2Y&&21(18.1Q.H(\'/\')[1].H(\' (\')[0].H(\'.\')[0]+18.1Q.H(\'/\')[1].H(\' (\')[0].H(\'.\')[1])<98){2a=r.1c.3G}h(r.89!=45){h(r.89.M(\'9K\')&&(3D||2Y||5E)){2a=r.1c.3G}}S}w 81(){26.38=0;26.39=0;h(4g(19.9k)==\'4v\'){39=19.9k;38=19.aJ}y h(r.1c&&(r.1c.5p||r.1c.4Y)){39=r.1c.4Y;38=r.1c.5p}y h(r.2w&&(r.2w.5p||r.2w.4Y)){39=r.2w.4Y;38=r.2w.5p}S}w 7H(){F s,i,j;F a=17 2J();a.3V(r.z(\'6I\'));a.3V(r.z(\'5y\'));a.3V(r.z(\'6e\'));a.3V(r.z(\'5T\'));a.3V(r.z(\'6U\'));1j(F i=0;i<a.Q;i++){s=a[i].4x(\'L\');h(s.44().1P(\'.1z\')!=-1){a[i].L=15+\'2E.P\';a[i].o.1o+="2O:2I.2Q.2H(L=\'"+s+"\', 2R=1C);"}}r.z(\'5n\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/9y.1z\', 2R=\'4r\');";r.z(\'5h\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/9z.1z\', 2R=\'4d\');";r.z(\'57\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/7g.1z\', 2R=\'4d\');";r.z(\'32\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/9w.1z\', 2R=\'4r\');";r.z(\'2Z\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/73.1z\', 2R=\'4r\');";r.z(\'4k\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/9u.1z\', 2R=\'4d\');";r.z(\'5c\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/71.1z\', 2R=\'4d\');";r.z(\'4V\').o.1o="2O:2I.2Q.2H(L=\'"+15+"/72.1z\', 2R=\'4d\');";r.z(\'5n\').o.2v="R";r.z(\'5h\').o.2v="R";r.z(\'57\').o.2v="R";r.z(\'32\').o.2v="R";r.z(\'2Z\').o.2v="R";r.z(\'4k\').o.2v="R";r.z(\'5c\').o.2v="R";r.z(\'4V\').o.2v="R"}w 87(){F a=r.2u(\'7k\');1j(i=0;i!=a.Q;i++){a[i].o.W=\'1w\'}}w 5P(){F a=r.2u(\'7k\');1j(i=0;i!=a.Q;i++){a[i].o.W=\'1x\'}}w 9g(){F a=r.2u(\'2W\');1j(i=0;i<a.Q;i++){a[i].o.W=\'1w\'}F b=r.2u(\'3v\');1j(i=0;i<b.Q;i++){b[i].o.W=\'1w\'}}w 6G(){F a=r.2u(\'2W\');1j(i=0;i<a.Q;i++){a[i].o.W=\'1x\'}F b=r.2u(\'3v\');1j(i=0;i<b.Q;i++){b[i].o.W=\'1x\'}}w 74(a){h(2Y){a=-a}h(q.Q>2){h(a>0&&u>1){h(1L==\'G\'){23()}1M(u-1);1Y()}h(a<0&&u<q.Q-1){h(1L==\'G\'){23()}1M(u+1);1Y()}}}w 6Z(a){F b=3w=="G";F c=0;h(!a)a=19.7j;h(a.7c){c=a.7c/c3;h(19.9H)c=-c}y h(a.9x){c=-a.9x/3}h(c&&b)74(c);h(a.9b&&!3W)a.9b();a.c7=3W}h(19.3r)19.3r(\'au\',6Z,1a);19.9A=r.9A=6Z;',62,755,'|||||||||||||||||if|||||||style||CB_Gallery|document|||CB_ActId||function||else|getElementById||px|CB_ImgWidth|temp|null|var|on|split|id|CB_ImgHeight|display|src|match||width|gif|length|none|return|div|height|innerHTML|visibility||true|CB_Img||||||CB_PicDir|temp2|new|navigator|window|false|CB_ImgBorder|body|break|case|name|class|CB_TxtT|CB_NotImgC|for|img|CB_TxtM|block|CB_HideContent|filter|param|value|alt|CB_TxtG|tempty|td|CB_NIC|hidden|visible|CB_RoundPix|png|CB_Animation|CB_Txt|image|extension|onclick|sajat|CB_SlideB|title|IE|CB_PreThumbs|onmouseover|CB_SSTimer|CB_LoadContent|trim|CB_Cls|indexOf|userAgent|CB_HTxt|appendChild|CB_effektek|idotartam|CB_Rel|CB_HideOSD|off|CB_ImgFadeOut|CB_Links|opacity|parseInt|CB_ShowOSD|CB_SlideShowJump|CB_SlideP|onmouseout|this|CB_NotIC|CB_SlideS|BrSizeX|BrSizeY|CB_ImgHd|CB_HTxtC||CB_TxtC|html|clearbox|Math|flash|0px|DocSizeY|DocSizeX|left|CB_O|span|offsetHeight|CB_TxtH|CB_Prv|CB_Nxt|href|getElementsByTagName|backgroundImage|documentElement|CB_ImgWidthOld|CB_NavTemp|halefutott|iframe|inner|CB_ImgHeightOld|offsetWidth|blank|CB_Fail|CB_NavN|AlphaImageLoader|DXImageTransform|Array|createTextNode|CB_Img2|CB_AnimSpd|CB_NavP|progid|CB_Padd|Microsoft|sizingMethod|CB_Thm|CB_STi|CB_AllThumbsWidth|quicktime|object|CB_TextH|OPERA|CB_Left||tempg|CB_Right|mimeTypes|background|CB_Win|top|CB_TextNav|DocScrX|DocScrY|Atlatszosag|CB_BtmNav|tempw|100|CB_ImgCont|CB_ImgWidthOrig|CB_MinWidth|youtube|substring|winmedia|CB_TxtHMax|CB_NavTDL|temph|tempst|CB_ImgRotation|type|gallery|addEventListener|CB_IsBody|CB_ImgTextFade|CB_CloseOnHON|embed|CB_ClearBox|com|CB_Faded|grow|warp|CB_Show|CB_NavTPrv|FIREFOX|CB_FitToBrowser|CB_SS|clientHeight|CB_NavTOpen|setAttribute|CB_preImages|CB_NavTextOpen|alpha|abs|always|isNaN|CB_ImgHeightOrig|is|tr|alert|CB_NavTNxt|CB_TxtHOrig|push|CB_ScrollEnabled|CB_Close|CB_LT|CB_NavTextDL|rel|CB_PadT|fontFamily|CB_Footer|toLowerCase|undefined|CB_Thm2|FF_ScrollbarBug|CB_Sep|CB_HideButtons|clientWidth|backgroundColor|CB_ShTh|crop|CB_CheckComment|IE6|typeof|clearTimeout|Image|CB_Header|CB_Btm|CB_ImgRate|fontWeight|TxtFadeEffect|innerWidth|http|tempX|scale|setTimeout|CB_BodyMarginY|tnhrf|number|fontSize|getAttribute|allowfullscreen|quality|high|slideshowtime|magassag|Firefox|CB_All|start|CB_WindowColor|classid|CB_BodyMarginX|clsid|childNodes|CB_ShowThumbnails|CB_IEShowBug|CB_SlideShowStop|CB_ATags|url|CB_NavTFull|marginLeft|www|z1|CB_ThumbsLoaded|CB_BtmRight|download|z2|scrollTop|you||CB_animHeight|HTML|CB_TextHeight|CB_ScrollTimer|parameter|elrejt|CB_TopRight|NicFadeEffect|CB_NavTRotR|createElement|CB_PrevNext|CB_BtmLeft|replace|CB_NavTRotL|CB_IsComment|extensthm|CB_TopLeft|drawImage|CB_WinPadd|innerHeight|round|CB_ActThumbSrc|CB_Top|CB_TxtHOld|scrollLeft|CB_AnimatePlease|application|CB_WindowResizeXY|allowscriptaccess|CB_animWidth|plugins|CB_SlideBW|CB_HideThumbs|CB_SlideShowS|CB_NavTextStart|CB_NavTextRotR|CB_SSStart|CB_TxtMOld|CB_PrvNxt|SAFARI|CB_TxtPos|CB_NavTextPrv|scrollHeight|CB_NavTextRotL|CB_NavTextStop|CB_Break|switch|CB_SimpleDesign|temp4|CB_ieRPBug|CB_ShowSelect|CB_ie6RPBug|CB_ScrollText|CB_NavTextNxt|CB_NavPrev|CB_Image|CB_SlideShowBarPadd|avi|dlhrf|loop|CB_Create|autoslideshow|CB__Init|CB_Padding|mp3|CB_CheckThumbs2|CB_AnimSpeed|scrollMaxY|the|nopreview|not|scrollWidth|btm_max|CB_CloseOnHOFF|mpg|CB_SlideShowP|CB_ContentHide|CB_SlShowTimer|color|removeAttribute|CB_OSD|ImgFadeEffect|ClearBox|CB_ImgOpacitySpeed|ERROR|dlinsame|270|CB_ShowTh|wav|overflow|textAlign|temp3|HideDocumentFadeEffect|CB_MarginT|getBrowserSize|CB_SelectsHide|getDocumentSize|auto|wma|CB_DrawCanvas|CB_PushToGal|CB_FlashHide|CB_ImgFadeIn|CB_ShowFlash|CB_SetCanvas|CB_CloseWindow|CB_SetMargins|CB_NavTextClose|CB_MarginL|scrollMaxX|szelesseg|CB_Thumbs|CB_PageLoaded|CB_NewAndLoad|wmv|CB_NavTextFull|CB_ImageFade|CB_NavNext|comment|CB_IsAnimating|MSIE|CB_SlideShow|scroll_wheel||s_btmleft|s_btmright|s_left|scroll_handle||right|HideDocumentFadeEffect2|CB_FontC|CB_ScrollTextStop|shockwave|getMouseXY|wheelDelta|CB_FontSizeC|canvas|CB_ItemNumBracket|s_topright|PreloadPrv|CB_PicturePrev|event|select|btm_prev|items|border|exist|CB_PictureNext|mpeg|D27CDB6E|CB_ImgContainer|AE6D|CB_Init|11cf|180|96B8|tempg2|444553540000|CB_HideDocument|solid|onload|CB_MinHeight|CB_SlideShowBarTop|movie|pause|CB_pngFixIE|of|CB_ImgBorderColor|CB_TextAlignC|CB_ImgHide|5px|CB_SlShowTime|CB_Image2|CB_ShowGalName|double|CB_TextOpacitySpeed|tofit|CB_RotL|controller|CB_PL|autoplay|CB_ThumbsImg|pluginspage|CB_ShowDocument|apple|getScrollPosition|CB_PicturePause|CB_NotImgContent|ltrim|CB_ShowThumbs|absolute|CB_HideSelect|If|compatMode|rtrim|windowsmedia|see|CB_GetImageSize|text|btm_dl|have|btm_rot_r|to|CB_ssbarWidth|CB_PictureStart|has|Player|CB_FontWeightC|plugin|closeonh|your|btm_rot_l|browser|doesn|CB_Prev|CB_STii|Exiting|10px|CB_Next|CB_CheckThumbs|CB_Text|CB_Content|CB_TT|CB_ScrollT|CB_SSPause|CB_ItemNum|CB_TC|attachEvent|CB_SlideShowBarOpacity|item|CB_TG|TxtFadeEffect2|CB_HiddenText|CB_RotR|all|CB_HideOpacitySpeed|IE67|CB_PreloadThumbs|CB_HiddenTextC|CB_ActThumbOpacity|padding|CB_Preload|btm_next|PreloadNxt|transparent|CB_PictureClose||RegExp|ImgFadeEffect2|marginTop|Netscape|missing|temphr|1000|950|CB_WindowResizeX|removeChild|preventDefault|CB_Thumbs2|CB_SlideShowBar|CB_SetAllPositions|CB_WindowResizeY|CB_HideFlash|CB_Open|CB_NewWindow|CB_FontT|pageYOffset|CB_ThumbsBGOpacity|CB_HideOpacity|CB_FontWeightT|200|table|no_winmedia|CB_FontSizeT|no_youtube|CB_Window|s_btm|OnLoad|s_right|detail|s_top|s_topleft|onmousewheel|CB_NavTextImgPrvNxt|CB_HideColor|captureEvents|CB_SlideShowBarColor|rr|autostart|opera|Opera|Event|Back|cellspacing|_blank|cellpadding|MOUSEMOVE|PI|jpeg|pageX|Safari|500|CB_BodyMarginLeft|BC80|CB_ThmPicArray|cab|normal|no_|frameborder|complete|CB_NavTextImgDL|base64|CB_AllowExtFunctCBClose|mediaplayer|CB_ExternalFunctionCBClose|B153|onmousemove|uiMode|CB_Body|CB_FontG|Bad|with|REL|CB_RoundPixBugFix|attribute|D3488ABDDC6B|format|qtactivex|CB_AllowExtFunctPageLoad|rl|CB_ExternalFunctionPageLoad|CB_ResizeTimer|CB_BodyMarginRight|CB_FontColorC|no_flash|bmp|htmlcontent||DOMMouseScroll|lastChild|offsetLeft|offsetTop|windows|no_iframe|mplayer2|no_image|394A|CB_ShowActItem|oleobject|At|now|volume|no_inner|pageXOffset|no_quicktime|without|in|CB_FontColorG|valign|CB_FontSizeG|Gallery|while|The|4B23|no_winmediaavi|CB_ShowDL|when|target|no_winmediamp3|codebase|qtplugin|no_winmediampg|CB_FontColorT|no_winmediawav|CB_ThumbsBGColor|no_winmediawma|360|colseonh|02|rotation|mov|tparameter|position|tvalue|static|CB_ThumbsActImg|QuickTime|string|lt|only|gt|no_winmediawmv|CB_AllowedToRun|load|getContext|Click|rotate|any|microsoft|link|CB_CloseOnH|and|en|try|showstatusbar|again|6BF52A52|align|11D3|CB_Ver|00C04F79FAA6|CB_NavTextImgRot|clientX|CB_AllowExtFunctLoad|SendPlayStateChangeEvents|CB_ExternalFunctionLoad|AutoStart|CB_CloseBtnTop|mini|CB_BodyMarginTop|stretchToFit|CB_CloseBtnRight|Windows|CB_CloseBtn2Top|Media|CB_CloseBtn2Right|mode|video|CB_FontWeightG|cloneNode|CB_BodyMarginBottom|Object|9999|ID|swf|120|02BF25D5|jpg|CB_ShowURL|returnValue|nbsp|8C17|no_html'.split('|'),0,{}));eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('L 9=m 1K();9.w=4(){};9.w.H={B:4(a){3.i=z({12:4(){},13:4(){},1a:9.1c.1e,11:1H,1i:\'C\',1k:21,1g:1q},a||{})},18:4(){L a=m U().X();5(a<3.I+3.i.11){5(3.6.r(\'s\')==\'1P\'&&1J==\'1V\'){3.8=3.E;3.u();7}5((3.6.r(\'s\')==\'R\'||3.6.r(\'s\')==\'1L\'||3.6.r(\'s\')==\'1E\')&&1M==\'1Q\'){3.u();7}3.14=a-3.I;3.15()}l{1v(3.i.13.S(3,3.6),10);3.u();3.8=3.E}3.x()},15:4(){3.8=3.1o(3.16,3.E)},1o:4(a,b){L c=b-a;7 3.i.1a(3.14,a,c,3.i.11)},u:4(){1R(3.A);3.A=1C;7 3},1h:4(a,b){5(!3.i.1k)3.u();5(3.A)7;1v(3.i.12.S(3,3.6),10);3.16=a;3.E=b;3.I=m U().X();3.A=20(3.18.S(3),N.1y(1B/3.i.1g));7 3},q:4(a,b){7 3.1h(a,b)},y:4(a){3.8=a;3.x();7 3},1A:4(){7 3.y(0)},J:4(e,p,v){5(3.6.r(\'s\')==\'R\'&&p==\'K\'){5(k-o!=0){j=h/2*(k-3.8)/(k-o)}l{j=0}n=(m U().X()-3.I)/1T;5(n>1){n=1}5(h!=0&&g!=0){j=g/2+(h-g)/2*n}5(h==0&&g!=0){j=g/2-g/2*n}5(o+h==k+g){5(h!=0){j=(k-o)/2*(k-3.8)/(k-o)+(g/2)}5(h==0&&g!=0){j=g/2+(k-3.8)/2}}5(1l==1n){5(h!=0&&g==0){j=h/2*n}}5(1l!=1n){5(h!=0&&g==0&&o==o){j=h/2*n}}1p=1r(1Z-(1F+3.8+1N+1D+(2*(1t+M+1w)))/2-j);1x.f.23=(1p-(24/2))+\'C\';1z.f.K=3.8+(2*M)+\'C\'}5(3.6.r(\'s\')==\'R\'&&p==\'1j\'){1b=1r(1G-(3.8+(2*(1t+M+1w)))/2);1x.f.1I=1b+\'C\'}5(p==\'F\'){5(v==0&&e.f.D!="G")e.f.D="G";l 5(e.f.D!="1m")e.f.D="1m";5(1S.1U)e.f.1W="1Y(F="+v*1q+")";e.f.F=v}l e.f[p]=v+3.i.1i}};9.1d=W.Y();9.1d.H=z(m 9.w(),{Z:4(a,b){3.6=$P(a);3.B(b);3.6.f.1f=\'G\'},T:4(){5(3.6.1s>0)7 3.q(3.6.1s,0);l 7 3.q(0,3.6.19)},Q:4(){7 3.y(3.6.19)},x:4(){3.J(3.6,\'K\',3.8)}});9.1u=W.Y();9.1u.H=z(m 9.w(),{Z:4(a,b){3.6=$P(a);3.B(b);3.6.f.1f=\'G\';3.V=3.6.O},T:4(){5(3.6.O>0)7 3.q(3.6.O,0);l 7 3.q(0,3.V)},Q:4(){7 3.y(3.V)},x:4(){3.J(3.6,\'1j\',3.8)}});9.17=W.Y();9.17.H=z(m 9.w(),{Z:4(a,b){3.6=$P(a);3.B(b);3.8=1},T:4(){5(3.8>0)7 3.q(1,0);l 7 3.q(0,1)},Q:4(){7 3.y(1)},x:4(){3.J(3.6,\'F\',3.8)}});9.1c={1X:4(t,b,c,d){7 c*t/d+b},1e:4(t,b,c,d){7-c/2*(N.22(N.1O*t/d)-1)+b}};',62,129,'|||this|function|if|CBe|return|most|CB_effektek||||||style|CB_TxtMOld|CB_TxtM|params|temp|CB_ImgHeightOld|else|new|arany|CB_ImgHeight||sajat|getAttribute|id||clearTimer||alap|noveles|set|Kiterjeszt|timer|parameterek|px|visibility|hova|opacity|hidden|prototype|time|setStyle|height|var|CB_ImgBorder|Math|offsetWidth|CB|mutat|CB_Image|lancol|toggle|Date|iniWidth|Osztaly|getTime|letrehoz|azonnallefut||idotartam|haelindul|halefutott|cTime|setNow|honnan|Atlatszosag|effekt_lepes|scrollHeight|effekt|CB_MarginL|Effektek|magassag|evlassitva|overflow|fps|_start|egyseg|width|varakozas|CB_ImgWidth|visible|CB_ImgWidthOld|compute|CB_MarginT|100|parseInt|offsetHeight|CB_RoundPix|szelesseg|setTimeout|CB_Padd|CB_Win|round|CB_ImgCont|elrejt|1000|null|CB_PadT|CB_NotIC|CB_ieRPBug|DocScrX|500|marginLeft|CB_SSTimer|Object|CB_Text|CB_Break|CB_TextH|PI|CB_SlideShowBar|on|clearInterval|window|CB_AnimSpd|ActiveXObject|off|filter|egyenletes|alpha|DocScrY|setInterval|true|cos|marginTop|FF_ScrollbarBug'.split('|'),0,{}));

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        var path = options.path ? '; path=' + options.path : '';
        var domain = options.domain ? '; domain=' + options.domain : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

/*
 * jqModal - Minimalist Modaling with jQuery
 *   (http://dev.iceburg.net/jquery/jqModal/)
 *
 * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 * 
 * $Version: 07/06/2008 +r13
 */
(function($) {

	$.fn.Layer=function(o){

		var p={

			overlay: 			70,
			overlayClass: 		'layer_overlay',
			closeClass: 		'layer_close',
			trigger: '			.layer',
			ajax: 				F,
			ajaxText: 			'',
			target: 			F,
			modal: 				F,
			toTop: 				F,
			onShow:	 			F,
			onHide: 			F,
			onLoad: 			F

		};
return this.each(function(){if(this._Layer)return H[this._Layer].c=$.extend({},H[this._Layer].c,o);s++;this._Layer=s;
H[s]={c:$.extend(p,$.Layer.params,o),a:F,w:$(this).addClass('LayerID'+s),s:s};
if(p.trigger)$(this).LayerAddTrigger(p.trigger);
});};

$.fn.LayerAddClose=function(e){return hs(this,e,'LayerHide');};
$.fn.LayerAddTrigger=function(e){return hs(this,e,'LayerShow');};
$.fn.LayerShow=function(t){return this.each(function(){$.Layer.open(this._Layer,t);});};
$.fn.LayerHide=function(t){return this.each(function(){$.Layer.close(this._Layer,t)});};

$.Layer = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
 if(c.modal) {if(!A[0])L('bind');A.push(s);}
 else if(c.overlay > 0)h.w.LayerAddClose(o);
 else o=F;

 h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
 if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}

 if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
  r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.LayerAddClose($(cc,h.w));e(h);});}
 else if(cc)h.w.LayerAddClose($(cc,h.w));

 if(c.toTop&&h.o)h.w.before('<span id="LayerP'+h.w[0]._Layer+'"></span>').insertAfter(h.o);	
 (c.onShow)?c.onShow(h):h.w.show();e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
 if(A[0]){A.pop();if(!A[0])L('unbind');}
 if(h.c.toTop&&h.o)$('#LayerP'+h.w[0]._Layer).after(h.w).remove();
 if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
},
params:{}};
var s=0,H=$.Layer.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
i=$('<iframe src="javascript:false;document.write(\'\');" class="Layer"></iframe>').css({opacity:0}),
e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.Layer',h.w)[0])h.w.prepend(i); f(h);},
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.LayerID'+h.s)[0]);if(r)f(h);return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._Layer;$(t).each(function() {
 if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {LayerShow:1,LayerHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery);

/*
 * jQuery Cycle Plugin for light-weight slideshows
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version: 2.22 (06/08/2008)
 * 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.1.3.1 or later
 *
 * 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($) {

var ver = '2.22';
var ie6 = $.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,''));
};

$.fn.cycle = function(options) {
    return this.each(function() {
        options = options || {};
        if (options.constructor == String) {
            switch(options) {
            case 'stop':
                if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
                this.cycleTimeout = 0;
                return;
            case 'pause':
                this.cyclePause = 1;
                return;
            case 'resume':
                this.cyclePause = 0;
                return;
            default:
                options = { fx: options };
            };
        }

        // stop existing slideshow for this container (if there is one)
        if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
        this.cycleTimeout = 0;
        this.cyclePause = 0;
        
        var $cont = $(this);
        var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children();
        var els = $slides.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 = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
        if (opts.autostop) 
            opts.countdown = opts.autostopCount || els.length;
            
        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); });
            
        // clearType corrections
        if (ie6 && opts.cleartype && !opts.cleartypeNoBg)
            clearTypeFix($slides);

        // 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 ($cont.css('position') == 'static') 
            $cont.css('position', 'relative');
        if (opts.width) 
            $cont.width(opts.width);
        if (opts.height && opts.height != 'auto') 
            $cont.height(opts.height);

        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
        var first = opts.startingSlide || 0;
        $slides.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;
            $(this).css('z-index', z) 
        });
        
        $(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case
        if ($.browser.msie) els[first].style.removeAttribute('filter');

        if (opts.fit && opts.width) 
            $slides.width(opts.width);
        if (opts.fit && opts.height && opts.height != 'auto') 
            $slides.height(opts.height);
        if (opts.pause) 
            $cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;});

        // run transition init fn
        var init = $.fn.cycle.transitions[opts.fx];
        if ($.isFunction(init))
            init($cont, $slides, opts);
        else if (opts.fx != 'custom')
            log('unknown transition: ' + opts.fx);
        
        $slides.each(function() {
            var $el = $(this);
            this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height();
            this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width();
        });

        opts.cssBefore = opts.cssBefore || {};
        opts.animIn = opts.animIn || {};
        opts.animOut = opts.animOut || {};

        $slides.not(':eq('+first+')').css(opts.cssBefore);
        if (opts.cssFirst)
            $($slides[first]).css(opts.cssFirst);

        if (opts.timeout) {
            // ensure that timeout and speed settings are sane
            if (opts.speed.constructor == String)
                opts.speed = {slow: 600, fast: 200}[opts.speed] || 400;
            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 = 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 = $slides[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)
            $(opts.next).bind('click', function(){return advance(els,opts,opts.rev?-1:1)});
        if (opts.prev)
            $(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) {
            var $s = $(newSlide), s = $s[0];
            if (!opts.autostopCount)
                opts.countdown++;
            els.push(s);
            if (opts.els) 
                opts.els.push(s); // shuffle needs this
            opts.slideCount = els.length;
            
            $s.css('position','absolute').appendTo($cont);
            
            if (ie6 && opts.cleartype && !opts.cleartypeNoBg)
                clearTypeFix($s);

            if (opts.fit && opts.width) 
                $s.width(opts.width);
            if (opts.fit && opts.height && opts.height != 'auto') 
                $slides.height(opts.height);
            s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height();
            s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width();

            $s.css(opts.cssBefore);
            
            if (typeof opts.onAddSlide == 'function')
                opts.onAddSlide($s);
        };

        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 (opts.busy) return;
    var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide];
    if (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) {
        if (opts.before.length)
            $.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
        var after = function() {
            if ($.browser.msie && opts.cleartype)
                this.style.removeAttribute('filter');
            $.each(opts.after, function(i,o) { 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 ($.isFunction($.fn.cycle[opts.fx]))
                $.fn.cycle[opts.fx](curr, next, opts, after);
            else
                $.fn.cycle.custom(curr, next, opts, after);
        }
        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)
            $.fn.cycle.updateActivePagerLink(opts.pager, opts.currSlide);
    }
    if (opts.timeout && !opts.continuous)
        p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout);
    else if (opts.continuous && p.cyclePause) 
        p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, 10);
};

$.fn.cycle.updateActivePagerLink = function(pager, currSlide) {
    $(pager).find('a').removeClass('activeSlide').filter('a:eq('+currSlide+')').addClass('activeSlide');
};

// advance slide forward or back
function advance(els, opts, val) {
    var p = els[0].parentNode, timeout = p.cycleTimeout;
    if (timeout) {
        clearTimeout(timeout);
        p.cycleTimeout = 0;
    }
    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 $p = $(opts.pager);
    $.each(els, function(i,o) {
        var $a = (typeof opts.pagerAnchorBuilder == 'function')
            ? $(opts.pagerAnchorBuilder(i,o))
            : $('<a href="#">'+(i+1)+'</a>');
        // don't reparent if anchor is in the dom
        if ($a.parents('body').length == 0)
            $a.appendTo($p);
        $a.bind(opts.pagerEvent, function() {
            opts.nextSlide = i;
            var p = els[0].parentNode, 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.rev);
            return false;
        });
    });
   //$p.find('a').filter('a:eq('+opts.startingSlide+')').addClass('activeSlide');
   $.fn.cycle.updateActivePagerLink(opts.pager, opts.startingSlide);
};

// this fixes clearType problems in ie6 by setting an explicit bg color
function clearTypeFix($slides) {
    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 = $.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';
    };
    $slides.each(function() { $(this).css('background-color', getBg(this)); });
};


$.fn.cycle.custom = function(curr, next, opts, cb) {
    var $l = $(curr), $n = $(next);
    $n.css(opts.cssBefore);
    var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb)};
    $l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() {
        if (opts.cssAfter) $l.css(opts.cssAfter);
        if (!opts.sync) fn();
    });
    if (opts.sync) fn();
};

$.fn.cycle.transitions = {
    fade: function($cont, $slides, opts) {
        $slides.not(':eq('+opts.startingSlide+')').css('opacity',0);
        opts.before.push(function() { $(this).show() });
        opts.animIn    = { opacity: 1 };
        opts.animOut   = { opacity: 0 };
        opts.cssBefore = { opacity: 0 };
        opts.cssAfter  = { display: 'none' };
    }
};

$.fn.cycle.ver = function() { return ver; };

// override these globally if you like (they are all optional)
$.fn.cycle.defaults = {
    fx:           'fade', // one of: fade, shuffle, zoom, scrollLeft, etc
    timeout:       4000,  // milliseconds between slide transitions (0 to disable auto advance)
    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,  // id of element to use as click trigger for next slide
    prev:          null,  // id of element to use as click trigger for previous slide
    prevNextClick: null,  // callback fn for prev/next clicks:  function(isNext, zeroBasedSlideIndex, slideElement)
    pager:         null,  // id of element to use as pager container
    pagerClick:    null,  // callback fn for pager clicks:  function(zeroBasedSlideIndex, slideElement)
    pagerEvent:   'click', // event which drives the pager navigation
    pagerAnchorBuilder: null, // callback fn for building anchor links
    before:        null,  // transition callback (scope set to element to be shown)
    after:         null,  // transition callback (scope set to element that was shown)
    end:           null,  // callback invoked when the slideshow terminates (use with autostop or nowrap 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
    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
    pause:         0,     // true to enable "pause on hover"
    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
};

})(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.22
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function($) {

//
// 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
$.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) {
    $cont.css('overflow','hidden');
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.cssBefore.top = next.offsetHeight;
        opts.animOut.top = 0-curr.offsetHeight;
    });
    opts.cssFirst = { top: 0 };
    opts.animIn   = { top: 0 };
    opts.cssAfter = { display: 'none' };
};
$.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) {
    $cont.css('overflow','hidden');
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.cssBefore.top = 0-next.offsetHeight;
        opts.animOut.top = curr.offsetHeight;
    });
    opts.cssFirst = { top: 0 };
    opts.animIn   = { top: 0 };
    opts.cssAfter = { display: 'none' };
};
$.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
    $cont.css('overflow','hidden');
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.cssBefore.left = next.offsetWidth;
        opts.animOut.left = 0-curr.offsetWidth;
    });
    opts.cssFirst = { left: 0 };
    opts.animIn   = { left: 0 };
};
$.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) {
    $cont.css('overflow','hidden');
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.cssBefore.left = 0-next.offsetWidth;
        opts.animOut.left = curr.offsetWidth;
    });
    opts.cssFirst = { left: 0 };
    opts.animIn   = { left: 0 };
};
$.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) {
    $cont.css('overflow','hidden').width();
//    $slides.show();
    opts.before.push(function(curr, next, opts, fwd) {
        $(this).show();
        var currW = curr.offsetWidth, nextW = next.offsetWidth;
        opts.cssBefore = fwd ? { left: nextW } : { left: -nextW };
        opts.animIn.left = 0;
        opts.animOut.left = fwd ? -currW : currW;
        $slides.not(curr).css(opts.cssBefore);
    });
    opts.cssFirst = { left: 0 };
    opts.cssAfter = { display: 'none' }
};
$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
    $cont.css('overflow','hidden');
//    $slides.show();
    opts.before.push(function(curr, next, opts, fwd) {
        $(this).show();
        var currH = curr.offsetHeight, nextH = next.offsetHeight;
        opts.cssBefore = fwd ? { top: -nextH } : { top: nextH };
        opts.animIn.top = 0;
        opts.animOut.top = fwd ? currH : -currH;
        $slides.not(curr).css(opts.cssBefore);
    });
    opts.cssFirst = { top: 0 };
    opts.cssAfter = { display: 'none' }
};

// slideX/slideY
$.fn.cycle.transitions.slideX = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        $(curr).css('zIndex',1);
    });    
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssBefore = { zIndex: 2 };
    opts.animIn  = { width: 'show' };
    opts.animOut = { width: 'hide' };
};
$.fn.cycle.transitions.slideY = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        $(curr).css('zIndex',1);
    });    
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssBefore = { zIndex: 2 };
    opts.animIn  = { height: 'show' };
    opts.animOut = { height: 'hide' };
};

// shuffle
$.fn.cycle.transitions.shuffle = function($cont, $slides, opts) {
    var w = $cont.css('overflow', 'visible').width();
    $slides.css({left: 0, top: 0});
    opts.before.push(function() { $(this).show() });
    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 < $slides.length; i++)
        opts.els.push($slides[i]);

    for (var i=0; i < opts.startingSlide; 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 $el = fwd ? $(curr) : $(next);
        $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() {
            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++)
                    $(opts.els[i]).css('z-index', len-i);
            else {
                var z = $(curr).css('z-index');
                $el.css('z-index', parseInt(z)+1);
            }
            $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() {
                $(fwd ? this : curr).hide();
                if (cb) cb();
            });
        });
    };
    opts.onAddSlide = function($s) { $s.hide(); };
};

// turnUp/Down/Left/Right
$.fn.cycle.transitions.turnUp = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.cssBefore.top = next.cycleH;
        opts.animIn.height = next.cycleH;
    });
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssFirst  = { top: 0 };
    opts.cssBefore = { height: 0 };
    opts.animIn    = { top: 0 };
    opts.animOut   = { height: 0 };
    opts.cssAfter  = { display: 'none' };
};
$.fn.cycle.transitions.turnDown = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.animIn.height = next.cycleH;
        opts.animOut.top   = curr.cycleH;
    });
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssFirst  = { top: 0 };
    opts.cssBefore = { top: 0, height: 0 };
    opts.animOut   = { height: 0 };
    opts.cssAfter  = { display: 'none' };
};
$.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.cssBefore.left = next.cycleW;
        opts.animIn.width = next.cycleW;
    });
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssBefore = { width: 0 };
    opts.animIn    = { left: 0 };
    opts.animOut   = { width: 0 };
    opts.cssAfter  = { display: 'none' };
};
$.fn.cycle.transitions.turnRight = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.animIn.width = next.cycleW;
        opts.animOut.left = curr.cycleW;
    });
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssBefore = { left: 0, width: 0 };
    opts.animIn    = { left: 0 };
    opts.animOut   = { width: 0 };
    opts.cssAfter  = { display: 'none' };
};

// zoom
$.fn.cycle.transitions.zoom = function($cont, $slides, opts) {
    opts.cssFirst = { top:0, left: 0 }; 
    opts.cssAfter = { display: 'none' };
    
    opts.before.push(function(curr, next, opts) {
        $(this).show();
        opts.cssBefore = { width: 0, height: 0, top: next.cycleH/2, left: next.cycleW/2 };
        opts.cssAfter  = { display: 'none' };
        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 };
        $(curr).css('zIndex',2);
        $(next).css('zIndex',1);
    });    
    opts.onAddSlide = function($s) { $s.hide(); };
};

// fadeZoom
$.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        opts.cssBefore = { width: 0, height: 0, opacity: 1, left: next.cycleW/2, top: next.cycleH/2, zIndex: 1 };
        opts.animIn    = { top: 0, left: 0, width: next.cycleW, height: next.cycleH };
    });    
    opts.animOut  = { opacity: 0 };
    opts.cssAfter = { zIndex: 0 };
};

// blindX
$.fn.cycle.transitions.blindX = function($cont, $slides, opts) {
    var w = $cont.css('overflow','hidden').width();
    $slides.show();
    opts.before.push(function(curr, next, opts) {
        $(curr).css('zIndex',1);
    });    
    opts.cssBefore = { left: w, zIndex: 2 };
    opts.cssAfter = { zIndex: 1 };
    opts.animIn = { left: 0 };
    opts.animOut  = { left: w };
};
// blindY
$.fn.cycle.transitions.blindY = function($cont, $slides, opts) {
    var h = $cont.css('overflow','hidden').height();
    $slides.show();
    opts.before.push(function(curr, next, opts) {
        $(curr).css('zIndex',1);
    });    
    opts.cssBefore = { top: h, zIndex: 2 };
    opts.cssAfter = { zIndex: 1 };
    opts.animIn = { top: 0 };
    opts.animOut  = { top: h };
};
// blindZ
$.fn.cycle.transitions.blindZ = function($cont, $slides, opts) {
    var h = $cont.css('overflow','hidden').height();
    var w = $cont.width();
    $slides.show();
    opts.before.push(function(curr, next, opts) {
        $(curr).css('zIndex',1);
    });    
    opts.cssBefore = { top: h, left: w, zIndex: 2 };
    opts.cssAfter = { zIndex: 1 };
    opts.animIn = { top: 0, left: 0 };
    opts.animOut  = { top: h, left: w };
};

// growX - grow horizontally from centered 0 width
$.fn.cycle.transitions.growX = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        opts.cssBefore = { left: this.cycleW/2, width: 0, zIndex: 2 };
        opts.animIn = { left: 0, width: this.cycleW };
        opts.animOut = { left: 0 };
        $(curr).css('zIndex',1);
    });    
    opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); };
};
// growY - grow vertically from centered 0 height
$.fn.cycle.transitions.growY = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        opts.cssBefore = { top: this.cycleH/2, height: 0, zIndex: 2 };
        opts.animIn = { top: 0, height: this.cycleH };
        opts.animOut = { top: 0 };
        $(curr).css('zIndex',1);
    });    
    opts.onAddSlide = function($s) { $s.hide().css('zIndex',1); };
};

// curtainX - squeeze in both edges horizontally
$.fn.cycle.transitions.curtainX = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        opts.cssBefore = { left: next.cycleW/2, width: 0, zIndex: 1, display: 'block' };
        opts.animIn = { left: 0, width: this.cycleW };
        opts.animOut = { left: curr.cycleW/2, width: 0 };
        $(curr).css('zIndex',2);
    });    
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssAfter = { zIndex: 1, display: 'none' };
};
// curtainY - squeeze in both edges vertically
$.fn.cycle.transitions.curtainY = function($cont, $slides, opts) {
    opts.before.push(function(curr, next, opts) {
        opts.cssBefore = { top: next.cycleH/2, height: 0, zIndex: 1, display: 'block' };
        opts.animIn = { top: 0, height: this.cycleH };
        opts.animOut = { top: curr.cycleH/2, height: 0 };
        $(curr).css('zIndex',2);
    });    
    opts.onAddSlide = function($s) { $s.hide(); };
    opts.cssAfter = { zIndex: 1, display: 'none' };
};

// cover - curr slide covered by next slide
$.fn.cycle.transitions.cover = function($cont, $slides, opts) {
    var d = opts.direction || 'left';
    var w = $cont.css('overflow','hidden').width();
    var h = $cont.height();
    opts.before.push(function(curr, next, opts) {
        opts.cssBefore = opts.cssBefore || {};
        opts.cssBefore.zIndex = 2;
        opts.cssBefore.display = 'block';
        
        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;
        $(curr).css('zIndex',1);
    });    
    if (!opts.animIn)  opts.animIn = { left: 0, top: 0 };
    if (!opts.animOut) opts.animOut = { left: 0, top: 0 };
    opts.cssAfter = opts.cssAfter || {};
    opts.cssAfter.zIndex = 2;
    opts.cssAfter.display = 'none';
};

// uncover - curr slide moves off next slide
$.fn.cycle.transitions.uncover = function($cont, $slides, opts) {
    var d = opts.direction || 'left';
    var w = $cont.css('overflow','hidden').width();
    var h = $cont.height();
    opts.before.push(function(curr, next, opts) {
        opts.cssBefore.display = 'block';
        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;
        $(curr).css('zIndex',2);
        $(next).css('zIndex',1);
    });    
    opts.onAddSlide = function($s) { $s.hide(); };
    if (!opts.animIn)  opts.animIn = { left: 0, top: 0 };
    opts.cssBefore = opts.cssBefore || {};
    opts.cssBefore.top = 0;
    opts.cssBefore.left = 0;
    
    opts.cssAfter = opts.cssAfter || {};
    opts.cssAfter.zIndex = 1;
    opts.cssAfter.display = 'none';
};

// toss - move top slide and fade away
$.fn.cycle.transitions.toss = function($cont, $slides, opts) {
    var w = $cont.css('overflow','visible').width();
    var h = $cont.height();
    opts.before.push(function(curr, next, opts) {
        $(curr).css('zIndex',2);
        opts.cssBefore.display = 'block'; 
        // 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.onAddSlide = function($s) { $s.hide(); };
    opts.cssBefore = { left: 0, top: 0, zIndex: 1, opacity: 1 };
    opts.animIn = { left: 0 };
    opts.cssAfter = { zIndex: 2, display: 'none' };
};

// wipe - clip animation
$.fn.cycle.transitions.wipe = function($cont, $slides, opts) {
    var w = $cont.css('overflow','hidden').width();
    var h = $cont.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 $curr = $(curr).css('zIndex',2);
        var $next = $(next).css({
            zIndex:  3,
            display: 'block'
        });
        
        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;
            $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' });
            (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none');
        }
        f();
    });    
    opts.cssAfter  = { };
    opts.animIn    = { left: 0 };
    opts.animOut   = { left: 0 };
};

})(jQuery);


/* ------------------------------------------------------------------------
	Class: lightbox
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 2.2.2
------------------------------------------------------------------------- */

	$.fn.lightbox = function(settings) {
		// global Variables
		var isSet = false; /* Total position in the array */
		var setCount = 0; /* Total images in the set */
		var setPosition = 0; /* Position in the set */
		var arrayPosition = 0; /* Total position in the array */
		var hasTitle = false;
		var caller = 0;
		var doresize = true;
		var imagesArray = [];
	
		$(window).scroll(function(){ _centerPicture(); });
		$(window).resize(function(){ _centerPicture(); _resizeOverlay(); });
		$(document).keyup(function(e){
			switch(e.keyCode){
				case 37:
					if (setPosition == 1) return;
					changePicture('previous');
					break;
				case 39:
					if (setPosition == setCount) return;
					changePicture('next');
					break;
				case 27:
					close();
					break;
			};
	    });
 
	
		settings = jQuery.extend({
			animationSpeed: 'normal', /* fast/slow/normal */
			padding: 40, /* padding for each side of the picture */
			opacity: 0.35, /* Value betwee 0 and 1 */
			showTitle: true, /* true/false */
			allowresize: true, /* true/false */
			counter_separator_label: '/' /* Teh separator for the gallery counter 1 "of" 2 */
		}, settings);
	
		$(this).each(function(){
			imagesArray[imagesArray.length] = this;
			$(this).bind('click',function(){
				open(this); return false;
			});
		});
	
		function open(el) {
			caller = $(el);
		
			// Find out if the picture is part of a set
			theRel = $(caller).attr('rel');
			galleryRegExp = /\[(?:.*)\]/;
			theGallery = galleryRegExp.exec(theRel);
		
			// Find out the type of content
			contentType = "image";
			if($(caller).attr('href').indexOf('.swf') > 0){ hasTitle = false; contentType = 'flash'; };
		
			// Calculate the number of items in the set, and the position of the clicked picture.
			isSet = false;
			setCount = 0;
			for (i = 0; i < imagesArray.length; i++){
				if($(imagesArray[i]).attr('rel').indexOf(theGallery) != -1){
					setCount++;
					if(setCount > 1) isSet = true;

					if($(imagesArray[i]).attr('href') == $(el).attr('href')){
						setPosition = setCount;
						arrayPosition = i;
					};
				};
			};
		
			_buildOverlay(isSet);

			// Display the current position
			$('div.pictureHolder p.currentTextHolder').text(setPosition + settings.counter_separator_label + setCount);

			// Position the picture in the center of the viewing area
			_centerPicture();
		
			$('div.pictureHolder #fullResImageContainer').hide();
			$('.loaderIcon').show();

			// Display the correct type of information
			(contentType == 'image') ? _preload() : _writeFlash();
		};
	
		showimage = function(width,height,containerWidth,containerHeight,contentHeight,contentWidth,resized){
			$('.loaderIcon').hide();
			var scrollPos = _getScroll();

			if($.browser.opera) {
				windowHeight = window.innerHeight;
				windowWidth = window.innerWidth;
			}else{
				windowHeight = $(window).height();
				windowWidth = $(window).width();
			};

			$('div.pictureHolder .content').animate({'height':contentHeight,'width':containerWidth},settings.animationSpeed);

			projectedTop = scrollPos['scrollTop'] + ((windowHeight/2) - (containerHeight/2));
			if(projectedTop < 0) projectedTop = 0 + $('div.lightboxTitle').height();

			// Resize the holder
			$('div.pictureHolder').animate({
				'top': projectedTop,
				'left': ((windowWidth/2) - (containerWidth/2)),
				'width': containerWidth
			},settings.animationSpeed,function(){
				$('#fullResImage').attr({
					'width':width,
					'height':height
				});

				$('div.pictureHolder').width(containerWidth);
				$('div.pictureHolder .hoverContainer').height(height).width(width);

				// Show the nav elements
				_shownav();

				// Fade the new image
				$('div.pictureHolder #fullResImageContainer').fadeIn(settings.animationSpeed);
			
				// Fade the resizing link if the image is resized
				if(resized) $('a.expand,a.contract').fadeIn(settings.animationSpeed);
			});
		};
	
		function changePicture(direction){
			if(direction == 'previous') {
				arrayPosition--;
				setPosition--;
			}else{
				arrayPosition++;
				setPosition++;
			};

			// Allow the resizing of the images
			if(!doresize) doresize = true;

			// Fade out the current picture
			$('div.pictureHolder .hoverContainer,div.pictureHolder .details').fadeOut(settings.animationSpeed);
			$('div.pictureHolder #fullResImageContainer').fadeOut(settings.animationSpeed,function(){
				$('.loaderIcon').show();
			
				// Preload the image
				_preload();
			});

			_hideTitle();
			$('a.expand,a.contract').fadeOut(settings.animationSpeed,function(){
				$(this).removeClass('contract').addClass('expand');
			});
		};
	
		function close(){
			$('div.pictureHolder,div.lightboxTitle').fadeOut(settings.animationSpeed, function(){
				$('div.lightboxOverlay').fadeOut(settings.animationSpeed, function(){
					$('div.lightboxOverlay,div.pictureHolder,div.lightboxTitle').remove();
				
					// To fix the bug with IE select boxes
					if($.browser.msie && $.browser.version == 6){
						$('select').css('visibility','visible');
					};
				});
			});
		};
	
		function _checkPosition(){
			// If at the end, hide the next link
			if(setPosition == setCount) {
				$('div.pictureHolder a.next').css('visibility','hidden');
				$('div.pictureHolder a.arrow_next').addClass('disabled').unbind('click');
			}else{ 
				$('div.pictureHolder a.next').css('visibility','visible');
				$('div.pictureHolder a.arrow_next.disabled').removeClass('disabled').bind('click',function(){
					changePicture('next');
					return false;
				});
			};
		
			// If at the beginning, hide the previous link
			if(setPosition == 1) {
				$('div.pictureHolder a.previous').css('visibility','hidden');
				$('div.pictureHolder a.arrow_previous').addClass('disabled').unbind('click');
			}else{
				$('div.pictureHolder a.previous').css('visibility','visible');
				$('div.pictureHolder a.arrow_previous.disabled').removeClass('disabled').bind('click',function(){
					changePicture('previous');
					return false;
				});
			};
		
			// Change the current picture text
			$('div.pictureHolder p.currentTextHolder').text(setPosition + settings.counter_separator_label + setCount);
		
			(isSet) ? $c = $(imagesArray[arrayPosition]) : $c = $(caller);

			if($c.attr('title')){
				$('div.pictureHolder .description').show().html(unescape($c.attr('title')));
			}else{
				$('div.pictureHolder .description').hide().text('');
			};
		
			if($c.find('img').attr('alt') && settings.showTitle){
				hasTitle = true;
				$('div.lightboxTitle .lightboxTitleContent').html(unescape($c.find('img').attr('alt')));
			}else{
				hasTitle = false;
			};
		};
	
		function _fitToViewport(width,height){
			hasBeenResized = false;
		
			$('div.pictureHolder .details').width(width); /* To have the correct height */
			$('div.pictureHolder .details p.description').width(width - parseFloat($('div.pictureHolder a.close').css('width'))); /* So it doesn't overlap the button */
		
			// Get the container size, to resize the holder to the right dimensions
			contentHeight = height + parseFloat($('div.pictureHolder .details').height()) + parseFloat($('div.pictureHolder .details').css('margin-top')) + parseFloat($('div.pictureHolder .details').css('margin-bottom'));
			contentWidth = width;
			containerHeight = height + parseFloat($('div.lightboxTitle').height()) + parseFloat($('div.pictureHolder .top').height()) + parseFloat($('div.pictureHolder .bottom').height());
			containerWidth = width + settings.padding;
		
			// Define them in case there's no resize needed
			imageWidth = width;
			imageHeight = height;

			if($.browser.opera) {
				windowHeight = window.innerHeight;
				windowWidth = window.innerWidth;
			}else{
				windowHeight = $(window).height();
				windowWidth = $(window).width();
			};
		
			if( ((containerWidth > windowWidth) || (containerHeight > windowHeight)) && doresize && settings.allowresize) {
				hasBeenResized = true;
			
				if((containerWidth > windowWidth) && (containerHeight > windowHeight)){
					// Get the original geometry and calculate scales
					var xscale =  (containerWidth + 200) / windowWidth;
					var yscale = (containerHeight + 200) / windowHeight;
				}else{
					// Get the original geometry and calculate scales
					var xscale = windowWidth / containerWidth;
					var yscale = windowHeight / containerHeight;
				}

				// Recalculate new size with default ratio
				if (yscale>xscale){
					imageWidth = Math.round(width * (1/yscale));
					imageHeight = Math.round(height * (1/yscale));
				} else {
					imageWidth = Math.round(width * (1/xscale));
					imageHeight = Math.round(height * (1/xscale));
				};
			
				// Define the new dimensions
				contentHeight = imageHeight + parseFloat($('div.pictureHolder .details').height()) + parseFloat($('div.pictureHolder .details').css('margin-top')) + parseFloat($('div.pictureHolder .details').css('margin-bottom'));
				contentWidth = imageWidth;
				containerHeight = imageHeight + parseFloat($('div.lightboxTitle').height()) + parseFloat($('div.pictureHolder .top').height()) + parseFloat($('div.pictureHolder .bottom').height());
				containerWidth = imageWidth + settings.padding;
			
				$('div.pictureHolder .details').width(contentWidth); /* To have the correct height */
				$('div.pictureHolder .details p.description').width(contentWidth - parseFloat($('div.pictureHolder a.close').css('width'))); /* So it doesn't overlap the button */
			};

			return {
				width:imageWidth,
				height:imageHeight,
				containerHeight:containerHeight,
				containerWidth:containerWidth,
				contentHeight:contentHeight,
				contentWidth:contentWidth,
				resized:hasBeenResized
			};
		};
	
		function _centerPicture(){
			//Make sure the gallery is open
			if($('div.pictureHolder').size() > 0){
			
				var scrollPos = _getScroll();
			
				if($.browser.opera) {
					windowHeight = window.innerHeight;
					windowWidth = window.innerWidth;
				}else{
					windowHeight = $(window).height();
					windowWidth = $(window).width();
				};
			
				if(doresize) {
					projectedTop = (windowHeight/2) + scrollPos['scrollTop'] - ($('div.pictureHolder').height()/2);
					if(projectedTop < 0) projectedTop = 0 + $('div.lightboxTitle').height();
					
					$('div.pictureHolder').css({
						'top': projectedTop,
						'left': (windowWidth/2) + scrollPos['scrollLeft'] - ($('div.pictureHolder').width()/2)
					});
			
					$('div.lightboxTitle').css({
						'top' : $('div.pictureHolder').offset().top - $('div.lightboxTitle').height(),
						'left' : $('div.pictureHolder').offset().left + (settings.padding/2)
					});
				};
			};
		};
	
		function _shownav(){
			if(isSet) $('div.pictureHolder .hoverContainer').fadeIn(settings.animationSpeed);
			$('div.pictureHolder .details').fadeIn(settings.animationSpeed);

			_showTitle();
		};
	
		function _showTitle(){
			if(settings.showTitle && hasTitle){
				$('div.lightboxTitle').css({
					'top' : $('div.pictureHolder').offset().top,
					'left' : $('div.pictureHolder').offset().left + (settings.padding/2),
					'display' : 'block'
				});
			
				$('div.lightboxTitle div.lightboxTitleContent').css('width','auto');
			
				if($('div.lightboxTitle').width() > $('div.pictureHolder').width()){
					$('div.lightboxTitle div.lightboxTitleContent').css('width',$('div.pictureHolder').width() - (settings.padding * 2));
				}else{
					$('div.lightboxTitle div.lightboxTitleContent').css('width','');
				};
			
				$('div.lightboxTitle').animate({'top':($('div.pictureHolder').offset().top - 22)},settings.animationSpeed);
			};
		};
	
		function _hideTitle() {
			$('div.lightboxTitle').animate({'top':($('div.pictureHolder').offset().top)},settings.animationSpeed,function() { $(this).css('display','none'); });
		};
	
		function _preload(){
			// Hide the next/previous links if on first or last images.
			_checkPosition();
		
			// Set the new image
			imgPreloader = new Image();
		
			// Preload the neighbour images
			nextImage = new Image();
			if(isSet) nextImage.src = $(imagesArray[arrayPosition + 1]).attr('href');
			prevImage = new Image();
			if(isSet && imagesArray[arrayPosition - 1]) prevImage.src = $(imagesArray[arrayPosition - 1]).attr('href');

			$('div.pictureHolder .content').css('overflow','hidden');
		
			if(isSet) {
				$('div.pictureHolder #fullResImage').attr('src',$(imagesArray[arrayPosition]).attr('href'));
			}else{
				$('div.pictureHolder #fullResImage').attr('src',$(caller).attr('href'));
			};

			imgPreloader.onload = function(){
				var correctSizes = _fitToViewport(imgPreloader.width,imgPreloader.height);
				imgPreloader.width = correctSizes['width'];
				imgPreloader.height = correctSizes['height'];
			
				// Need that small delay for the anim to be nice
				setTimeout('showimage(imgPreloader.width,imgPreloader.height,'+correctSizes["containerWidth"]+','+correctSizes["containerHeight"]+','+correctSizes["contentHeight"]+','+correctSizes["contentWidth"]+','+correctSizes["resized"]+')',500);
			};
		
			(isSet) ? imgPreloader.src = $(imagesArray[arrayPosition]).attr('href') : imgPreloader.src = $(caller).attr('href');
		};
	
		function _getScroll(){
			scrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
			scrollLeft = window.pageXOffset || document.documentElement.scrollLeft || 0;
			return {scrollTop:scrollTop,scrollLeft:scrollLeft};
		};
	
		function _resizeOverlay() {
			$('div.lightboxOverlay').css({
				'height':$(document).height(),
				'width':$(window).width()
			});
		};
	
		function _writeFlash(){
			flashParams = $(caller).attr('rel').split(';');
			$(flashParams).each(function(i){
				// Define the width and height
				if(flashParams[i].indexOf('width') >= 0) flashWidth = flashParams[i].substring(flashParams[i].indexOf('width') + 6, flashParams[i].length);
				if(flashParams[i].indexOf('height') >= 0) flashHeight = flashParams[i].substring(flashParams[i].indexOf('height') + 7, flashParams[i].length);
				if(flashParams[i].indexOf('flashvars') >= 0) flashVars = flashParams[i].substring(flashParams[i].indexOf('flashvars') + 10, flashParams[i].length);
			});
		
			$('.pictureHolder #fullResImageContainer').append('<embed width="'+flashWidth+'" height="'+flashHeight+'" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="opaque" name="prettyFlash" flashvars="'+flashVars+'" allowscriptaccess="always" bgcolor="#FFFFFF" quality="high" src="'+$(caller).attr('href')+'"/>');
			$('#fullResImage').hide();
		
			contentHeight = parseFloat(flashHeight) + parseFloat($('div.pictureHolder .details').height()) + parseFloat($('div.pictureHolder .details').css('margin-top')) + parseFloat($('div.pictureHolder .details').css('margin-bottom'));
			contentWidth = parseFloat(flashWidth)+ parseFloat($('div.pictureHolder .details').width()) + parseFloat($('div.pictureHolder .details').css('margin-left')) + parseFloat($('div.pictureHolder .details').css('margin-right'));
			containerHeight = contentHeight + parseFloat($('div.pictureHolder .top').height()) + parseFloat($('div.pictureHolder .bottom').height());
			containerWidth = parseFloat(flashWidth) + parseFloat($('div.pictureHolder .content').css("padding-left")) + parseFloat($('div.pictureHolder .content').css("padding-right")) + settings.padding;
		
			setTimeout('showimage('+flashWidth+','+flashHeight+','+containerWidth+','+containerHeight+','+contentHeight+','+contentWidth+')',500);
		};
	
		function _buildOverlay(){
		
			// Build the background overlay div
			backgroundDiv = "<div class='lightboxOverlay'></div>";
			$('body').append(backgroundDiv);
			$('div.lightboxOverlay').css('height',$(document).height()).bind('click',function(){
				close();
			});
		
			// Basic HTML for the picture holder
			pictureHolder = '<div class="pictureHolder"><div class="top"><div class="left"></div><div class="middle"></div><div class="right"></div></div><div class="content"><a href="#" class="expand" title="Méretezze át a képet">Méretezés</a><div class="loaderIcon"></div><div class="hoverContainer"><a class="next" href="#">next</a><a class="previous" href="#">previous</a></div><div id="fullResImageContainer"><img id="fullResImage" src="" /></div><div class="details clearfix"><a class="close" href="#">Close</a><p class="description"></p></div></div><div class="bottom"><div class="left"></div><div class="middle"></div><div class="right"></div></div></div>';
			// pictureHolder = '<div class="pictureHolder"><div class="top"><div class="left"></div><div class="middle"></div><div class="right"></div></div><div class="content"><a href="#" class="expand" title="Expand the image">Expand</a><div class="loaderIcon"></div><div class="hoverContainer"><a class="next" href="#">next</a><a class="previous" href="#">previous</a></div><div id="fullResImageContainer"><img id="fullResImage" src="" /></div><div class="details clearfix"><a class="close" href="#">Close</a><p class="description"></p><div class="nav"><a href="#" class="arrow_previous">Previous</a><p class="currentTextHolder">0'+settings.counter_separator_label+'0</p><a href="#" class="arrow_next">Next</a></div></div></div><div class="bottom"><div class="left"></div><div class="middle"></div><div class="right"></div></div></div>';
		
			// Basic html for the title holder
			titleHolder = '<div class="lightboxTitle"><div class="lightboxTitleLeft"></div><div class="lightboxTitleContent"></div><div class="lightboxTitleRight"></div></div>';

			$('body').append(pictureHolder).append(titleHolder);

			$('.pictureHolder,.titleHolder').css({'opacity': 0});
			$('a.close').bind('click',function(){ close(); return false; });
			$('a.expand').bind('click',function(){
			
				// Expand the image
				if($(this).hasClass('expand')){
					$(this).removeClass('expand').addClass('contract');
					doresize = false;
				}else{
					$(this).removeClass('contract').addClass('expand');
					doresize = true;
				};
			
				_hideTitle();
				$('div.pictureHolder .hoverContainer,div.pictureHolder #fullResImageContainer').fadeOut(settings.animationSpeed);
				$('div.pictureHolder .details').fadeOut(settings.animationSpeed,function(){
					_preload();
				});
			
				return false;
			});
		
			$('.pictureHolder .previous,.pictureHolder .arrow_previous').bind('click',function(){
				changePicture('previous');
				return false;
			});
		
			$('.pictureHolder .next,.pictureHolder .arrow_next').bind('click',function(){
				changePicture('next');
				return false;
			});

			$('.hoverContainer').css({
				'margin-left': settings.padding/2
			});
		
			// If it's not a set, hide the links
			if(!isSet) {
				$('.hoverContainer,.nav').hide();
			};


			// To fix the bug with IE select boxes
			if($.browser.msie && $.browser.version == 6){
				$('select').css('visibility','hidden');
			};

			// Then fade it in
			$('div.lightboxOverlay').css('opacity',0).fadeTo(settings.animationSpeed,settings.opacity, function(){
				$('div.pictureHolder').css('opacity',0).fadeIn(settings.animationSpeed,function(){
					// To fix an IE bug
					$('div.pictureHolder').attr('style','left:'+$('div.pictureHolder').css('left')+';top:'+$('div.pictureHolder').css('top')+';');
				});
			});
		};
	};

/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
	this.tooltip = function(){	
		/* CONFIG */		
			xOffset = 10;
			yOffset = 20;		
			// these 2 variable determine popup's distance from the cursor
			// you might want to adjust to get the right result		
		/* END CONFIG */		
		$("a.tooltip").hover(function(e){											  
			this.t = this.title;
			this.title = "";									  
			$("body").append("<p id='tooltip'>"+ this.t +"</p>");
			$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.fadeIn("fast");		
	    },
		function(){
			this.title = this.t;		
			$("#tooltip").remove();
	    });	
		$("a.tooltip").mousemove(function(e){
			$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px");
		});			
	};
	
	
	
	// starting the script on page load
	$(document).ready(function(){
		tooltip();
	});


/*
 * Url preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
	this.screenshotPreview = function(){	
		/* CONFIG */
			
			xOffset = 10;
			yOffset = 30;
			
			// these 2 variable determine popup's distance from the cursor
			// you might want to adjust to get the right result
			
		/* END CONFIG */
		$("a.screenshot").hover(function(e){
			this.t = this.title;
			this.title = "";	
			var c = (this.t != "") ? "<br/>" + this.t : "";
			$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='loading...' />"+ c +"</p>");								 
			$("#screenshot")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.fadeIn("fast");						
	    },
		function(){
			this.title = this.t;	
			$("#screenshot").remove();
	    });	
		$("a.screenshot").mousemove(function(e){
			$("#screenshot")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px");
		});			
	};
	
	
	// starting the script on page load
	$(document).ready(function(){
		screenshotPreview();
	});

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}('Q.P.O=3(z){1 p=z||{y:"N",x:"M",w:"L",v:K,u:"a",t:J};1 d=$("#"+p.y);1 c=$("#"+p.x);1 2=$("#"+p.w);1 j=p.v;1 e=p.u;1 4=p.t;1 g;1 9=3(){c.s("5",9);6(4)h();2.r({f:-j},\'q\',\'\',3(){2.i(e+":I").H(2);2.b("f",0);c.n("5",9);6(4)8()})};1 7=3(){d.s("5",7);6(4)h();2.i(e+":o").G().F().E(2);2.b("f",-j);2.r({f:0},\'q\',\'\',3(){2.i(e+":o").D();d.n("5",7);6(4)8()})};d.b("m","l").5(7);c.b("m","l").5(9);1 8=3(){g=k.C(7,B)};1 h=3(){k.A(g)};6(4)8()};',53,53,'|var|_imgFrame|function|_auto|click|if|turnRight|autoPlay|turnLeft||css|_btnPrev|_btnNext|_child|marginLeft|_itv|autoStop|find|_width|window|hand|cursor|bind|last||fast|animate|unbind|auto|child|width|frame|prev|next|params|clearInterval|3000|setInterval|remove|prependTo|show|clone|appendTo|first|true|100|viewerFrame|buttonPrev|buttonNext|imageScroller|fn|jQuery'.split('|'),0,{}))


/*
 * jQuery validation plug-in 1.3
 *
 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
 * http://docs.jquery.com/Plugins/Validation
 *
 * Copyright (c) 2006 - 2008 Jörn Zaefferer
 *
 * $Id: jquery.validate.js 5565 2008-05-12 11:15:24Z joern.zaefferer $
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
jQuery.extend(jQuery.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=jQuery.data(this[0],'validator');if(validator){return validator;}validator=new jQuery.validator(options,this[0]);jQuery.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find(".cancel:submit").click(function(){validator.cancelSubmit=true;});this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){validator.settings.submitHandler.call(validator,validator.currentForm);return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if(jQuery(this[0]).is('form')){return this.validate().form();}else{var valid=false;var validator=jQuery(this[0].form).validate();this.each(function(){valid|=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(){result[this]=$element.attr(this);$element.removeAttr(this);});return result;},rules:function(command,argument){var element=this[0];if(command){var staticRules=jQuery.data(element.form,'validator').settings.rules;var existingRules=jQuery.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,jQuery.validator.normalizeRule(argument));staticRules[element.name]=existingRules;break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=jQuery.validator.normalizeRules(jQuery.extend({},jQuery.validator.metadataRules(element),jQuery.validator.classRules(element),jQuery.validator.attributeRules(element),jQuery.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;},push:function(t){return this.setArray(this.add(t).get());}});jQuery.extend(jQuery.expr[":"],{blank:function(a){return!jQuery.trim(a.value);},filled:function(a){return!!jQuery.trim(a.value);},unchecked:function(a){return!a.checked;}});jQuery.format=function(source,params){if(arguments.length==1)return function(){var args=jQuery.makeArray(arguments);args.unshift(source);return jQuery.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=jQuery.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}jQuery.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};jQuery.validator=function(options,form){this.settings=jQuery.extend({},jQuery.validator.defaults,options);this.currentForm=form;this.init();};jQuery.extend(jQuery.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:jQuery([]),errorLabelContainer:jQuery([]),onsubmit:true,ignore:[],onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);},highlight:function(element,errorClass){jQuery(element).addClass(errorClass);},unhighlight:function(element,errorClass){jQuery(element).removeClass(errorClass);}},setDefaults:function(settings){jQuery.extend(jQuery.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:jQuery.format("Please enter no more than {0} characters."),maxLength:jQuery.format("Please enter no more than {0} characters."),minlength:jQuery.format("Please enter at least {0} characters."),minLength:jQuery.format("Please enter at least {0} characters."),rangelength:jQuery.format("Please enter a value between {0} and {1} characters long."),rangeLength:jQuery.format("Please enter a value between {0} and {1} characters long."),rangeValue:jQuery.format("Please enter a value between {0} and {1}."),range:jQuery.format("Please enter a value between {0} and {1}."),maxValue:jQuery.format("Please enter a value less than or equal to {0}."),max:jQuery.format("Please enter a value less than or equal to {0}."),minValue:jQuery.format("Please enter a value greater than or equal to {0}."),min:jQuery.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=jQuery(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||jQuery(this.currentForm);this.containers=jQuery(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});jQuery.each(this.settings.groups,function(key,value){jQuery.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;jQuery.each(rules,function(key,value){rules[key]=jQuery.validator.normalizeRule(value);});function delegate(event){var validator=jQuery.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}jQuery(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);},form:function(){this.checkForm();jQuery.extend(this.submitted,this.errorMap);this.invalid=jQuery.extend({},this.errorMap);if(!this.valid())jQuery(this.currentForm).triggerHandler("invalid-form.validate",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=this.elements();elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide.push(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){jQuery.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=jQuery.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if(jQuery.fn.resetForm)jQuery(this.currentForm).resetForm();this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{jQuery(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&jQuery.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return jQuery([]).add(this.currentForm.elements).filter("input, select, textarea").not(":submit, :reset, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return jQuery(selector)[0];},errors:function(){return jQuery(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=jQuery([]);this.toHide=jQuery([]);this.formSubmitted=false;},prepareForm:function(){this.reset();this.toHide=this.errors().push(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=jQuery.validator.methods[method].call(this,jQuery.trim(element.value),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method");throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),element.title||undefined,jQuery.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle.push(toToggle.parents(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow.push(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.elements().not(this.invalidElements());},invalidElements:function(){return jQuery(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=jQuery("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+">").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,jQuery(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow.push(label);},errorsFor:function(element){return this.errors().filter("[@for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return jQuery(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return jQuery("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!jQuery(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!jQuery.validator.methods.required.call(this,jQuery.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){jQuery(this.currentForm).submit();}},previousValue:function(element){return jQuery.data(element,"previousValue")||jQuery.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:jQuery.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=jQuery(element).attr('class');classes&&jQuery.each(classes.split(' '),function(){if(this in jQuery.validator.classRuleSettings){jQuery.extend(rules,jQuery.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=jQuery(element);for(method in jQuery.validator.methods){var value=$element.attr(method);if(value!==undefined&&value!==''){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;delete rules.maxLength;}return rules;},metadataRules:function(element){if(!jQuery.metadata)return{};var meta=jQuery.data(element.form,'validator').settings.meta;return meta?jQuery(element).metadata()[meta]:jQuery(element).metadata();},staticRules:function(element){var rules={};var validator=jQuery.data(element.form,'validator');if(validator.settings.rules){rules=jQuery.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){jQuery.each({minLength:'minlength',maxLength:'maxlength',rangeLength:'rangelength',minValue:'min',maxValue:'max',rangeValue:'range'},function(dep,curr){if(rules[dep]){rules[curr]=rules[dep];delete rules[dep];}});$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!jQuery(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});jQuery.each(rules,function(rule,parameter){rules[rule]=jQuery.isFunction(parameter)?parameter(element):parameter;});jQuery.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});jQuery.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if(jQuery.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};jQuery.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){jQuery.validator.methods[name]=method;jQuery.validator.messages[name]=message;if(method.length<3){jQuery.validator.addClassRules(name,jQuery.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=jQuery("option:selected",element);return options.length>0&&(element.type=="select-multiple"||(jQuery.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return value.length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;jQuery.ajax({url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){if(!response){var errors={};errors[element.name]=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}else{var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}previous.valid=response;validator.stopRequest(element,response);}});return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength(value,element)>=param;},minLength:function(value,element,param){return jQuery.validator.methods.minlength.apply(this,arguments);},maxlength:function(value,element,param){return this.optional(element)||this.getLength(value,element)<=param;},maxLength:function(value,element,param){return jQuery.validator.methods.maxlength.apply(this,arguments);},rangelength:function(value,element,param){var length=this.getLength(value,element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},rangeLength:function(value,element,param){return jQuery.validator.methods.rangelength.apply(this,arguments);},min:function(value,element,param){return this.optional(element)||value>=param;},minValue:function(){return jQuery.validator.methods.min.apply(this,arguments);},max:function(value,element,param){return this.optional(element)||value<=param;},maxValue:function(){return jQuery.validator.methods.max.apply(this,arguments);},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},rangeValue:function(){return jQuery.validator.methods.range.apply(this,arguments);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(element.value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(element.value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param:"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==jQuery(param).val();}}});;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=jQuery.extend(settings,jQuery.extend({},jQuery.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[jQuery.event.fix({type:type,target:target})]);}})})(jQuery);

// apply inline-box only for mozilla
if( jQuery.browser.mozilla ) {
	// do when DOM is ready
	$( function() {
		// search form, hide it, search labels to modify, filter classes nocmx and error
		$( 'form.cmxform' ).hide().find( 'p>label:not(.nocmx):not(.error)' ).each( function() {
			var $this = $(this);
			var labelContent = $this.html();
			var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
			// create block element with width of label
			var labelSpan = $("<span>")
				.css("display", "block")
				.width(labelWidth)
				.html(labelContent);
			// change display to mozilla specific inline-box
			$this.css("display", "-moz-inline-box")
				// remove children
				.empty()
				// add span element
				.append(labelSpan);
		// show form again
		}).end().show();
	});
};

/*
 * jQuery selectbox plugin
 *
 * Copyright (c) 2007 Sadri Sahraoui (brainfault.com)
 * Licensed under the GPL license and MIT:
 *   http://www.opensource.org/licenses/GPL-license.php
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * The code is inspired from Autocomplete plugin (http://www.dyve.net/jquery/?autocomplete)
 *
 * Revision: $Id$
 * Version: 0.6
 * 
 * Changelog :
 *  Version 0.6
 *  - Fix IE scrolling problem
 *  Version 0.5 
 *  - separate css style for current selected element and hover element which solve the highlight issue 
 *  Version 0.4
 *  - Fix width when the select is in a hidden div   @Pawel Maziarz
 *  - Add a unique id for generated li to avoid conflict with other selects and empty values @Pawel Maziarz
 */
jQuery.fn.extend({
	selectbox: function(options) {
		return this.each(function() {
			new jQuery.SelectBox(this, options);
		});
	}
});


/* pawel maziarz: work around for ie logging */
if (!window.console) {
	var console = {
		log: function(msg) { 
	 }
	}
}
/* */

jQuery.SelectBox = function(selectobj, options) {
	
	var opt = options || {};
	opt.inputClass = opt.inputClass || "selectbox";
	opt.containerClass = opt.containerClass || "selectbox-wrapper";
	opt.hoverClass = opt.hoverClass || "current";
	opt.currentClass = opt.selectedClass || "selected"
	opt.debug = opt.debug || false;
	
	var elm_id = selectobj.id;
	var active = 0;
	var inFocus = false;
	var hasfocus = 0;
	//jquery object for select element
	var $select = $(selectobj);
	// jquery container object
	var $container = setupContainer(opt);
	//jquery input object 
	var $input = setupInput(opt);
	// hide select and append newly created elements
	$select.hide().before($input).before($container);
	
	
	init();
	
	$input
	.click(function(){
    if (!inFocus) {
		  $container.toggle();
		}
	})
	.focus(function(){
	   if ($container.not(':visible')) {
	       inFocus = true;
	       $container.show();
	   }
	})
	.keydown(function(event) {	   
		switch(event.keyCode) {
			case 38: // up
				event.preventDefault();
				moveSelect(-1);
				break;
			case 40: // down
				event.preventDefault();
				moveSelect(1);
				break;
			//case 9:  // tab 
			case 13: // return
				event.preventDefault(); // seems not working in mac !
				$('li.'+opt.hoverClass).trigger('click');
				break;
			case 27: //escape
			  hideMe();
			  break;
		}
	})
	.blur(function() {
		if ($container.is(':visible') && hasfocus > 0 ) {
			if(opt.debug) console.log('container visible and has focus')
		} else {
		  // Workaround for ie scroll - thanks to Bernd Matzner
		  if($.browser.msie || $.browser.safari){ // check for safari too - workaround for webkit
        if(document.activeElement.getAttribute('id').indexOf('_container')==-1){
          hideMe();
        } else {
          $input.focus();
        }
      } else {
        hideMe();
      }
		}
	});


	function hideMe() { 
		hasfocus = 0;
		$container.hide(); 
	}
	
	function init() {
		$container.append(getSelectOptions($input.attr('id'))).hide();
		var width = $input.css('width');
		$container.width(width);
    }
	
	function setupContainer(options) {
		var container = document.createElement("div");
		$container = $(container);
		$container.attr('id', elm_id+'_container');
		$container.addClass(options.containerClass);
		
		return $container;
	}
	
	function setupInput(options) {
		var input = document.createElement("input");
		var $input = $(input);
		$input.attr("id", elm_id+"_input");
		$input.attr("type", "text");
		$input.addClass(options.inputClass);
		$input.attr("autocomplete", "off");
		$input.attr("readonly", "readonly");
		$input.attr("tabIndex", $select.attr("tabindex")); // "I" capital is important for ie
		
		return $input;	
	}
	
	function moveSelect(step) {
		var lis = $("li", $container);
		if (!lis || lis.length == 0) return false;
		active += step;
    //loop through list
		if (active < 0) {
			active = lis.size();
		} else if (active > lis.size()) {
			active = 0;
		}
    scroll(lis, active);
		lis.removeClass(opt.hoverClass);

		$(lis[active]).addClass(opt.hoverClass);
	}
	
	function scroll(list, active) {
      var el = $(list[active]).get(0);
      var list = $container.get(0);
      
      if (el.offsetTop + el.offsetHeight > list.scrollTop + list.clientHeight) {
        list.scrollTop = el.offsetTop + el.offsetHeight - list.clientHeight;      
      } else if(el.offsetTop < list.scrollTop) {
        list.scrollTop = el.offsetTop;
      }
	}
	
	function setCurrent() {	
		var li = $("li."+opt.currentClass, $container).get(0);
		var ar = (''+li.id).split('_');
		var el = ar[ar.length-1];
		$select.val(el);
		$input.val($(li).html());
		return true;
	}
	
	// select value
	function getCurrentSelected() {
		return $select.val();
	}
	
	// input value
	function getCurrentValue() {
		return $input.val();
	}
	
	function getSelectOptions(parentid) {
		var select_options = new Array();
		var ul = document.createElement('ul');
		$select.children('option').each(function() {
			var li = document.createElement('li');
			li.setAttribute('id', parentid + '_' + $(this).val());
			li.innerHTML = $(this).html();
			if ($(this).is(':selected')) {
				$input.val($(this).html());
				$(li).addClass(opt.currentClass);
			}
			ul.appendChild(li);
			$(li)
			.mouseover(function(event) {
				hasfocus = 1;
				if (opt.debug) console.log('over on : '+this.id);
				jQuery(event.target, $container).addClass(opt.hoverClass);
			})
			.mouseout(function(event) {
				hasfocus = -1;
				if (opt.debug) console.log('out on : '+this.id);
				jQuery(event.target, $container).removeClass(opt.hoverClass);
			})
			.click(function(event) {
			  var fl = $('li.'+opt.hoverClass, $container).get(0);
				if (opt.debug) console.log('click on :'+this.id);
				$('li.'+opt.currentClass).removeClass(opt.currentClass); 
				$(this).addClass(opt.currentClass);
				setCurrent();
				//$select.change();
				$select.get(0).blur();
				hideMe();
			});
		});
		return ul;
	}
	
	
	
};

