//Remove Empty Lines from Text (Javascript) is Copyright 2010 TextMechanic.com All Rights Reserved

function cleartext(){
document.getElementById('input_output').value = '';
document.getElementById('removed').innerHTML = ''}
function rel(){
var text = document.getElementById('input_output').value;
text = text.replace(/\r/gi,'');
text = text.split('\n');
count1 = text.length;
if(document.getElementById('rwhitespace').checked == true){
for(x=0;x<count1;x++){
if(text[x].match(/[\S]/g) == null) text[x] = ''; else text[x] = text[x];}}
text = text.join('\n').replace(/\n{2,}/g,'\n');
count2 = text.split('\n').length;
document.getElementById('input_output').value = text;
count3 = count1 - count2;
document.getElementById('removed').innerHTML = count3 + ' empty lines removed. ';}
function SelectAll(id){
document.getElementById(id).focus();
document.getElementById(id).select();}
