ウインドウをフルスクリーン表示する

特定のclass名が設定されたa要素をクリックしたときに新しいウインドウをフルスクリーンで表示するスクリプト

function fullscreen(targetClassName){
    if(!targetClassName){
        return false;
    }

    var anchor;
    var anchors = document.getElementsByTagName("a");

    for(var i=0; anchor=anchors[i]; i++){
        if(anchor.className.indexOf(targetClassName) != -1){
            MyLib.event.observe(anchor, "click", function(event){
                var width = window.screen.availWidth
                var height = window.screen.availHeight;

                window.open(this.href, "fullscreen", "width=" + width + ", height=" + height + ", top=0, left=0, status=no, location=no").focus();

                MyLib.event.stop(event);
            }, false);
        }
    }
}