function runCompression() {
	$('compressor_output_div').style.display = "block";
	$('compressor_savings').style.display = "block";
	var inputByte = 0;
	var code = document.getElementById('compressor_input').value;
	inputByte = code.length;

	var commentRegex='';
	//strip comments ?
	if ($("compressor_strip_comments").checked) {
		commentRegex='\\/\\*.*?\\*\\/';
	}

	//strip long comments ?
	if ($("compressor_strip_long_comments").checked) {
		commentRegex='\\/\\*.{'+document.getElementById("compressor_strip_length").value+',}?\\*\\/';
	}

	code = trim(code);	// trim space at start and end

	//strip comments
	if ('' != commentRegex) {
		commentRegex = new RegExp(commentRegex, 'g');
		code = code.replace(commentRegex, '');
	}
	
	code = code.replace(/\n*/g, ""); 					// strip newlines
	code = code.replace(/(\s|\t)+/g, " ");				// replace all tabs and spaces with one space (a|b)+
	code = code.replace(/\s?([;:{},+>])\s?/g, '$1'); 	// no need for space around these characters
	code = code.replace(/;}/g, '}');                 	// don't need semicolon for the last statement in a rule

	// add newlines
	if (document.getElementById("compressor_new_line").checked) {
		code=code.replace(/}/g, "}\n");
	}

	//document.getElementById('o_size').value=code.length;
	document.getElementById('compressor_output').value = code;

	var savings = code.length/inputByte*100;
	savings = 100-savings;
	savings = Math.round(savings*100)/100;
	$('compressor_savings').innerHTML = "From " + inputByte + " bytes to " + code.length + " bytes (" + savings + "% smaller)";
}