importScripts('worker.functions.js');

var i = 0;

function timedCount() {
	i = i + 1;

	payload = { message: i }
	this.send("say", payload)

	setTimeout("timedCount()",500);
}

function add(payload){
	i += payload.amount
}

@@ -36,189 +36,292 @@
 );%0A%0A
-var i = 0;%0A%0Afunction timedCount() %7B%0A%09i = i + 1;%0A%0A%09payload = %7B message: i %7D%0A%09this.send(%22say%22, payload)%0A%0A%09setTimeout(%22timedCount()%22,500);%0A%7D%0A%0Afunction add(payload)%7B%0A%09i += payload.amount
+%0A// functions are just called magicly from your window level script%0A// and will be called via the receiver in worker.functions.js%0Afunction fromthewindows(message)%7B%0A%09console.log(message);%0A%09console.log(%22FROM THE WINDOWS!%22);%0A%09req.tothewalls(); // this makes tothewalls() run in example.js
 %0A%7D%0A

Update worker.js