Joining them on the serverside and setting the variables on the clientside will work just as well; like this:
PHP Code:
function onCreated()
this.join("window");
//#CLIENTSIDE
function onCreated()
this.windowtype = "1b";
The synchronisation of attributes is usually delayed a bit. I, personally, only use them as a last resort.