/* global App, $state */

new App();

// var ptest =  $add(new Page("img/heavy.png", 0).load());
window.onscroll = function (event) {
  $state.setScroll((event.pageY !== undefined)
    ? event.pageY
    : document.body.scrollTop);
};

window.onmouseup = $state.mouseRelease;

window.onmousemove = function (event) {
  $state.setMouse(event);
};

window.addEventListener("orientationchange", $state.updateWindow, false);
window.addEventListener("resize", $state.updateWindow, false);
// window.addEventListener("touchstart", $state.touchStart, false);
// window.addEventListener("touchend", $state.touchEnd, false);
// window.addEventListener("touchleave", $state.touchEnd, false);
// window.addEventListener("touchcancel", $state.touchEnd, false);
function $main() {}


@@ -13,739 +13,47 @@
 p, $
-state */%0A%0Anew App();%0A%0A// var ptest =  
+add */%0A%0A
 $add(
+(
 new 
-Page(%22img/heavy.png%22, 0).load());%0Awindow.onscroll = function (event) %7B%0A  $state.setScroll((event.pageY !== undefined)%0A    ? event.pageY%0A    : document.body.scrollTop);%0A%7D;%0A%0Awindow.onmouseup = $state.mouseRelease;%0A%0Awindow.onmousemove = function (event) %7B%0A  $state.setMouse(event);%0A%7D;%0A%0Awindow.addEventListener(%22orientationchange%22, $state.updateWindow, false);%0Awindow.addEventListener(%22resize%22, $state.updateWindow, false);%0A// window.addEventListener(%22touchstart%22, $state.touchStart, false);%0A// window.addEventListener(%22touchend%22, $state.touchEnd, false);%0A// window.addEventListener(%22touchleave%22, $state.touchEnd, false);%0A// window.addEventListener(%22touchcancel%22, $state.touchEnd, false);
+App()).HTMLElement);%0A
 %0Afun

clean up main