var collKey;
var currentmenu, currentPressThumb, collScrollPos, collScrollMin = 112, collScrollMax, collImgW = 269;
currentmenu = 'home';
var isPlaying;
function init() {
initDHTMLAPI();
loadFlag=true;
}
function menu(which) {
which = which.id.substring(5);
//disable current menu, enable others
getRawObject(which).innerHTML = '';
getRawObject(currentmenu).innerHTML = '';
changeClass(which,"here");
changeClass(currentmenu,"");
//page exit handling
switch(currentmenu) {
case "bio":
clearTimeout(bioTimer);
break;
}
currentmenu = which;
//case by case div repositioning
//defaults
x = 20;
y = 113;
switch(which) {
case "contact":
x = 107;
y = 94;
break;
}
getRawObject('maincontent').style.display = "none";
getRawObject('maincontent').style.left = x + "px";
getRawObject('maincontent').style.top = y + "px";
//load innerHTML
theURL = 'pages/' + which + '.php';
makeHttpRequest(theURL, 'showContent', false);
}
function showBioVid() {
makeHttpRequest('pages/bio_video.php', 'showContent', false);
getRawObject(currentmenu).innerHTML = '';
clearTimeout(bioTimer);
changeClass(currentmenu,"");
}
function showContent(theHTML) {//called after page content loads
var obj = getRawObject('maincontent');
obj.style.display = "block";
obj.innerHTML = theHTML;
mudBlur();
switch(currentmenu) {
case "bio":
if (getRawObject('slideDiv0') != null) {
initBioSlideshow();
}
if (getRawObject('player') != null) {
isPlaying = false;
var so = new SWFObject('/includes/player.swf','bio_vid','532','399','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','false');
so.addParam('flashvars','&file=/images/bio/Elijah_bio.flv&controlbar=none&autostart=true&caption=false');
so.write('player');
}
break;
case "press":
pressScroll = new jb_scroller('press', 407, 305, 460, 0, 0); // id, width, height, speed, initLeft, initTop
pressScroll.load();
break;
case "stores":
if (getRawObject('stateSCContent') != null) {//
if (getRawObject('stateSCContent').offsetHeight > 420) {//make scrollers
stateScroll = new jb_scroller('state', 84, 420, 150, 0, 0); // id, width, height, speed, initLeft, initTop
stateScroll.load();
setDisplay('stateScrollup');
setDisplay('stateScrolldown');
}
}
if (getRawObject('storeSCContent') != null) {
if (getRawObject('storeSCContent').offsetHeight > 420) {//make scrollers
storeScroll = new jb_scroller('store', 168, 420, 150, 0, 0); // id, width, height, speed, initLeft, initTop
storeScroll.load();
setDisplay('storeScrollup');
setDisplay('storeScrolldown');
}
}
break;
case "collections":
getRawObject('collCurtainL').innerHTML = '
';
collScrollPos = collScrollMin;
collScroll = new jb_scroller('coll', 819, 339, 460, collScrollPos, 0); // id, width, height, speed, initLeft, initTop
collScrollMax = getRawObject('collHolder').offsetWidth - (4 * collImgW - collScrollMin);
collScroll.load();
break;
}
}
function switchColl(which) {
theURL = 'pages/collections.php?coll=' + which;
makeHttpRequest(theURL, 'showContent', false);
}
function scrollColl(offset) {
collScrollPos += offset * collImgW;
if (collScrollPos == collScrollMin + collImgW) {
getRawObject('collCurtainL').innerHTML = '
';
} else if (collScrollPos == collScrollMin) {
getRawObject('collCurtainL').innerHTML = '
';
}
if (collScrollPos == collScrollMax - collImgW) {
getRawObject('collCurtainR').innerHTML = '
';
} else if (collScrollPos == collScrollMax) {
getRawObject('collCurtainR').innerHTML = '
';
}
collScroll.smoothScrollTo(collScrollPos,0,.4);
}
function switchPress(which) {
//init variable from div
if (typeof(currentPressThumb) == "undefined") {
currentPressThumb = getRawObject('currentPressThumb').innerHTML;
}
changeImages('pressthumb' + currentPressThumb, '/images/press/thumb_off/' + currentPressThumb + '.jpg');
changeImages('pressthumb' + which, '/images/press/thumb_on/' + which + '.jpg');
currentPressThumb = which;
}
function pressMulti(which,prKey,pressNum,pressCount) {
changeImages('pr' + prKey, '/images/press/resized/' + pressNum + '.jpg');
for (i=1;i';
}
}
//BIO SLIDESHOW
imgArr = new Array(13, 14, 15, 16, 17, 18, 19);
var bioCurrentLoading = 0;
var currentAnim = 1;
var bioTimer, bioFader;
var animTime = 6000;//milliseconds, minimum time between fades (but it'll be slower if the images load slowly)
function initBioSlideshow() {
setDisplay('slideDiv0');
setOpacity(getRawObject('slideDiv0'), 100);
currentAnim = 1;
loadImg(1);
bioTimer = setTimeout("anim(currentAnim)",animTime);
}
function loadImg(which) {
if (!loadFlag) { return; }
bioCurrentLoading = which;
eval("getRawObject('slide" + which + "').onload = callback");
eval("getRawObject('slide" + which + '\').src = "../images/bio/resized/' + imgArr[which] + '.jpg"');
}
function callback() {
if (bioCurrentLoading < imgArr.length - 1) {
loadImg(bioCurrentLoading + 1);
} else {
return;
}
}
function anim(which) {
if (which >= imgArr.length) {
//reset animation
setDisplay('slideDiv0');
bioFader = new jb_fader('bioFader', 'slideDiv0', '', 0, 100, 55, "unsetDisplay('slideDiv" + (which-1) + "');");
bioFader.init();
currentAnim = 1;
bioTimer = setTimeout("anim(1)",animTime);
return;
} else if (which > bioCurrentLoading) { // next image hasn't loaded yet
bioTimer = setTimeout("anim(currentAnim)",1000);//check again in a sec
return;
}
//we have to set and unset the display because safari bogs down with too many transparent objects
setDisplay('slideDiv' + which);
bioFader = new jb_fader('bioFader', 'slideDiv' + (which-1), '', 100, 0, 55, "unsetDisplay('slideDiv" + (which-1) + "');setOpacity(getRawObject('slideDiv" + (which-1) + "'), 100)");
bioFader.init();
currentAnim++;
bioTimer = setTimeout("anim(currentAnim)",animTime);
}
//Flash mediaplayer control 2
function playpauseVid() {
if (isPlaying) {
bio_vid.sendEvent('PLAY','false');
isPlaying = false;
changeImages('playpause', '/images/vid_play.gif');
} else {
bio_vid.sendEvent('PLAY','true');
isPlaying = true;
changeImages('playpause', '/images/vid_pause.gif');
}
}
function rewVid() {
bio_vid.sendEvent('STOP');
}
function playerReady(obj) {
var id = obj['id'];
var version = obj['version'];
var client = obj['client'];
var player = getPlayer('bio_vid');
isPlaying = true;
player.addControllerListener("PLAY","playTracker");
player.addControllerListener("STOP","stopTracker");
};
function getPlayer(gid) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[gid];
} else {
return document[gid];
}
};
function playTracker(obj) {
if (obj.state) {
isPlaying = true;
changeImages('playpause', '/images/vid_pause.gif');
} else {
isPlaying = false;
changeImages('playpause', '/images/vid_play.gif');
}
}
function stopTracker(obj) {
isPlaying = false;
changeImages('playpause', '/images/vid_play.gif');
}