/*
* $ID stripper.js, Eck, v0.9.
* Last update: Thu 06 Aug 2009 17:26:15 BST 
* Email: <webmaster@quotebucket.org>
* Website: http://quotebucket.org/
* Removes timestamps aswell as unwanted chars.
*/

// Set the timestamp variables.
function stripit(i) {
 var quote = i.value;
 var rgxpopular  = /\[\d\d:\d\d(:\d\d)?\] /gi;   // The most popular type of timestamp, [hour:minute:second]
 var rgxpopular2 = /\d\d:\d\d(:\d\d)?\ /gi;      // The same as above; but without the square brackets, hour:minute:second
 var rgxpopular3 = /\(\d\d:\d\d(:\d\d)?\) /gi;   // The same as above; but with round brackets. (hour:minute:second)
 var rgxescript  = /\[-\d\d:\d\d(:\d\d)?\-] /gi; // EcKstasy Script 2 and 3, [-hour:minute:second-]
 var rgxnnscript = /\d\d:\d\d(.\d\d)?\ /gi;      // NoNameScript, hour:minute.second (If I remember correctly).
// Set the char variables
 var rgxstrip1 = /\x1/gi;        // Unicode Character 'START OF HEADING' (U+0001)
 var rgxstrip2 = /\xAB/gi;       // Left double angle quotes
 var rgxstrip3 = /\xBB/gi;       // Right double angle quotes
 var rgxstrip4 = /\x3\d(\d)?/gi; // Unicode Character 'END OF TEXT' (U+0003), Also colour codes.
 var rgxstrip5 = /\x0F/gi;       // Unicode Character 'SHIFT IN' (U+000F)
 var rgxstrip6 = /\x2/gi;        // Unicode Character 'START OF TEXT' (U+0002)
 var rgxstrip7 = /\xA2/gi;       // Cent sign
 var rgxstrip8 = /\x1F/gi;       // Unicode Character 'INFORMATION SEPARATOR ONE' (U+001F)
 var rgxstrip9 = /\x8/gi;        // Unicode Character 'BACKSPACE' (U+0008)
  i.value = quote.
// Strip timestamps.
   replace(rgxpopular,  '').
   replace(rgxpopular2, '').
   replace(rgxpopular3, '').
   replace(rgxescript,  '').
   replace(rgxnnscript, '').
// Strip/replace messy chars.
   replace(rgxstrip1,   '').
   replace(rgxstrip2,  '<').
   replace(rgxstrip3,  '>').
   replace(rgxstrip4,   '').
   replace(rgxstrip5,   '').
   replace(rgxstrip6,   '').
   replace(rgxstrip7,  '*').
   replace(rgxstrip8,   '').
   replace(rgxstrip9,   '');
}
