I found a way to cloak the javascript from the HTML output,
there is no way to find the Javascript source in the HTML output,
not even by following links or sources( e.g src="javasource.js ) you can find the source of the javascript.

This way to hide/cloak javascripts is to hide it in cookies on the clients machine. If you have with a individual that really want to have the javascript he will find it by looking through the cookies on the local machine. But the average javascript stealer are not willing/good enough to do alot of effort to get the script, they just copy cool things they see, but now they cannot do that anymore, because it is hidden in his cookies.

If you combine this with Expire date on the cookie, the cookie will be dead before he got the oppurtunity to copy the javascript code from it. ( Don't know if all browsers delete expired cookies )
And therefore he will not be able to reuse/steal your copyrighted javascript code.

You can also combine this with encryption to make it more harder to get the sourcecode of your precious javascripts.

Under you have the example code using JavascriptCloaker with ASP.

You can use this with ASP,PHP,ColdFusion or whatever you want, as the cookie is set it all done on the client side.

<Code>

<%@ LANGUAGE = JSCRIPT %>
<%
Response.Cookies( "AlertTest" ) = "<Script>\r\nalert( \"Javascript have been cloaked\" )\r\n</Script>\r\n";
%>
<html>
<head>
<title>Javascript Cloaking using cookies to hide javascripts</title>
<script>
function javascriptCloaker( CookieName ) {

// @Author Zrekam of badsystems.com 2003

var cookie = document.cookie;
var checkCookie = cookie.indexOf( "; " + CookieName + "=" );

if( checkCookie != -1 ) {
var start = checkCookie + CookieName.length + 3;
var end = 0;

var testEnd = cookie.indexOf( ";", start );

if( testEnd != -1 ) {
end = testEnd;
}
else{
end = cookie.length;
}

var cookieInfo = cookie.substring( start, end );

cookieInfo = cookieInfo.replace( /%3C/g, "<" );
cookieInfo = cookieInfo.replace( /%3E/g, ">" );
cookieInfo = cookieInfo.replace( /%0D/g, "\r" );
cookieInfo = cookieInfo.replace( /%0A/g, "\n" );
cookieInfo = cookieInfo.replace( /\+/g, " " );
cookieInfo = cookieInfo.replace( /%3D/g, "=" );
cookieInfo = cookieInfo.replace( /%28/g, "(" );
cookieInfo = cookieInfo.replace( /%22/g, "\"" );
cookieInfo = cookieInfo.replace( /%29/g, ")" );
cookieInfo = cookieInfo.replace( /%3B/g, ";" );
cookieInfo = cookieInfo.replace( /%2E/g, "." );
cookieInfo = cookieInfo.replace( /%3A/g, ":" );
cookieInfo = cookieInfo.replace( /%5C/g, "\\" );
cookieInfo = cookieInfo.replace( /%2C/g, "," );
cookieInfo = cookieInfo.replace( /%2F/g, "/" );
cookieInfo = cookieInfo.replace( /%5B/g, "[" );
cookieInfo = cookieInfo.replace( /%5D/g, "]" );
cookieInfo = cookieInfo.replace( /%27/g, "'" );
cookieInfo = cookieInfo.replace( /%2A/g, "*" );
cookieInfo = cookieInfo.replace( /%2D/g, "-" );
cookieInfo = cookieInfo.replace( /%5F/g, "_" );
cookieInfo = cookieInfo.replace( /%21/g, "!" );
cookieInfo = cookieInfo.replace( /%26/g, "&" );
cookieInfo = cookieInfo.replace( /%40/g, "@" );
cookieInfo = cookieInfo.replace( /%23/g, "#" );
cookieInfo = cookieInfo.replace( /%24/g, "$" );
cookieInfo = cookieInfo.replace( /%25/g, "%" );
cookieInfo = cookieInfo.replace( /%7B/g, "{" );
cookieInfo = cookieInfo.replace( /%7D/g, "}" );
cookieInfo = cookieInfo.replace( /%3F/g, "?" );

document.write( cookieInfo );
}
}
</script>
</head>
<body>
Cloaked.
<script>
javascriptCloaker( "AlertTest" );
</script>
</body>
</html>

</Code>