// preload
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// WaitBox
function getElem(ename) {
	if (document.all) return document.all[ename];
	if (document.getElementById) return document.getElementById(ename);
}
function waitingBox(ref) {
	var elem = getElem('waitbox2');
	if (!ref || ref.indexOf('javascript')<0) {
		clickfirst = false;
		document.body.style.cursor = 'wait';
		var ie6 = (document.all && !window.opera && !window.XMLHttpRequest) ? true : false;
		elem.style.zIndex='999';
		var height = 0;
		var width = 0;
		if (ie6) {
			var elements = document.body.getElementsByTagName('select');
			for (var i = 0; i < elements.length; i++) {
				elements[i].disabled='disabled';
			}
		}
		if (!window.opera) {
			height = document.body.clientHeight;
		} else {
			height = document.documentElement.clientHeight;
		}
		elem.style.margin='0';
		elem.style.height=height+'px';
		elem.style.visibility='visible';
	}
}
// supraheader lang dropdown
var t1,r1;
function clangT(){clearTimeout(t1);}
function langT(){clangT();t1 = setTimeout('langClose();', 2000);}
function langOpen(){jQuery('#sh-LangsItems').slideDown('fast');}
function langOifH(){clangT();if(jQuery('#sh-LangsItems').is(':hidden')){langOpen();}}
function langClose(){jQuery('#sh-LangsItems').slideUp('fast');}
function langToggle(event){if(this == event.target){if(jQuery('#sh-LangsItems').is(':hidden')){langOpen();}else{langClose();}}}
var langDropdown = {init : function(){
	jQuery('#sh-LangsCaption').bind('click', langToggle).bind('mouseover', langOifH).bind('mouseout', langT);
	jQuery('.sh-LangsItems-Insert').bind('mouseover', clangT).bind('mouseout', langT);
}}
// submenu expander and collapser
var t2,r2;
function submenuSubExpand(){clearTimeout(t2);jQuery('#submenuMore').hide();jQuery('#submenuLinksSub').removeClass('submenuLinksSubHide').hide().slideDown('fast');}
function submenuSubCollapse(){jQuery('#submenuLinksSub').slideUp('fast');jQuery('#submenuMore').show();}
function submenuExpand(){submenuSubCollapse();jQuery('#submenuWrapper').slideDown('fast');if(jQuery('#submenuButtonMore').is(':visible')){t2 = setTimeout('submenuSubExpand()', 1000);}}
function submenuCollapse(){clearTimeout(t2);submenuSubCollapse();jQuery('#submenuWrapper').slideUp('fast');}
var submenuExpander = {init : function(){
	jQuery('#submenuExpander').click(function(event){if(this == event.target){if(jQuery('#submenuWrapper').is(':hidden')){submenuExpand();}else{submenuCollapse();}}});
	jQuery('#submenuButtonMore').click(function(event){if(this == event.target){submenuSubExpand();}});
	jQuery('#submenuButtonClose').click(function(event){if(this == event.target){submenuCollapse();}});
}}
// help expander and collapser
function helpExpand(item){item.find('.divHelpInsert').slideDown('fast');item.find('.helpBottom').show();}
function helpCollapse(item){item.find('.divHelpInsert').slideUp('fast');item.find('.helpBottom').hide();}
function helpToggle(item){if(item.find('.divHelpInsert').is(':hidden')){helpExpand(item);}else{helpCollapse(item);}}
var helpExpander = {init : function(){
	jQuery('.helpButton').click(function(event){if(this == event.target){helpToggle(jQuery(this).parent());}});
	jQuery('.helpButtonClose').click(function(event){if(this == event.target){helpCollapse(jQuery(this).parent().parent().parent());}});
}}
function makeFormFieldEmpty(elem){
	alert('1');
	var currentId = jQuery(elem).attr('id');
	if (jQuery('#' + currentId).val() == jQuery('#' + currentId).attr('title')){
		jQuery('#' + currentId).val('');
	}
}
function resetFormField(elem, forceReset){
	alert('2');
	var currentId = jQuery(elem).attr('id');
	if (currentId != ''){
		if (forceReset == true || jQuery('#' + currentId).val() == ''){
			jQuery('#' + currentId).val(jQuery('#' + currentId).attr('title'));
		}
	}
}
// onload
jQuery(function(){
	// alert('3');
	// jQuery('#near_intro_f_input_postcode').focusin(function(event){makeFormFieldEmpty(event.target);});
	// jQuery('#near_intro_f_input_postcode').focusout(function(event){resetFormField(event.target);});
	jQuery('#near_intro_f_input_postcode').focusin(function(){
		if (jQuery('#near_intro_f_input_postcode').val() == jQuery('#near_intro_f_input_postcode').attr('title')){
			jQuery('#near_intro_f_input_postcode').val('');
		}
	});
	jQuery('#near_intro_f_input_postcode').focusout(function(){
		if (jQuery('#near_intro_f_input_postcode').val() == ''){
			jQuery('#near_intro_f_input_postcode').val(jQuery('#near_intro_f_input_postcode').attr('title'));
		}
	});
});
jQuery(function(){
helpExpander.init();jQuery('.divHelpInsert').hide();jQuery('.helpBottom').removeClass('nv').hide();
MM_preloadImages('/fileadmin/templates/images/header_menu_button_pressed_bg.gif', '/fileadmin/templates/images/header_menu_button02_pressed_bg.gif', '/fileadmin/templates/extensions/mm_forum/aurd/img/default/button-pressed-bg.gif', '/fileadmin/templates/images/plus.gif', '/fileadmin/templates/images/minus.gif');
submenuExpander.init();jQuery('#submenuWrapper').removeClass('submenuWrapperHide').hide();
langDropdown.init();jQuery('#sh-LangsCaption').addClass('sh-LangsCaption');jQuery('#sh-LangsItems').addClass('sh-LangsItems').hide();
});
/*
// scroll-to-top
var scrollToTop = {
	setting : {startLine: 100, scrollTo: 0, scrollDuration: 1000, fadeDuration: [500, 100]},
	controlHTML : '<img src="/fileadmin/templates/images/icons/up.png" style="width:48px; height:48px" />',
	controlattrs : {offsetx: 5, offsety: 5},
	anchorKeyword : '#top',
	state : {isVisible: false, shouldVisible: false},
	scrollUp : function(){
		if (!this.cssFixedSupport){
			this.jQControl.css({opacity:0});
		}
		var dest = isNaN(this.setting.scrollTo) ? this.setting.scrollTo : parseInt(this.setting.scrollTo);
		if (typeof dest == 'string' && jQuery('#' + dest).length == 1){
			dest = jQuery('#' + dest).offset().top;
		}else{dest=0;}
		this.jQBody.animate({scrollTop: dest}, this.setting.scrollDuration);
	},
	keepFixed : function(){
		var jQWindow = jQuery(window);
		var controlx = jQWindow.scrollLeft() + jQWindow.width() - this.jQControl.width() - this.controlattrs.offsetx;
		var controly = jQWindow.scrollTop() + jQWindow.height() - this.jQControl.height() - this.controlattrs.offsety;
		this.jQControl.css({left: controlx + 'px', top: controly + 'px'});
	},
	toggleControl : function(){
		var scrollTop2 = jQuery(window).scrollTop();
		if (!this.cssFixedSupport) {this.keepFixed();}
		this.state.shouldVisible = (scrollTop2 >= this.setting.startLine) ? true : false;
		if (this.state.shouldVisible && !this.state.isVisible){
			this.jQControl.stop().animate({opacity:1}, this.setting.fadeDuration[0]);
			this.state.isVisible = true;
		}
		else if (this.state.shouldVisible == false && this.state.isVisible){
			this.jQControl.stop().animate({opacity:0}, this.setting.fadeDuration[1]);
			this.state.isVisible = false;
		}
	}
}
jQuery(function(){
	var mainObj = scrollToTop;
	var iebrws = document.all;
	mainObj.cssFixedSupport = !iebrws || (iebrws && document.compatMode == 'CSS1Compat' && window.XMLHttpRequest);
	mainObj.jQBody=(window.opera) ? (document.compatMode == 'CSS1Compat' ? jQuery('html') : jQuery('body')) : jQuery('html,body');
	mainObj.jQControl=jQuery('<div id="topcontrol">' + mainObj.controlHTML + '</div>')
		.css({position: (mainObj.cssFixedSupport ? 'fixed' : 'absolute'), bottom: mainObj.controlattrs.offsety, right: mainObj.controlattrs.offsetx, opacity: 0, cursor: 'pointer'})
		.attr({title: 'Scroll Back to Top'})
		.click(function(){mainObj.scrollUp(); return false;})
		.appendTo('body');
	if (document.all && !window.XMLHttpRequest && mainObj.jQControl.text() != ''){
		mainObj.jQControl.css({width: mainObj.jQControl.width()});
	}
	mainObj.toggleControl();
	jQuery('a[href="' + mainObj.anchorKeyword +'"]').click(function(){mainObj.scrollUp();return false;});
	jQuery(window).bind('scroll resize', function(e){mainObj.toggleControl();});
});
*/
(function (jQuery) {
	jQuery.fn.focusEnd = function () {
		return this.each(function () {
			var A = this;
			if (A.style.display != "none") {
				if (jQuery.browser.msie) {
					A.focus();
					var B = A.createTextRange();
					B.collapse(false);
					B.select();
				} else {
					A.setSelectionRange(A.value.length, A.value.length);
					A.focus();
				}
			}
		})
	};
	jQuery.fn.focusFirstTextField = function () {
		return this.find("input[type=text]:visible:enabled:first").focus().length > 0;
	},
	jQuery.fn.focusFirstTextArea = function () {
		return this.find("textarea:visible:enabled:first").focus().length > 0;
	};
	jQuery.fn.focusFirstTextElement = function () {
		return this.focusFirstTextField() || this.focusFirstTextArea();
	};
})(jQuery);/*
 * 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
 *
 */
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
		}
		// CAUTION: Needed to parenthesize options.path and options.domain
		// in the following expressions, otherwise they evaluate to undefined
		// in the packed version for some reason...
		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;
	}
};/*
 * jQuery Easing v1.1.1 - http://gsgd.co.uk/sandbox/jquery.easing.php
 *
 * Uses the built in easing capabilities added in jQuery 1.1
 * to offer multiple easing options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

jQuery.extend({
	easing: {
		easein: function(x, t, b, c, d) {
			return c*(t/=d)*t + b; // in
		},
		easeinout: function(x, t, b, c, d) {
			if (t < d/2) return 2*c*t*t/(d*d) + b;
			var ts = t - d/2;
			return -2*c*ts*ts/(d*d) + 2*c*ts/d + c/2 + b;
		},
		easeout: function(x, t, b, c, d) {
			return -c*t*t/(d*d) + 2*c*t/d + b;
		},
		expoin: function(x, t, b, c, d) {
			var flip = 1;
			if (c < 0) {
				flip *= -1;
				c *= -1;
			}
			return flip * (Math.exp(Math.log(c)/d * t)) + b;
		},
		expoout: function(x, t, b, c, d) {
			var flip = 1;
			if (c < 0) {
				flip *= -1;
				c *= -1;
			}
			return flip * (-Math.exp(-Math.log(c)/d * (t-d)) + c + 1) + b;
		},
		expoinout: function(x, t, b, c, d) {
			var flip = 1;
			if (c < 0) {
				flip *= -1;
				c *= -1;
			}
			if (t < d/2) return flip * (Math.exp(Math.log(c/2)/(d/2) * t)) + b;
			return flip * (-Math.exp(-2*Math.log(c/2)/d * (t-d)) + c + 1) + b;
		},
		bouncein: function(x, t, b, c, d) {
			return c - jQuery.easing['bounceout'](x, d-t, 0, c, d) + b;
		},
		bounceout: function(x, t, b, c, d) {
			if ((t/=d) < (1/2.75)) {
				return c*(7.5625*t*t) + b;
			} else if (t < (2/2.75)) {
				return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
			} else if (t < (2.5/2.75)) {
				return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
			} else {
				return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
			}
		},
		bounceinout: function(x, t, b, c, d) {
			if (t < d/2) return jQuery.easing['bouncein'] (x, t*2, 0, c, d) * .5 + b;
			return jQuery.easing['bounceout'] (x, t*2-d,0, c, d) * .5 + c*.5 + b;
		},
		elasin: function(x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		},
		elasout: function(x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
		},
		elasinout: function(x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
			return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
		},
		backin: function(x, t, b, c, d) {
			var s=1.70158;
			return c*(t/=d)*t*((s+1)*t - s) + b;
		},
		backout: function(x, t, b, c, d) {
			var s=1.70158;
			return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
		},
		backinout: function(x, t, b, c, d) {
			var s=1.70158;
			if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
			return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
		},
		linear: function(x, t, b, c, d) {
			return c*t/d + b; //linear
		}
	}
});
/* Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.3
 * Requires jQuery 1.1.3+
 * Docs: http://docs.jquery.com/Plugins/livequery
 */

(function (jQuery) {

	jQuery.extend(jQuery.fn, {
		livequery: function (type, fn, fn2) {
			var self = this,
			q;

			// Handle different call patterns
			if (jQuery.isFunction(type)) fn2 = fn,
			fn = type,
			type = undefined;

			// See if Live Query already exists
			jQuery.each(jQuery.livequery.queries, function (i, query) {
				if (self.selector == query.selector && self.context == query.context && type == query.type && (!fn || fn.jQuerylqguid == query.fn.jQuerylqguid) && (!fn2 || fn2.jQuerylqguid == query.fn2.jQuerylqguid))
				// Found the query, exit the each loop
				return (q = query) && false;
			});

			// Create new Live Query if it wasn't found
			q = q || new jQuery.livequery(this.selector, this.context, type, fn, fn2);

			// Make sure it is running
			q.stopped = false;

			// Run it immediately for the first time
			q.run();

			// Contnue the chain
			return this;
		},

		expire: function (type, fn, fn2) {
			var self = this;

			// Handle different call patterns
			if (jQuery.isFunction(type)) fn2 = fn,
			fn = type,
			type = undefined;

			// Find the Live Query based on arguments and stop it
			jQuery.each(jQuery.livequery.queries, function (i, query) {
				if (self.selector == query.selector && self.context == query.context && (!type || type == query.type) && (!fn || fn.jQuerylqguid == query.fn.jQuerylqguid) && (!fn2 || fn2.jQuerylqguid == query.fn2.jQuerylqguid) && !this.stopped) jQuery.livequery.stop(query.id);
			});

			// Continue the chain
			return this;
		}
	});

	jQuery.livequery = function (selector, context, type, fn, fn2) {
		this.selector = selector;
		this.context = context || document;
		this.type = type;
		this.fn = fn;
		this.fn2 = fn2;
		this.elements = [];
		this.stopped = false;

		// The id is the index of the Live Query in jQuery.livequery.queries
		this.id = jQuery.livequery.queries.push(this) - 1;

		// Mark the functions for matching later on
		fn.jQuerylqguid = fn.jQuerylqguid || jQuery.livequery.guid++;
		if (fn2) fn2.jQuerylqguid = fn2.jQuerylqguid || jQuery.livequery.guid++;

		// Return the Live Query
		return this;
	};

	jQuery.livequery.prototype = {
		stop: function () {
			var query = this;

			if (this.type)
			// Unbind all bound events
			this.elements.unbind(this.type, this.fn);
			else if (this.fn2)
			// Call the second function for all matched elements
			this.elements.each(function (i, el) {
				query.fn2.apply(el);
			});

			// Clear out matched elements
			this.elements = [];

			// Stop the Live Query from running until restarted
			this.stopped = true;
		},

		run: function () {
			// Short-circuit if stopped
			if (this.stopped) return;
			var query = this;

			var oEls = this.elements,
			els = jQuery(this.selector, this.context),
			nEls = els.not(oEls);

			// Set elements to the latest set of matched elements
			this.elements = els;

			if (this.type) {
				// Bind events to newly matched elements
				nEls.bind(this.type, this.fn);

				// Unbind events to elements no longer matched
				if (oEls.length > 0) jQuery.each(oEls, function (i, el) {
					if (jQuery.inArray(el, els) < 0) jQuery.event.remove(el, query.type, query.fn);
				});
			}
			else {
				// Call the first function for newly matched elements
				nEls.each(function () {
					query.fn.apply(this);
				});

				// Call the second function for elements no longer matched
				if (this.fn2 && oEls.length > 0) jQuery.each(oEls, function (i, el) {
					if (jQuery.inArray(el, els) < 0) query.fn2.apply(el);
				});
			}
		}
	};

	jQuery.extend(jQuery.livequery, {
		guid: 0,
		queries: [],
		queue: [],
		running: false,
		timeout: null,

		checkQueue: function () {
			if (jQuery.livequery.running && jQuery.livequery.queue.length) {
				var length = jQuery.livequery.queue.length;
				// Run each Live Query currently in the queue
				while (length--)
				jQuery.livequery.queries[jQuery.livequery.queue.shift()].run();
			}
		},

		pause: function () {
			// Don't run anymore Live Queries until restarted
			jQuery.livequery.running = false;
		},

		play: function () {
			// Restart Live Queries
			jQuery.livequery.running = true;
			// Request a run of the Live Queries
			jQuery.livequery.run();
		},

		registerPlugin: function () {
			jQuery.each(arguments, function (i, n) {
				// Short-circuit if the method doesn't exist
				if (!jQuery.fn[n]) return;

				// Save a reference to the original method
				var old = jQuery.fn[n];

				// Create a new method
				jQuery.fn[n] = function () {
					// Call the original method
					var r = old.apply(this, arguments);

					// Request a run of the Live Queries
					jQuery.livequery.run();

					// Return the original methods result
					return r;
				}
			});
		},

		run: function (id) {
			if (id != undefined) {
				// Put the particular Live Query in the queue if it doesn't already exist
				if (jQuery.inArray(id, jQuery.livequery.queue) < 0) jQuery.livequery.queue.push(id);
			}
			else
			// Put each Live Query in the queue if it doesn't already exist
			jQuery.each(jQuery.livequery.queries, function (id) {
				if (jQuery.inArray(id, jQuery.livequery.queue) < 0) jQuery.livequery.queue.push(id);
			});

			// Clear timeout if it already exists
			if (jQuery.livequery.timeout) clearTimeout(jQuery.livequery.timeout);
			// Create a timeout to check the queue and actually run the Live Queries
			jQuery.livequery.timeout = setTimeout(jQuery.livequery.checkQueue, 20);
		},

		stop: function (id) {
			if (id != undefined)
			// Stop are particular Live Query
			jQuery.livequery.queries[id].stop();
			else
			// Stop all Live Queries
			jQuery.each(jQuery.livequery.queries, function (id) {
				jQuery.livequery.queries[id].stop();
			});
		}
	});

	// Register core DOM manipulation methods
	jQuery.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove');

	// Run Live Queries when the Document is ready
	jQuery(function () {
		jQuery.livequery.play();
	});

	// Save a reference to the original init method
	var init = jQuery.prototype.init;

	// Create a new init method that exposes two new properties: selector and context
	jQuery.prototype.init = function (a, c) {
		// Call the original init and save the result
		var r = init.apply(this, arguments);

		// Copy over properties if they exist already
		if (a && a.selector) r.context = a.context,
		r.selector = a.selector;

		// Set properties
		if (typeof a == 'string') r.context = c || document,
		r.selector = a;

		// Return the result
		return r;
	};

	// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091)
	jQuery.prototype.init.prototype = jQuery.prototype;

})(jQuery);
/* textarea-resizer */
(function($){var textarea,staticOffset;var iLastMousePos=0;var iMin=32;var grip;$.fn.TextAreaResizer=function(){return this.each(function(){textarea=$(this).addClass('processed'),staticOffset=null;$(this).wrap('<div class="resizable-textarea"><span></span></div>').parent().append($('<div class="grippie"></div>').bind("mousedown",{el:this},startDrag));var grippie=$('div.grippie',$(this).parent())[0];grippie.style.marginRight=(grippie.offsetWidth-$(this)[0].offsetWidth)+'px'})};function startDrag(e){textarea=$(e.data.el);textarea.blur();iLastMousePos=mousePosition(e).y;staticOffset=textarea.height()-iLastMousePos;textarea.css('opacity',0.25);$(document).mousemove(performDrag).mouseup(endDrag);return false}function performDrag(e){var iThisMousePos=mousePosition(e).y;var iMousePos=staticOffset+iThisMousePos;if(iLastMousePos>=(iThisMousePos)){iMousePos-=5}iLastMousePos=iThisMousePos;iMousePos=Math.max(iMin,iMousePos);textarea.height(iMousePos+'px');if(iMousePos<iMin){endDrag(e)}return false}function endDrag(e){$(document).unbind('mousemove',performDrag).unbind('mouseup',endDrag);textarea.css('opacity',1);textarea.focus();textarea=null;staticOffset=null;iLastMousePos=0}function mousePosition(e){return{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}}})(jQuery);
jQuery(document).ready(function() {
	jQuery('textarea').addClass('resizable');
	jQuery('textarea.resizable:not(.processed)').TextAreaResizer();
});
