/*NOT TEST*/
function text_class()
{
	var email_rule;
	this.email_rule=/^(.+)@(.+)$/;
}

text_class.prototype = {
	quotes : function(text){text=text.replace('"',"&quot;");},
	strip_tags : function(text){text=text.replace("<","&lt;");text=text.replace(">","&gt;");},
	trim : function(text){return text.replace(/(^\s+)|(\s+$)/g, "");},
	is_empty : function(text){if(text.length=="undefined"||text.length==0){return true;}return false;},	
	is_email:function(email_str)
	{
		if(this.is_empty(email_str)){return false;}
		var match_array=email_str.match(this.email_rule);if (match_array==null) {return false;}return true;
	},	
	nl2br:function(text)
	{
		var i,replace=new Array( "\r\n", "\n", "\r" );for(i=0;i<replace.length;i++){while(text.match(replace[i])){text=text.replace(replace[i],"<br />");}}
	},
	is_image : function(text)
	{
		if(text.length<5){return false;}
		var expansion=text.substr(text.indexOf("."));	
		if((expansion==".gif")||(expansion==".jpg")){ return true;}
		return false;		
	},	
	str_replace : function(txt,cut_str,paste_str)
	{ 
		var f=0;
		var ht='';
		ht=ht+txt;
		f=ht.indexOf(cut_str);		
		while (f!=-1){ f=ht.indexOf(cut_str);if(f>0){ht = ht.substr(0,f) + paste_str + ht.substr(f+cut_str.length);};};
		return ht;
	}
}


