function isblank( space ){
	if( space == '' ){ return true; }

    for( var num=0; num < space.length;  num++){
	var ch = space.charAt(num);
	if((ch!= ' ' ) && (ch!= '\n' ) && (ch!= '\r' ) && (ch!= '\t')) {
	    return false;
	} // end if
    } // end for
    return true ;
} // end isblank

function encode_text( str ){ // get rid of nasty chars that will fuck up the database!
	str.multiline=true;
	str = str.replace(/"/g, "&quot;");
	str = str.replace(/\'/g, "&#039;");
	str = str.replace(/£/g, "&pound;");
	//str = str.replace(/</g, "&lt;");
	//str = str.replace(/>/g, "&gt;");
	return str;
}// encode text

function decode_text( str ){ // put chars back in
	str.multiline=false;
	str = str.replace(/&quot;/g, '"' );
	str = str.replace(/&#039;/g, "\'");
	str = str.replace(/&pound;/g, "£");
	//str = str.replace(/&lt;/g, "<");
	//str = str.replace(/&gt;/g, ">");
	
	return str;
}// decode text

function in_array( thearray, thevar ){
	
	for( var i =0; i < thearray.length; i++ ){
		if( thearray[i] == thevar){
			return true;
		}
	}
	return false;
} // in array

function stripurl( str ){
	str = str.replace(/(http:\/\/)([\_\-0-9a-zA-Z\/\.\?\=\&\%\:]+[\_\-0-9a-zA-Z\/\?\=\&\%\:])/gi, "$2"); 
	return str;
}