//RESIZE WINDOW window.onError=null //as much as I hate having to do browser-detect like this, NS4 can't size its windows properly var agt=navigator.userAgent.toLowerCase(); var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)); var is_nav4 = (is_nav && (parseInt(navigator.appVersion) == 4)); function sizeMe() { var desiredWidth = 1006; var desiredHeight = 590; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE if (is_nav4) { widthChange = desiredWidth - 15; heightChange = desiredHeight - 15; } else { widthChange = window.outerWidth - window.innerWidth + desiredWidth; heightChange = window.outerHeight - window.innerHeight + desiredHeight; } self.resizeTo(widthChange,heightChange); } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' widthChange = desiredWidth - document.documentElement.clientWidth; heightChange = desiredHeight - document.documentElement.clientHeight; self.resizeBy(widthChange,heightChange); } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible widthChange = desiredWidth - document.body.clientWidth; heightChange = desiredHeight - document.body.clientHeight; self.resizeBy(widthChange,heightChange); } } var viewportwidth; var viewportheight; function getiFrameDims() { // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth, viewportheight = document.documentElement.clientHeight } // older versions of IE else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportheight = document.getElementsByTagName('body')[0].clientHeight } } function initWindow() { sizeMe(); initDHTMLAPI(); loadFlag=true; newsInit(); $('pageloading').hide(); } //HIDE & SHOW FUNCTIONS function show(which) { $(which).setStyle({display:'block'}); } function showDesc(which) { show('desc' + which); } function hideDesc(which) { $('desc' + which).hide(); } //BUSINESSCARD bcards = new Array(); bcardBackFlag = false; //load all bcards for (i=1;i<=6;i++) { bcards[i] = new Image(); bcards[i].src = "images/businesscard_front_" + i + ".gif"; } bcardback = new Image(); bcardback.src = 'images/businesscard_back.gif'; function showBcardBack() { if (!loadFlag) { return; } bcardBackFlag = true; changeImages('bcard', 'images/businesscard_back.gif'); show('bcard_back'); showBcardDesc(); } function showBcardFront() { if (!bcardBackFlag) { return; } if (!loadFlag) { return; } bcardBackFlag = false; changeImages('bcard', 'images/businesscard_front_' + (Math.floor(Math.random()*6) + 1) + '.gif'); $('bcard_back').hide(); hideBcardDesc(); } function hideBcardDesc() { // if (shelf_frame.currentpnum != -1) { this don't work in Firefox if (parent.frames[0].currentpnum != -1) { showDesc(parent.frames[0].currentpnum); } $('desc_bcard').hide(); } function showBcardDesc() { if (parent.frames[0].currentpnum != -1) { hideDesc(parent.frames[0].currentpnum); } show('desc_bcard'); } ie = false; ie8 = false; //IFRAME JS function initIframe() { initDHTMLAPI(); loadFlag=true; showShadows(); beginAnim(); } //HIDE & SHOW FUNCTIONS function loadImg(which, whichBig) { stopQuote(); if (itemtype[which] == 'video') { showBig(which, whichBig); showVid(which); currentvid = which; return; } hideVid(); if (loggedin && getObject('dogear_' + which + '_1')) { if (itemtype[which] == 'prod') { location.href = 'images/download_jpgs/' + imgNames[which] + '.zip'; } else { location.href = 'images/download_pdfs/' + imgNames[which] + '.zip'; } return; } if (currentLoading == which) { return; }//if user's impatient and clicks repeatedly if (!loadFlag) { return; } currentLoading = which; currentProdnum = whichBig; if (numimgs[which] + numthumbs[which] - 1 == imgLoaded[which]) { showBig(which, whichBig); currentLoading = -1; return; } getRawObject('imgloading').innerHTML = 'Loading 1 of ' + numimgs[which] + '...'; showLayer('imgloading'); imgLoaded[which] = 0; mainImgCounter = 0; for (i=1;i<=numimgs[which];i++) { eval("getRawObject('mainimg" + which + '_' + i + "').onload = callback"); eval("getRawObject('mainimg" + which + '_' + i + '\').src = "images/products/' + imgNames[which] + '_' + i + '.jpg"'); } for (i=1;i<=numthumbs[which];i++) { eval("getRawObject('thumbimg" + which + '_' + i + "').onload = callback"); eval("getRawObject('thumbimg" + which + '_' + i + '\').src = "images/products/' + imgNames[which] + '_tn_' + i + '.jpg"'); } } function showBig(pnum, pimg) { parent.showBcardFront(); hideLayer('imgloading'); if (currentpnum >= 0) { shrinkToThumb(); } parent.showDesc(pnum); currentpnum = pnum; currentpimg = pimg; imgcount = 0;//reset image counter if (f_scrollLeft() >= imgpos[pnum] || itemtype[pnum] == 'video') { getObject('main' + pnum + '_' + pimg).left = f_scrollLeft() + 'px'; getObject('mainshadow' + pnum).left = (f_scrollLeft()) + 'px'; } else { getObject('main' + pnum + '_' + pimg).left = imgpos[pnum] + 'px'; getObject('mainshadow' + pnum).left = (imgpos[pnum]) + 'px'; } showLayer('main' + pnum + '_' + pimg); showLayer('mainshadow' + pnum); hideLayer('thumb' + pnum + '_' + pimg); hideLayer('thumbshadow' + pnum); hideVid(); hidePostit('clients'); hidePostit('bio'); } function callback() { mymatch = prodnumparser.exec(this.id); imgLoaded[mymatch[1]]++; if (this.id.substring(0,4) == 'main') {//only show loading status for main images, not thumbs mainImgCounter++; getRawObject('imgloading').innerHTML = 'Loading ' + mainImgCounter + " of " + numimgs[currentLoading] + '...'; } if (numimgs[currentLoading] + numthumbs[currentLoading] - 1 == imgLoaded[currentLoading]) { showBig(currentLoading, currentProdnum); currentLoading = -1; } } function cycle(pimg) { parent.showBcardFront(); parent.showDesc(currentpnum); imgcount++; if (imgcount == numimgs[currentpnum]) {//if viewed all images, shrink back to thumbnail shrinkToThumb(); imgcount = 0; currentpnum = -1; currentpimg = 0; //show quote timer = setTimeout("restartAnim()",5000); return; } prev_currentpnum = currentpnum; prev_currentpimg = currentpimg; if (pimg == numimgs[currentpnum]) { currentpimg = 1; } else { currentpimg++; } if (f_scrollLeft() >= imgpos[currentpnum]) { getObject('main' + currentpnum + '_' + currentpimg).left = f_scrollLeft() + 'px'; } else { getObject('main' + currentpnum + '_' + currentpimg).left = imgpos[currentpnum] + 'px'; } showLayer('main' + currentpnum + '_' + currentpimg); showLayer('mainshadow' + currentpnum); hideLayer('main' + prev_currentpnum + '_' + prev_currentpimg); } function shrinkToThumb() { parent.hideDesc(currentpnum); hideLayer('main' + currentpnum + '_' + currentpimg); hideLayer('mainshadow' + currentpnum); if (getRawObject('thumb' + currentpnum + '_' + currentpimg) == null) { //this is a bit of a hack: press images only have one thumbnail, so revert to that showLayer('thumb' + currentpnum + '_1'); } else { showLayer('thumb' + currentpnum + '_' + currentpimg); } showLayer('thumbshadow' + currentpnum); } function showShadows() { for (i=0;i= 0) { shrinkToThumb(); } if (currentpostit) { hidePostit(currentpostit); } $(which).hide(); $(which + 'shadow').hide(); if (which == 'press') { $('loginerror').hide(); } else if (which == 'bio') { //reset texts showLayer(which + '1'); for (i=2;i<=scrollTextCount[which];i++) { hideLayer(which + i); } hideLayer(which+'nav_lt'); showLayer(which+'nav_rt'); } showLayer(which + 'big');//we're using show and hide here because javascript can't calculate offsetWidth on undisplayed divs if (which == 'press') { getRawObject('loginform').user.focus(); } show(which + 'shadowbig'); currentpostit = which; //hide quote stopQuote(); hideVid(); } function hidePostit(which) { show(which); show(which + 'shadow'); hideLayer(which + 'big'); $(which + 'shadowbig').hide(); if (which == 'bio') { hideLayer(which+'nav_lt'); hideLayer(which+'nav_rt'); hideLayer(which + textCounter); } currentpostit = ''; if (currentpnum < 0) { timer = setTimeout("restartAnim()",5000); } textCounter = 1; } /*frameName.window.pageYOffset in Netscape and other Gecko-based browsers, frameName.document.body.scrollTop in IE. */ //To determine scroll left position: (from http://www.softcomplex.com/docs/get_window_size_and_scrollbar_position.html) function f_scrollLeft() { return f_filterResults ( window.pageXOffset ? window.pageXOffset : 0, document.documentElement ? document.documentElement.scrollLeft : 0, document.body ? document.body.scrollLeft : 0 ); } function f_filterResults(n_win, n_docel, n_body) { var n_result = n_win ? n_win : 0; if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel; return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; } //LOGIN TO PRESS ACCESS function login() { var the_url = 'includes/login.php?u=' + getRawObject('loginform').user.value + '&p=' + getRawObject('loginform').pass.value; makeHttpRequest(the_url, 'access', false); } function access(str) { if (readCookie('access') == 'true') { loggedin = true; $('loginerror').hide(); hidePostit('press'); showDogears(); $('press').hide(); show('logout'); } else { show('loginerror'); } } function logout() { loggedin = false; show('press'); $('logout').hide(); hideDogears(); } function showDogears() { for (i=0;i