// FREEFALL GURU INTERFACE VERSION 2.0 - Jeff Rouyer (c) 1998
////////////////////////////////////////////////////////////////////
// //
// BROWSER SNIFFER & DOCUMENT OBJECT SWITCH //
// ------------------------------------------------------------- //
// Detects visiting browsers and set browser specific variables //
// used for builing cross-browser DHTML routines //
// //
////////////////////////////////////////////////////////////////////
function Is() {
var 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 == 2));
this.ns3 = (this.ns && (this.major == 3));
this.ns4b = (this.ns && (this.minor < 4.04));
this.ns4 = (this.ns && (this.major >= 4));
this.ie = (agent.indexOf("msie") != -1);
this.ie3 = (this.ie && (this.major == 2));
this.ie4 = (this.ie && (this.major >= 4));
this.op3 = (agent.indexOf("opera") != -1);
}
var is = new Is();
if(is.ns4) {
doc = "document";
sty = "";
htm = ".document"
xpos = "e.pageX";
ypos = "e.pageY";
} else if(is.ie4) {
doc = "document.all";
sty = ".style";
htm = ""
xpos = "event.x";
ypos = "event.y";
}
////////////////////////////////////////////////////////////////////
// //
// GURU CHOREOGRAPHER //
// ------------------------------------------------------------- //
// This bad boy is the main switching function that organizes //
// and controls all the page setup routines, animation, and //
// interface behaviors. The first set of functions are //
// constructors that support the Choreographer. //
// //
////////////////////////////////////////////////////////////////////
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 count = 0;
var lagTimer = null;
function loadCheck() {
count++;
if(count == 11) {
clearTimeout(lagTimer);
choreographer('writeContent','I see it!');
infoLyr.left = available_width;
infoLyr.top = available_height-360;
choreographer('setImages',null);
} else {
choreographer('writeContent','' + (11-count) + ',000 meters to landing zone');
if(count == 9) {
lagTimer = setTimeout("lagManager()",10000);
}
}
}
var arg = null;
var menuTimer = null;
var solar_system = true;
var reset = false;
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;
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,49,available_height,0,null);
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/sponsors.htm",
"What's new with the Guru and other info",
"A list of DHTML methods keeping the Guru alive",
"These folks help out with development costs",
"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)",7000);
}
break;
case 'pulse' :
if(count != 11) {
pathAnimator(forepulseLyr,'pulse',0,-25,'pulse',null);
} else {
forepulseLyr.visibility = 'hidden';
backpulseLyr.visibility = 'hidden';
contentLyr.visibility = 'hidden';
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";
arrowdragImg = new Image();
arrowdragImg.onload = (is.ns4b) ? loadCheck() : loadCheck;
arrowdragImg.src = "images/arrow_drag.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 = arrowdragImg.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) {
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 = '';
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';
clipLayer(guruLyr,guruArray,menuArray[selected_index].pose);
clipLayer(menuonLyr,menuclipArray,selected_index);
clipLayer(coreLyr,coreArray,0);
menueventLyr.visibility = 'visible';
eventLyr.visibility = 'visible';
choreographer('displayInfo','Master - your page has humbly 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);
if(is.ie4) {
contentLyr.width = page_width;
} else if(is.ns4) {
contentLyr.load(eval("menuArray[selected_index].url" + selected_url),page_width);
}
break;
}
}
var lag_time = 30;
function lagManager() {
if(lag_time > 0) {
var msg = '(Page will reload in ' + lag_time + ' seconds if server timed out on you)';
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','Freaking Server Lag - Trying Again');
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);
}
}
}
// WHAT TO DO WHEN SOME KEYS ARE PRESSED (for use with page scroller)
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) {
pageScroll(true);
}
if(key_press == 122 || key_press == 90 || key_press == 32 || key_press == 50 || key_press == 51) {
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 page_height = null;
// WHAT TO DO WHEN THE MOUSE MOVES (for use with page scroller)
var mouse_y = 0;
function mouseMove(e) {
mouse_y = eval(ypos);
if(drag) {
if(mouse_y > 5 && mouse_y < available_height-10) {
contentLyr.top = page_height * -(mouse_y/available_height)+20;
choreographer('parallax',null);
arrowLyr.top = mouse_y - 10;
}
}
}
// WHAT TO DO WHEN THE MOUSE IS PRESSED (for use with page scroller)
var drag = false;
function mouseDown(e) {
page_height = (is.ns4) ? contentHTML.height : contentHTML.document.spacer.height;
if(mouse_y > parseInt(arrowLyr.top) && mouse_y < parseInt(arrowLyr.top)+30) {
drag = true;
}
}
// WHAT TO DO WHEN THE MOUSE IS RELEASED (for use with page scroller)
function mouseUp(e) {
drag = false;
}
// PATH ANIMATOR (For controlling the path of moving things)
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','Yes master - I am summoning your page');
var page_width = (available_width-340);
if(is.ie4) {
contentLyr.width = page_width;
var page = document.all.ieContent.document.frames['ieframe'].document;
page.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) {
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=yes,width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + '');
displayWindow.focus();
}