jQuery.fn.wrapOff = function(){
	this.each(function(){
		if(this.tagName.toLowerCase() != "textarea".toLowerCase()) return;
		var node = this;
		$(node).attr("wrap", "off");
		var myText = node.value;
		var newNode = $(node).clone();
		$(newNode).attr("id", "myTemp");
		$(newNode).html(myText);
		$(newNode).insertBefore("#myText");
		$("#myText").remove();
		$(newNode).attr("id", "myText");
	});
}

jQuery.fn.wrapOn = function(){
	this.each(function(){
		if(this.tagName.toLowerCase() != "textarea".toLowerCase()) return;
		var node = this;
		$(node).attr("wrap", "virtual");
		var myText = node.value;
		var newNode = $(node).clone();
		$(newNode).attr("id", "myTemp");
		$(newNode).html(myText);
		$(newNode).insertBefore("#myText");
		$("#myText").remove();
		$(newNode).attr("id", "myText");
	});
}

jQuery.fn.wrapSet = function(state){
	var nodes = jQuery(this);
	state ? nodes.wrapOn() : nodes.wrapOff();
}
