Fix escaping strings for JavaScript

The correct way to pass strings from PHP to JavaScript is json_encode.

Using addslashes or htmlspecialchars(..., ENT_QUOTES) may lead to
unexpected issues.
Declare some local variables

Let's avoid creating global variables
Update mail.php

Add function setBodyHTML. $bodyHTML is protected and can't be retrieved without a getter. Useful when you want to debug mails on a machine without a mailserver.
Fix adding timestamp in ccm_addHeaderItem

When adding a timestamp to the resources (.css/.js files) loaded by
ccm_addHeaderItem, add a timestamp to avoid cache.
BTW, if the URL of the resource already contains a GET parameters
(eg 'file.js?a=X'), the timestamp is appended withoud adding a new
parameter (eg 'file.js?a=X1393878504000).
That will mess up the existing GET parameter.

Let's fix this by adding a new GET parameter when adding the timestamp
even when we already have other GET parameters.
xss prevention
Fix potential problems with javascript/translations

'Automation Instructions' may contains quotes in translations: let's be
sure to correctly escape it before using it in JavaScript
jsname
dboard jobs singlepages
profile reg
dboard public reg
Merge pull request #1597 from mlocati/fix-javascript-strings

Fix escaping strings for JavaScript
Merge pull request #1642 from akodde/patch-2

Update mail.php
Merge pull request #1643 from mlocati/fix-append-timestamp-with-ccm_addHeaderItem

Fix adding timestamp in ccm_addHeaderItem
Merge pull request #1645 from mlocati/fix-js-string-jobs

Fix potential problems with javascript/translations
cvID[] sanitation
sanitize
make handle in attribute types unique
Don't overwrite parameters values

Assigning JavaScripts objects to another variable name does not make a
clone of it, so changing the `source` and `destination` properties affects
all the tasks (example: http://jsfiddle.net/d5KzG/ ).

Let's fix this ;)
fixing double <label class="checkbox"><label class="checkbox">
to once (should be enough).
sanitize item list