/*
jQuery Browser Plugin
	* Version 2.3
	* 2008-09-17 19:27:05
	* URL: http://jquery.thewikies.com/browser
	* Description: jQuery Browser Plugin extends browser detection capabilities and can assign browser selectors to CSS classes.
	* Author: Nate Cavanaugh, Minhchau Dang, & Jonathan Neal
	* Copyright: Copyright (c) 2008 Jonathan Neal under dual MIT/GPL license.
	* JSLint: This javascript file passes JSLint verification.
	
	Example useage:
	alert($.browser.className); // this will alert 'firefox3'
	alert($.os.name); // this will alert 'mac'
	
	jslint
		bitwise: true,
		browser: true,
		eqeqeq: true,
		forin: true,
		nomen: true,
		plusplus: true,
		undef: true,
		white: true
*/
(function($){$.browserTest=function(a,z){var u='unknown',x='X',m=function(r,h){for(var i=0;i<h.length;i=i+1){r=r.replace(h[i][0],h[i][1]);}return r;},c=function(i,a,b,c){var r={name:m((a.exec(i)||[u,u])[1],b)};r[r.name]=true;r.version=(c.exec(i)||[x,x,x,x])[3];if(r.name.match(/safari/)&&r.version>400){r.version='2.0';}if(r.name==='presto'){r.version=($.browser.version>9.27)?'futhark':'linear_b';}r.versionNumber=parseFloat(r.version,10)||0;r.versionX=(r.version!==x)?(r.version+'').substr(0,1):x;r.className=r.name+r.versionX;return r;};a=(a.match(/Opera|Navigator|Minefield|KHTML|Chrome/)?m(a,[[/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/,''],['Chrome Safari','Chrome'],['KHTML','Konqueror'],['Minefield','Firefox'],['Navigator','Netscape']]):a).toLowerCase();$.browser=$.extend((!z)?$.browser:{},c(a,/(camino|chrome|firefox|netscape|konqueror|lynx|msie|opera|safari)/,[],/(camino|chrome|firefox|netscape|netscape6|opera|version|konqueror|lynx|msie|safari)(\/|\s)([a-z0-9\.\+]*?)(\;|dev|rel|\s|$)/));$.layout=c(a,/(gecko|konqueror|msie|opera|webkit)/,[['konqueror','khtml'],['msie','trident'],['opera','presto']],/(applewebkit|rv|konqueror|msie)(\:|\/|\s)([a-z0-9\.]*?)(\;|\)|\s)/);$.os={name:(/(win|mac|linux|sunos|solaris|iphone)/.exec(navigator.platform.toLowerCase())||[u])[0].replace('sunos','solaris')};if(!z){$('html').addClass([$.os.name,$.browser.name,$.browser.className,$.layout.name,$.layout.className].join(' '));}};$.browserTest(navigator.userAgent);})(jQuery);

/*
jQuery hoverClass Plugin
	* Version 1
	* 2009-10-28
	* Description: Adds and removes the "hover" class upon hover on/off.
	* Author: Jeremy Ricketts
	* Copyright: Copyright (c) 2010 Jeremy Ricketts under dual MIT/GPL license.

	Example useage:
	$("#selector").hoverClass();
*/
(function($) {
	$.fn.extend({
		hoverClass: function() {
			return this.each(function() {
				$(this).hover( function() {
					$(this).addClass('hover');
				}, function() {
					$(this).removeClass('hover');
				});
			});
		}
	});      
})(jQuery);

/*
jQuery comboToggle Plugin
	* Version 1
	* 2009-10-28
	* Description: Adds and removes the "hover" class upon hover on/off.
	* Author: Jeremy Ricketts
	* Copyright: Copyright (c) 2010 Jeremy Ricketts under dual MIT/GPL license.

	Example useage:
	$('#fade').click(function() {
      $(this).next().comboToggle('slow');
    });
*/
jQuery.fn.comboToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); 
};

/*
jQuery valueHold Plugin
	* Version 1
	* 2009-10-28
	* Description: On input fields, get the initual value and save it as the default value. If the user clicks the input, then clear out the value. If nothing is entered and the user clicks away, then the initial value is restored.
	* Author: Jeremy Ricketts
	* Copyright: Copyright (c) 2010 Jeremy Ricketts under dual MIT/GPL license.

	Example useage:
	$("input.value_hold").valueHold();
*/
(function($) {
	$.fn.extend({
		valueHold: function() {
			return this.each(function() {
				var iv = $(this).val();
				$(this).focus(function () {
					if ($(this).attr('value') == iv) {
						$(this).val('');
					}
				});
				$(this).blur(function () {
					if ($(this).attr('value') == '') {
						$(this).val(iv);
					}
				});
			});
		}
	});      
})(jQuery);
/**
 * Equal Heights Plugin
 * Equalize the heights of elements. Great for columns or any elements
 * that need to be the same size (floats, etc).
 * 
 * Version 1.0
 * Updated 12/10/2008
 *
 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
 *
 * Usage: $(object).equalHeights([minHeight], [maxHeight]);
 * 
 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
 * than 300 pixels tall. Elements with too much content will gain a scrollbar.
 * 
 */

(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}
})(jQuery);
/**
 * jQuery Maxlength plugin
 * @version		$Id: jquery.maxlength.js 18 2009-05-16 15:37:08Z emil@anon-design.se $
 * @package		jQuery maxlength 1.0.5
 * @copyright	Copyright (C) 2009 Emil Stjerneman / http://www.anon-design.se
 * @license		GNU/GPL, see LICENSE.txt
 */
 (function(A){A.fn.maxlength=function(B){var C=jQuery.extend({events:[],maxCharacters:10,status:true,statusClass:"status",statusText:"character left",notificationClass:"notification",showAlert:false,alertText:"You have typed too many characters.",slider:false},B);A.merge(C.events,["keyup"]);return this.each(function(){var G=A(this);var J=A(this).val().length;function D(){var K=C.maxCharacters-J;if(K<0){K=0}G.next("div").html(K+" "+C.statusText)}function E(){var K=true;if(J>=C.maxCharacters){K=false;G.addClass(C.notificationClass);G.val(G.val().substr(0,C.maxCharacters));I()}else{if(G.hasClass(C.notificationClass)){G.removeClass(C.notificationClass)}}if(C.status){D()}}function I(){if(C.showAlert){alert(C.alertText)}}function F(){var K=false;if(G.is("textarea")){K=true}else{if(G.filter("input[type=text]")){K=true}else{if(G.filter("input[type=password]")){K=true}}}return K}if(!F()){return false}A.each(C.events,function(K,L){G.bind(L,function(M){J=G.val().length;E()})});if(C.status){G.after(A("<div/>").addClass(C.statusClass).html("-"));D()}if(!C.status){var H=G.next("div."+C.statusClass);if(H){H.remove()}}if(C.slider){G.next().hide();G.focus(function(){G.next().slideDown("fast")});G.blur(function(){G.next().slideUp("fast")})}})}})(jQuery);
/*
 * jQuery Growfield Library 2
 *
 * http://code.google.com/p/jquery-dynamic/
 * licensed under the MIT license
 *
 * autor: john kuindji
 */
(function(C){if(C.support==undefined){C.support={boxModel:C.boxModel}}var A=false;C(window).one("load",function(){A=true});C.fx.prototype.originalUpdate=C.fx.prototype.update;C.fx.prototype.update=false;C.fx.prototype.update=function(){if(!this.options.inline){return this.originalUpdate.call(this)}if(this.options.step){this.options.step.call(this.elem,this.now,this)}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this)};var B=function(D){this.dom=D;this.o=C(D);this.opt={auto:true,animate:100,easing:null,min:false,max:false,restore:false,step:false};this.enabled=this.dummy=this.busy=this.initial=this.sizeRelated=this.prevH=this.firstH=false};B.prototype={toggle:function(D){if((D=="disable"||D===false)&&this.enabled){return this.setEvents("off")}if((D=="enable"||D===true)&&!this.enabled){return this.setEvents("on")}return this},setEvents:function(I){var H=this.o,E=this.opt,G=this,D=false;if(I=="on"&&!this.enabled){var F=H.height()==0?true:false;if(!F||A){C(function(){G.prepareSizeRelated()})}else{C(window).one("load",function(){G.prepareSizeRelated()})}if(E.auto){H.bind("keyup.growfield",function(J){G.keyUp(J);return true});H.bind("focus.growfield",function(J){G.focus(J);return true});H.bind("blur.growfield",function(J){G.blur(J);return true});D={overflow:H.css("overflow"),cssResize:H.css("resize")};if(C.browser.safari){H.css("resize","none")}this.initial=D;H.css({overflow:"hidden"});if(!F||A){C(function(){G.createDummy()})}else{C(window).one("load",function(){G.createDummy()})}}else{H.bind("keydown.growfield",function(J){G.manualKeyUp(J);return true});H.css("overflow-y","auto");if(!F||A){C(function(){G.update(H.height())})}else{C(window).one("load",function(){G.update(H.height())})}}H.addClass("growfield");this.enabled=true}else{if(I=="off"&&this.enabled){if(this.dummy){this.dummy.remove();this.dummy=false}H.unbind(".growfield").css("overflow",this.initial.overflow);if(C.browser.safari){H.css("resize",this.initial.cssResize)}this.enabled=false}}return this},setOptions:function(D){var E=this.opt,F=this.o;C.extend(E,D);if(!C.easing){E.easing=null}},update:function(N,G){var D=this.sizeRelated,J=this.o.val(),F=this.opt,M=this.dom,H=this.o,E=this,K=this.prevH;var I=!F.auto,L=F.auto;N=this.convertHeight(Math.round(N),"inner");N=F.min>N?F.min:F.max&&N>F.max?F.max:F.auto&&!J?F.min:N;if(F.max&&F.auto){if(K!=F.max&&N==F.max){H.css("overflow-y","scroll");if(!F.animate){H.focus()}I=true;L=false}if(K==F.max&&N<F.max){H.css("overflow-y","hidden");if(!F.animate){H.focus()}L=false}}if(N==K){return true}this.prevH=N;if(G){E.busy=true;H.animate({height:N},{duration:F.animate,easing:F.easing,overflow:null,inline:true,complete:function(){if(!I){H.css("overflow","hidden")}if(!L){H.focus()}E.busy=false},queue:false})}else{M.style.height=N+"px"}},manualKeyUp:function(D){if(!D.ctrlKey){return }if(D.keyCode!=38&&D.keyCode!=40){return }this.update(this.o.outerHeight()+(this.opt.step*(D.keyCode==38?-1:1)),this.opt.animate)},keyUp:function(D){if(this.busy){return true}if(C.inArray(D.keyCode,[37,38,39,40])!=-1){return true}this.update(this.getDummyHeight(),this.opt.animate)},focus:function(D){if(this.busy){return true}if(this.opt.restore){this.update(this.getDummyHeight(),this.opt.animate)}},blur:function(D){if(this.busy){return true}if(this.opt.restore){this.update(0,false)}},getDummyHeight:function(){var G=this.o.val(),E=0,D=this.sizeRelated,F="\n111\n111";if(C.browser.safari){G=G.substring(0,G.length-1)}if(!D.lh||!D.fs){G+=F}this.dummy.val(G);if(C.browser.msie){this.dummy[0].style.height=this.dummy[0].scrollHeight+"px"}E=this.dummy[0].scrollHeight;if(D.lh&&D.fs){E+=D.lh>D.fs?D.lh+D.fs:D.fs*2}if(C.browser.msie){this.dummy[0].style.height="20px"}return E},createDummy:function(){var F=this.o,E=this.o.val();var D=F.clone().addClass("growfieldDummy").attr("name","").attr("tabindex",-9999).css({position:"absolute",left:-9999,top:0,height:"20px",resize:"none"}).insertBefore(F).show();if(!E){D.val("dummy text")}this.dummy=D;this.update(!jQuery.trim(E)?0:this.getDummyHeight(),false)},convertHeight:function(F,H){var E=this.sizeRelated,D=(H=="inner"?-1:1),G=C.support.boxModel;return F+(G?E.bt:0)*D+(G?E.bb:0)*D+(G?E.pt:0)*D+(G?E.pb:0)*D},prepareSizeRelated:function(){var F=this.o,D=this.opt;if(!D.min){D.min=parseInt(F.css("min-height"),10)||this.firstH||parseInt(F.height(),10)||20;if(D.min<=0){D.min=20}if(!this.firstH){this.firstH=D.min}}if(!D.max){D.max=parseInt(F.css("max-height"),10)||false;if(D.max<=0){D.max=false}}if(!D.step){D.step=parseInt(F.css("line-height"),10)||parseInt(F.css("font-size"),10)||20}var E={pt:parseInt(F.css("paddingTop"),10)||0,pb:parseInt(F.css("paddingBottom"),10)||0,bt:parseInt(F.css("borderTopWidth"),10)||0,bb:parseInt(F.css("borderBottomWidth"),10)||0,lh:parseInt(F.css("lineHeight"),10)||false,fs:parseInt(F.css("fontSize"),10)||false};this.sizeRelated=E}};C.fn.growfield=function(D){if("destroy"==D){return this.each(function(){var F=C(this).data("growfield");if(F==undefined){return true}F.toggle(false);C(this).removeData("growfield");return true})}if("restart"==D){return this.each(function(){var F=C(this).data("growfield");if(F==undefined){return true}F.toggle(false).toggle(true)})}var E=typeof D;return this.each(function(){if(!/textarea/i.test(this.tagName)||C(this).hasClass("growfieldDummy")){return true}var F=false,J=C(this),H=J.data("growfield");if(H==undefined){F=true;J.data("growfield",new B(this));H=J.data("growfield")}if(F){var G=C.extend({},C.fn.growfield.defaults,D);H.setOptions(G)}if(!F&&(!D||E=="object")){H.setOptions(D)}if(E=="string"){if(D.indexOf("!")==0&&C.fn.growfield.presets[D.substr(1)]){J.unbind("."+i+"."+D.substr(1))}else{if(C.fn.growfield.presets[D]){var I=C.fn.growfield.presets[D];H.setOptions(I,D)}}}if(F&&!G.skipEnable){H.toggle(true)}if(!F&&(E=="boolean"||D=="enable"||D=="disable")){H.toggle(D)}})};C.fn.growfield.defaults={};C.fn.growfield.presets={}})(jQuery);








