function Is() {
    agent  = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns    = ((agent.indexOf('mozilla')   !=   -1) &&
                 ((agent.indexOf('spoofer')   ==   -1) &&
                 (agent.indexOf('compatible') ==   -1)));
    this.ns2   = (this.ns && (this.major      ==    3));
    this.ns3   = (this.ns && (this.major      ==    3));
    this.ns4b  = (this.ns && (this.major      ==    4) &&
                 (this.minor                  <= 4.03));
    this.ns4   = (this.ns && (this.major      >=    4));
    this.ns6    = (this.ns && (this.major     >=    5));
    this.ie    = (agent.indexOf("msie")       !=   -1);
    this.ie3   = (this.ie && (this.major      <     4));
    this.ie4   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   ==   -1));
    this.ie5   = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.0")   !=   -1));
    this.ie55  = (this.ie && (this.major      ==    4) &&
                 (agent.indexOf("msie 5.5")   !=   -1));
}

var is = new Is();

if(is.ns4) {
    doc = "document";
    sty = "";
    htm = ".document"
    xpos = "e.pageX";
    ypos = "e.pageY";
} else if(is.ie4 || is.ie5) {
    doc = "document.all";
    sty = ".style";
    htm = ""
    xpos = "event.x";
    ypos = "event.y";
}

function clipValues(top,right,bottom,left,move) {
    this.top = top;
    this.right = right;
    this.bottom = bottom;
    this.left = left;
    this.move = move;
}

function animateValues(layer,array,index) {
    this.layer = layer;
    this.array = array;
    this.index = index;
}

function menuValues(image,pose,url0,url1,url2,info0,info1,info2,info3) {
    this.image = image;
    this.pose = pose;
    this.url0 = url0;
    this.url1 = url1;
    this.url2 = url2;
    this.info0 = info0;
    this.info1 = info1;
    this.info2 = info2;
    this.info3 = info3;
}

var arg = null;
var menuTimer = null;
var solar_system = true;
var reset = false;
var contentHTML = "";

function choreographer(cmd,argument) {
    if(argument != null) {
        arg = argument;
    }
    switch(cmd) {
        case 'layerSetup' :
            starLyr = eval(doc + '["starLayer"]' + sty);
            starLyr.left = available_width;
            starLyr.top = 76;

            planetLyr = eval(doc + '["planetLayer"]' + sty);
            planetLyr.left = -200;
            planetLyr.top = 165;

            iomoonLyr = eval(doc + '["iomoonLayer"]' + sty);
            iomoonLyr.left = available_width;
            iomoonLyr.top = 305;

            contentLyr = eval(doc + '["contentLayer"]' + sty);
            contentLyr.left = 10;
            contentLyr.top = 0;

            isletLyr = eval(doc + '["isletLayer"]' + sty);
            isletLyr.left = available_width-200;
            isletLyr.top = available_height;

            menuoffLyr = eval(doc + '["menuoffLayer"]' + sty);
            menuoffLyr.left = available_width-340;
            menuoffLyr.top = available_height-364;

            menuonLyr = eval(doc + '["menuonLayer"]' + sty);
            menuonLyr.left = available_width-340;
            menuonLyr.top = available_height-364;

            menueventLyr = eval(doc + '["menueventLayer"]' + sty);
            menueventLyr.left = parseInt(menuoffLyr.left)+70;
            menueventLyr.top = parseInt(menuoffLyr.top);

            emailLyr = eval(doc + '["emailLayer"]' + sty);

            coreLyr = eval(doc + '["coreLayer"]' + sty);
            coreLyr.left = parseInt(isletLyr.left)-5;
            coreLyr.top = 0;

            submenuLyr = eval(doc + '["submenuLayer"]' + sty);
            submenuLyr.left = parseInt(coreLyr.left)+80;
            submenuLyr.top = 46;

            guruLyr = eval(doc + '["guruLayer"]' + sty);
            guruLyr.left = parseInt(isletLyr.left)-1080;
            guruLyr.top = (available_height-233)/4;

            forepulseLyr = eval(doc + '["forepulseLayer"]' + sty);
            forepulseLyr.left = available_width-260;
            forepulseLyr.top = available_height+25;

            backpulseLyr = eval(doc + '["backpulseLayer"]' + sty);
            backpulseLyr.left = available_width-260;
            backpulseLyr.top = available_height;

            arrowLyr = eval(doc + '["arrowLayer"]' + sty);
            arrowLyr.left = parseInt(menuonLyr.left)+15
            arrowLyr.top = 40;

            infoLyr = eval(doc + '["infoLayer"]' + sty);
            infoLyr.left = available_width;
            infoLyr.top = available_height-360;

            shieldLyr = eval(doc + '["shieldLayer"]' + sty);

            eventLyr = eval(doc + '["eventLayer"]' + sty);
            eventLyr.left = parseInt(menuonLyr.left)+15
            eventLyr.top = 0;

            choreographer('htmlSetup',null);
            break;

        case 'htmlSetup' :
            starHTML = eval(doc + '["starLayer"]' + '.document');
            planetHTML = eval(doc + '["planetLayer"]' + '.document');
            iomoonHTML = eval(doc + '["iomoonLayer"]' + '.document');
            isletHTML = eval(doc + '["isletLayer"]' + '.document');
            guruHTML = eval(doc + '["guruLayer"]' + '.document');
            menuoffHTML = eval(doc + '["menuoffLayer"]' + '.document');
            menuonHTML = eval(doc + '["menuonLayer"]' + '.document');
            submenuHTML = eval(doc + '["submenuLayer"]' + '.document');
            emailHTML = eval(doc + '["emailLayer"]' + '.document');
            arrowHTML = eval(doc + '["arrowLayer"]' + '.document');
            coreHTML = eval(doc + '["coreLayer"]' + '.document');

            contentHTML = eval(doc + '["contentLayer"]' + htm);
            infoHTML = eval(doc + '["infoLayer"]' + htm);
            eventArea = eval(doc + '["eventLayer"]' + htm);

            choreographer('arraySetup',null);
            break;

        case 'arraySetup' :
            var y_pulse = available_height;
            pulse_y_array = new Array(y_pulse*1,y_pulse*0.95,y_pulse*0.90,y_pulse*0.85,y_pulse*0.80,y_pulse*0.75,y_pulse*0.70,y_pulse*0.65,y_pulse*0.60,y_pulse*0.55,y_pulse*0.50,y_pulse*0.45,y_pulse*0.40,y_pulse*0.35,y_pulse*0.30,y_pulse*0.25,y_pulse*0.20,y_pulse*0.15,y_pulse*0.10,y_pulse*0.05,y_pulse+50,available_height);

            var x_pulse = parseInt(forepulseLyr.left)
            pulse_x_array = new Array(x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,x_pulse,available_width);

            eventArray = new Array();
            eventArray[0] = new clipValues(0,60,available_height,0,null);

            contentclipArray = new Array();
            contentclipArray[0] = new clipValues(0,300,available_height-80,0,null);

            dragmeclipArray = new Array();
            dragmeclipArray[0] = new clipValues(0,60,30,0,parseInt(menuonLyr.left)+15);
            dragmeclipArray[1] = new clipValues(0,120,30,60,parseInt(menuonLyr.left)+15-60);

            menuclipArray = new Array();
            menuclipArray[0] = new clipValues(95,74,115,0,null);
            menuclipArray[1] = new clipValues(64,85,86,6,null);
            menuclipArray[2] = new clipValues(39,107,54,28,null);
            menuclipArray[3] = new clipValues(18,135,33,66,null);
            menuclipArray[4] = new clipValues(0,181,15,110,null);

            guruArray = new Array();
            guruArray[0] = new clipValues(0,1245,223,1032,parseInt(isletLyr.left)-1080);
            guruArray[1] = new clipValues(0,1032,223,820,parseInt(isletLyr.left)-867);
            guruArray[2] = new clipValues(0,820,223,656,parseInt(isletLyr.left)-700);
            guruArray[3] = new clipValues(0,656,223,492,parseInt(isletLyr.left)-536);
            guruArray[4] = new clipValues(0,492,223,328,parseInt(isletLyr.left)-372);
            guruArray[5] = new clipValues(0,328,223,164,parseInt(isletLyr.left)-208);
            guruArray[6] = new clipValues(0,164,223,0,parseInt(isletLyr.left)-44);

            coreArray = new Array();
            coreArray[0] = new clipValues(0,112,80,0,parseInt(isletLyr.left)-5);
            coreArray[1] = new clipValues(0,560,80,448,parseInt(isletLyr.left)-453);
            coreArray[2] = new clipValues(0,448,80,336,parseInt(isletLyr.left)-341);
            coreArray[3] = new clipValues(0,336,80,224,parseInt(isletLyr.left)-229);
            coreArray[4] = new clipValues(0,224,80,112,parseInt(isletLyr.left)-117);

            coreArray = new Array();
            coreArray[0] = new clipValues(0,112,80,0,parseInt(isletLyr.left)-5);
            coreArray[1] = new clipValues(0,560,80,448,parseInt(isletLyr.left)-453);
            coreArray[2] = new clipValues(0,448,80,336,parseInt(isletLyr.left)-341);
            coreArray[3] = new clipValues(0,336,80,224,parseInt(isletLyr.left)-229);
            coreArray[4] = new clipValues(0,224,80,112,parseInt(isletLyr.left)-117);

            spinArray = new Array();
            spinArray[0] = new animateValues(coreLyr,coreArray,1);
            spinArray[1] = new animateValues(guruLyr,guruArray,4);
            spinArray[2] = new animateValues(guruLyr,guruArray,5);
            spinArray[3] = new animateValues(guruLyr,guruArray,6);
            spinArray[4] = new animateValues(coreLyr,coreArray,2);
            spinArray[5] = new animateValues(coreLyr,coreArray,3);
            spinArray[6] = new animateValues(coreLyr,coreArray,4);

            menuArray = new Array();
            menuArray[0] = new menuValues(
                "images/welcome.gif",
                2,
                "content/welcome/welcome.htm",
                "content/welcome/details.htm",
                "content/welcome/email.htm",
                "Whats new with the Guru and other info",
                "A list of DHTML methods keeping the Guru alive",
                "Chat with the DHTML Guru Author: Jeff Rouyer",
                "Select to close the Guru window and get some work done"
            );
            menuArray[1] = new menuValues(
                "images/reference.gif",
                3,
                "content/reference/reference.htm",
                "content/reference/bookreview.htm",
                "content/reference/mybooks.htm",
                "Some help in finding good reference materials",
                "A suggesed reading list to help you get started",
                "Books that contain my bent on DHTML Web design",
                "Select to close the Guru window and get some work done"
            );
            menuArray[2] = new menuValues(
                "images/tutorials.gif",
                4,
                "content/tutorials/tutorials.htm",
                "content/tutorials/source.htm",
                "content/tutorials/templates.htm",
                "Access DHTML tutorials, templates and source code",
                "Snag the source code that runs this whole show",
                "Build your own sites with the expanding template library",
                "Select to close the Guru window and get some work done"
            );
            menuArray[3] = new menuValues(
                "images/threads.gif",
                5,
                "content/threads/threads.htm",
                "content/threads/techwatch.htm",
                "content/threads/newsletter.htm",
                "Distilled resource listings and a fish eye on technology",
                "Keeping tabs on DHTML related technology",
                "View the Pure Guru newsletter and join the mailing list",
                "Select to close the Guru window and get some work done"
            );
            menuArray[4] = new menuValues(
                "images/nirvana.gif",
                6,
                "content/nirvana/nirvana.htm",
                "content/nirvana/skillswatch.htm",
                "content/nirvana/sitetips.htm",
                "Development tips and feedback on your DHTML site",
                "Keeping an eye on DHTML skills you should posses",
                "Browse a compilation of DHTML development tips",
                "Select to close the Guru window and get some work done"
            );

            choreographer('eventSetup',null);
            break;

        case 'eventSetup' :
            eventArea.onmousemove = mouseMove;
            eventArea.onmousedown = mouseDown;
            eventArea.onmouseup = mouseUp;
            if(is.ns4) {
                eventArea.captureEvents(Event.MOUSEMOVE || Event.MOUSEDOWN || Event.MOUSEUP);
            }
            clipLayer(eventLyr,eventArray,0);
            choreographer('start',null);
            break;

        case 'start' :
            if(reset) {
                guruHTML.guru.src = "images/guru.gif";
            } else {
                guruHTML.guru.src = "images/guru.gif";
                clipLayer(guruLyr,guruArray,0);
                clipLayer(menuonLyr,menuclipArray,0);
                forepulseLyr.visibility = 'visible';
                backpulseLyr.visibility = 'visible';
                pathAnimator(forepulseLyr,'pulse',0,-25,'pulse',null);
                setTimeout("choreographer('preLoad',null)",1000);
            }
            break;

        case 'pulse' :
            if(count != 11) {
                pathAnimator(forepulseLyr,'pulse',0,-25,'pulse',null);
            } else {
                forepulseLyr.visibility = 'hidden';
                backpulseLyr.visibility = 'hidden';
                setTimeout("contentLyr.visibility='hidden';",1500);
                isletLyr.visibility = 'visible';
                clipLayer(guruLyr,guruArray,1);
                choreographer('islet',null);
            }
            break;

        case 'preLoad' :
            blankImg = new Image();
            blankImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            blankImg.src = "images/blank.gif";

            coreImg = new Image();
            coreImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            coreImg.src = "images/core.gif";

            planetImg = new Image();
            planetImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            planetImg.src = "images/planet.gif";

            isletImg = new Image();
            isletImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            isletImg.src = "images/islet.gif";

            menuoffImg = new Image();
            menuoffImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            menuoffImg.src = "images/menu_off.gif";

            menuonImg = new Image();
            menuonImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            menuonImg.src = "images/menu_on.gif";

            bubbleImg = new Image();
            bubbleImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            bubbleImg.src = "images/bubble.gif";

            emailImg = new Image();
            emailImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            emailImg.src = "images/email.gif";

            dragmeImg = new Image();
            dragmeImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            dragmeImg.src = "images/drag_me.gif";

            btnupImg = new Image();
            btnupImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            btnupImg.src = "images/btn_up.gif";

            btndnImg = new Image();
            btndnImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
            btndnImg.src = "images/btn_dn.gif";
            break;

        case 'setImages' :
            planetHTML.planet.src = planetImg.src;
            isletHTML.islet.src = isletImg.src;
            menuoffHTML.menuoff.src = menuoffImg.src;
            menuonHTML.menuon.src = menuonImg.src;
            coreHTML.core.src = coreImg.src;
            arrowHTML.arrow.src = dragmeImg.src;
            break;

        case 'islet' :
            if(parseInt(isletLyr.top) > parseInt(guruLyr.top)+152) {
                isletLyr.top = parseInt(isletLyr.top) + -21;
                setTimeout("choreographer('islet',null)",1);
            } else {
                clipLayer(guruLyr,guruArray,2);
                setTimeout("clipLayer(guruLyr,guruArray,3)",50);
                setTimeout("clipLayer(guruLyr,guruArray,4)",100);
                setTimeout("clipLayer(guruLyr,guruArray,5)",150);
                setTimeout("clipLayer(guruLyr,guruArray,6)",200);
                isletLyr.top = parseInt(guruLyr.top)+142;
                clipLayer(coreLyr,coreArray,0);
                coreLyr.visibility = 'visible';
                choreographer('core',null);
            }
            break;

        case 'core' :
            if(parseInt(coreLyr.top) < parseInt(guruLyr.top)-58) {
                coreLyr.top = parseInt(coreLyr.top) + 2;
                setTimeout("choreographer('core',null)",1);
            } else {
                starLyr.visibility = 'visible';
                planetLyr.visibility = 'visible';
                iomoonLyr.visibility = 'visible';
                choreographer('planet',null);
            }
            break;

        case 'planet' :
            if(parseInt(isletLyr.top) < available_height-180) {
                isletLyr.top = parseInt(isletLyr.top) + 2;
                guruLyr.top = parseInt(guruLyr.top) + 2;
                coreLyr.top = parseInt(coreLyr.top) + 2;
                if(parseInt(planetLyr.left) < 0) {
                    planetLyr.left = parseInt(planetLyr.left) + 2;
                }
                setTimeout("choreographer('planet',null)",1);
            } else {
                if(parseInt(planetLyr.left) < 0) {
                    planetLyr.left = parseInt(planetLyr.left) + 1;
                    setTimeout("choreographer('planet',null)",1);
                } else {
                    emailLyr.left = parseInt(isletLyr.left)+127;
                    emailLyr.top = parseInt(isletLyr.top)+8;
                    emailLyr.visibility = 'visible';
                    choreographer('bloom',null);
                }
            }
            break;

        case 'bloom' :
            if(parseInt(coreLyr.top) > 20) {
                coreLyr.top = parseInt(coreLyr.top) - 6;
                setTimeout("choreographer('bloom',null)",1);
            } else {
                infoLyr.visibility = 'visible';
                loadPage(0,0);
            }
            break;

        case 'spin_guru' :
            contentLyr.visibility = 'hidden';
            eventLyr.visibility = 'hidden';
            arrowLyr.visibility = 'hidden';
            submenuLyr.visibility = 'hidden';
            menueventLyr.visibility = 'hidden';
            menuoffLyr.visibility = 'hidden';
            submenuHTML.submenu.src = menuArray[selected_index].image;
            rotation = true;
            spinGuru();
            break;

        case 'parallax' :
            if(parseInt(planetLyr.left) > 50) {
                if(solar_system) {
                    starHTML.star.src = "images/star.jpg";
                    iomoonHTML.iomoon.src = "images/iomoon.gif";
                    solar_system = false;
                }
                starLyr.left = parseInt(starLyr.left) - 1;
                iomoonLyr.left = parseInt(iomoonLyr.left) - 2;
            }
            if(parseInt(starLyr.left) < -150 && parseInt(planetLyr.left) > available_width) {
                starLyr.left = available_width;
                planetLyr.left = -198;
                iomoonLyr.left = available_width;
            }
            planetLyr.left = parseInt(planetLyr.left) + 1;
            break;

        case 'pulse_align' :
            backpulseLyr.top = parseInt(forepulseLyr.top)-25;
            break;

        case 'finished_loading' :
            if(is.ie4 || is.ie5) {
                choreographer('writeContent',document.all.ieContent.document.frames['ieframe'].document.body.innerHTML);
            }
            setTimeout("choreographer('reset_guru')",2500);
            break;

        case 'writeContent' :
            if(is.ns4) {
                contentHTML.write(arg);
                contentHTML.close();
            } else {
                contentHTML.innerHTML = arg;
            }
            break;

        case 'displayInfo' :
            var info = '<TABLE BACKGROUND="images/bubble.gif" BORDER="0" CELLPADDING="14" CELLSPACING="0" WIDTH="108" HEIGHT="100"><TR><TD VALIGN=TOP ALIGN=CENTER><FONT CLASS=info>'+ arg +'</FONT></TD></TR></TABLE>';
            if(is.ns4) {
                infoHTML.write(info);
                infoHTML.close();
            } else {
                infoHTML.innerHTML = info;
            }
            infoLyr.left = available_width-120;
            break;

        case 'set_main' :
            clearTimeout(menuTimer);
            clipLayer(guruLyr,guruArray,(arg+2));
            clipLayer(coreLyr,coreArray,0);
            clipLayer(menuonLyr,menuclipArray,arg);
            choreographer('displayInfo',menuArray[arg].info0);
            break;

        case 'reset_main' :
            infoLyr.left = available_width;
            menuTimer = setTimeout("clipLayer(menuonLyr,menuclipArray,selected_index);clipLayer(guruLyr,guruArray,(selected_index+2))",2000);
            break;

        case 'set_sub' :
            clipLayer(coreLyr,coreArray,(arg+1));
            choreographer('displayInfo',eval("menuArray[selected_index].info" + arg));
            break;

        case 'reset_sub' :
            infoLyr.left=available_width;
            break;

        case 'reset_guru' :
            rotation = false;
            drag = false;
            clearTimeout(spinTimer);
            contentLyr.visibility = 'visible';
            contentLyr.top = 20;
            menuonLyr.visibility = 'visible';
            menuoffLyr.visibility = 'visible';
            submenuLyr.visibility = 'visible';
            arrowLyr.visibility = 'visible';
            arrowLyr.top = 40;
            clipLayer(guruLyr,guruArray,menuArray[selected_index].pose);
            clipLayer(menuonLyr,menuclipArray,selected_index);
            clipLayer(coreLyr,coreArray,0);
            menueventLyr.visibility = 'visible';
            eventLyr.visibility = 'visible';
            if(selected_index == 0) {
                choreographer('displayInfo','Use the Drag Me icon or [A,Z,S] keys to scroll.');
                setTimeout('arrowLyr.visibility="hidden"' ,500);
                setTimeout('arrowLyr.visibility="visible"',1000);
                setTimeout('arrowLyr.visibility="hidden"' ,1500);
                setTimeout('arrowLyr.visibility="visible"',2000);
                setTimeout('arrowLyr.visibility="hidden"' ,2500);
                setTimeout('arrowLyr.visibility="visible"',3000);
                setTimeout('arrowLyr.visibility="hidden"' ,3500);
                setTimeout('arrowLyr.visibility="visible"',4000);
                setTimeout('arrowLyr.visibility="hidden"' ,4500);
                setTimeout('arrowLyr.visibility="visible"',5000);
            } else {
                choreographer('displayInfo','Excellent - your page has arrived');
                setTimeout('infoLyr.left=available_width',2400);
            }
            break;

        case 'page_reset' :
            reset = true;
            menuoffLyr.left = available_width-340;
            menuoffLyr.top = available_height-364;
            menuonLyr.left = available_width-340;
            menuonLyr.top = available_height-364;
            infoLyr.left = available_width;
            infoLyr.top = available_height-360;
            isletLyr.left = available_width-200;
            isletLyr.top = available_height-180;
            menueventLyr.left = parseInt(menuoffLyr.left)+70;
            menueventLyr.top = parseInt(menuoffLyr.top);
            eventLyr.left = parseInt(menuonLyr.left)+15
            eventLyr.top = 0;
            arrowLyr.left = parseInt(menuonLyr.left)+15
            arrowLyr.top = 40;
            emailLyr.left = parseInt(isletLyr.left)+127;
            emailLyr.top = parseInt(isletLyr.top)+8;
            guruLyr.left = parseInt(isletLyr.left)-700;
            guruLyr.top = parseInt(isletLyr.top)-144;
            coreLyr.left = parseInt(isletLyr.left)-5;
            coreLyr.top = 20;
            submenuLyr.left = parseInt(coreLyr.left)+80;
            submenuLyr.top = 46;
            choreographer('arraySetup',null);
            clipLayer(coreLyr,coreArray,0);
            clipLayer(guruLyr,guruArray,selected_index+2);
            choreographer('setImages',null);
            submenuHTML.submenu.src = menuArray[selected_index].image;
            var page_width = (available_width-340 > 340) ? available_width-340: 340;
            if(is.ie4 || is.ie5) {
                contentLyr.width = page_width;
            } else if(is.ns4) {
                contentLyr.load(eval("menuArray[selected_index].url" + selected_url),page_width);
            }
            break;
    }
}

var count = 0;
var lagTimer = null;

function loadCheck() {
    count++;
    var percent = (count/11)*100;
    var msg = '<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=4 WIDTH=320 HEIGHT=20><TR><TD WIDTH=' + Math.round(percent) + '%  ALIGN=RIGHT>' + '<FONT class="status">' + Math.round(percent) + '% </FONT>' +'</TD><TD></TD></TR></TABLE>';
    if(count == 11) {
        clearTimeout(lagTimer);
        choreographer('writeContent','<FONT CLASS=title>I see it!</FONT><BR>' + msg + '');
        infoLyr.left = available_width;
        infoLyr.top = available_height-360;
        choreographer('setImages',null);
    } else {
        choreographer('writeContent','<FONT CLASS=title>' + (11-count) + ',000 meters to landing zone</FONT><BR>' + msg + '');
        if(count == 9) {
            lagTimer = setTimeout("lagManager()",10000);
        }
    }
}

var lag_time = 30;

function lagManager() {
    if(lag_time > 0) {
        var msg = '<FONT CLASS=lag>(Page will reload in ' + lag_time + ' seconds if server timed out on you)</FONT>';
        infoLyr.left = 50;
        infoLyr.top = 70;
        if(is.ns4) {
            infoHTML.write(msg);
            infoHTML.close();
        } else {
            infoHTML.innerHTML = msg;
        }
        lag_time--;
        lagTimer = setTimeout("lagManager()",1000)
    } else {
        lag_time = 30
        clearTimeout(lagTimer);
        choreographer('writeContent','<FONT CLASS=title>Freaking Server Lag - Trying Again</FONT>');
        setTimeout("history.go(0)",1000);
    }
}

var spinTimer = null;
var rotation = true;
var spin_index = 0;

function spinGuru() {
    if(rotation) {
        choreographer('parallax',null);
        if(spin_index < 7) {
            clipLayer(spinArray[spin_index].layer,spinArray[spin_index].array,spinArray[spin_index].index);
            spin_index++;
            spinTimer = setTimeout("spinGuru()",150);
        } else {
            spin_index = 0;
            spinTimer = setTimeout("spinGuru()",150);
        }
    }
}

function keyDown(e) {
    var key_press = (is.ns4) ? e.which : window.event.keyCode;
    if(key_press == 97 || key_press == 65 || key_press == 56 || key_press == 57 || key_press == 38) {
        pageScroll(true);
    }
    if(key_press == 122 || key_press == 90 || key_press == 32 || key_press == 50 || key_press == 51 || key_press == 40) {
        pageScroll(false);
    }
    if(key_press == 115 || key_press == 83 || key_press == 55) {
        contentLyr.top = 20;
    }
    if(key_press == 49) {
        contentLyr.top = -(page_height-20);
    }
}

var direction = true;
var scrollTimer = null;
var scroll_dist = 0;

function pageScroll(dir) {
    direction = dir;
    if(scroll_dist < 40) {
        if(direction) {
            contentLyr.top = parseInt(contentLyr.top)+4;
        } else if(!direction) {
            contentLyr.top = parseInt(contentLyr.top)-4;
        }
        scroll_dist++;
        scrollTimer = setTimeout("pageScroll(direction)",1);
    } else {
        scroll_dist = 0;
    }
}

var page_height = null;
var drag        = false;

function mouseMove(e) {
    mouse_y = eval(ypos);
    mouse_x = eval(xpos);
    page_height = (is.ns4) ? contentHTML.height : contentHTML.clientHeight;
    if(drag && mouse_y > 15 && mouse_y < (available_height-15) && mouse_x >= (parseInt(arrowLyr.left)+10)) {
      contentLyr.top = page_height * -(mouse_y/available_height)+20;
      choreographer('parallax',null);
      arrowLyr.top = mouse_y - 10;
    } else {
      drag = false;
    }
}

function mouseDown(e) {
    shieldLyr.visibility = "visible";
    if(mouse_y > parseInt(arrowLyr.top) && mouse_y < parseInt(arrowLyr.top)+30) {
        drag = true;
        clipLayer(arrowLyr,dragmeclipArray,1);
        choreographer('displayInfo','Excellent Grasshopper! - Now move Up or Down');
    }
}

function mouseUp(e) {
    shieldLyr.visibility = "hidden";
    drag = false;
    clipLayer(arrowLyr,dragmeclipArray,0);
    infoLyr.left = available_width;
}


var path_index = 0;
var path_layer = null;
var path_array = null;
var x_mod = null;
var y_mod = null;
var delay = 1;
var return_cmd = null;
var return_arg = null;
var pathTimer = null;

function pathAnimator(layer,array,xmod,ymod,cmd,arg) {
    path_layer = layer;
    path_array = array;
    x_mod = xmod;
    y_mod = ymod;
    return_cmd = cmd;
    return_arg = arg;
    var path_x_array = eval(path_array + "_x_array");
    var path_y_array = eval(path_array + "_y_array");
    if(path_index < path_x_array.length-1) {
        if(path_x_array[path_x_array.length-1] != null) {
            path_layer.left = (path_x_array[path_index]/path_x_array[path_x_array.length-1] * available_width) + x_mod;
            path_layer.top = (path_y_array[path_index]/path_y_array[path_y_array.length-1] * available_height) + y_mod;
        } else {
            path_layer.left = (path_x_array[path_index] + x_mod);
            path_layer.top = (path_y_array[path_index] + y_mod);
        }
        if(path_layer == forepulseLyr)  {
            choreographer('pulse_align',null);
        }
        if(path_layer == contentLyr)  {
            choreographer('parallax',null);
        }
        path_index++;
        pathTimer = setTimeout("pathAnimator(path_layer,path_array,x_mod,y_mod,return_cmd,return_arg)",delay);
    } else {
        path_index = 0;
        if(return_cmd != null) {
            choreographer(return_cmd,return_arg);
        }
    }
}

function clipLayer(layer,array,index) {
    var cTop = array[index].top;
    var cRight = array[index].right;
    var cBottom = array[index].bottom;
    var cLeft = array[index].left;
    if(array[index].move != null) {
        layer.left = array[index].move;
    }
    if(is.ns4) {
        layer.clip.top = cTop;
        layer.clip.right = cRight;
        layer.clip.bottom = cBottom;
        layer.clip.left =  cLeft;
    } else {
        layer.clip = 'rect(' + cTop + ' ' + cRight + ' ' + cBottom + ' ' + cLeft + ')';
    }
    if(is.ns4) {
        layer.clip.top = cTop;
        layer.clip.right = cRight;
        layer.clip.bottom = cBottom;
        layer.clip.left =  cLeft;
    } else {
        layer.clip = 'rect(' + cTop + ' ' + cRight + ' ' + cBottom + ' ' + cLeft + ')';
    }
}

var selected_index = 0;
var selected_url = 0;
var resetTimer = null;

function loadPage(menu_index,url_index) {
    selected_index = menu_index;
    selected_url = url_index;
    choreographer('spin_guru',null);
    choreographer('displayInfo','I am summoning your page');
    var page_width = (available_width-340);
    if(is.ie4 || is.ie5) {
        contentLyr.width = page_width;
        document.all.ieContent.document.frames["ieframe"].document.location.href = eval("menuArray[selected_index].url" + selected_url);
    } else if(is.ns4) {
        contentLyr.load(eval("menuArray[selected_index].url" + selected_url),page_width);
    }
}

var displayWindow = null;

function displayTutorial(width,height,url,menu,scroll) {
    var window_width = width;
    var window_height = height;
    var window_top = (screen.height-window_height)/2;
    var window_left = (screen.width-window_width)/2;
    displayWindow = window.open(''+ url + '','display','resizable=yes,menubar=' + menu + ',scrollbars=' + scroll + ',width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
    displayWindow.focus();
}

var jimWindow = null;

function openJim() {
  if(screen.height <= 600) {
    var window_width = screen.width-12;
    var window_height = screen.height-12;
  } else {
    var window_width = 800;
    var window_height = 600;
  }
  if(is.ie4 || is.ie5 || is.ie55) {
    var window_left = (screen.width - 800) / 2;
    var window_top = (screen.height - 600) / 2;
    jimWindow = window.open('http://nirvana.media3.net/jim/jim_stage.htm','JIM','resizable=yes,status=yes,width=' + window_width + ',height=' + window_height
    + ',top=' + window_top + ',left=' + window_left + '');
  } else {
    alert('Note: Attempts to make the site compatible with Netscape 4.x ran into a stumbling block due to the fact that this browser doesn\'t support the transparent overlay of plugins with DHTML layers which is essential for the two to work together in this design.  So for now, it is restricted to Explorer 4/5, Flash 4 plus the Media Player Plugin.');
  }
}