//Remove Empty Lines from Text (Javascript) is Copyright 2010 TextMechanic.com All Rights Reserved

function cleartext(){
document.form_rel.input_output.value = '';}

Array.prototype.clean = function(remove_item){
var a;
for (a = 0; a < this.length; a++){
if (this[a] == remove_item){
this.splice(a,1);a--;}
}return this;}
function rel(){
var text = document.form_rel.input_output.value;
text = text.replace(/\r/g,'');
text = text.split('\n');
count1 = text.length;
text = text.clean('');
text = text.clean(' ');
count2 = text.length;
text = text.join('\n');
document.form_rel.input_output.value = text;
count3 = count1 - count2;
document.getElementById('removed').innerHTML = count3 + ' empty lines were removed.';}

function SelectAll(id) {
document.getElementById(id).focus();
document.getElementById(id).select();}