
/** [MFLOAT.JS]
 *
 *  Boedeker Plastics, Inc. : Javascript Source Code File - Dynamic Floating Menu in browser window corner
 *
 *  History : Created by Scott Baer 2003
 *            a1 - 20Mar03 - created new from cut-and-paste © Dynamic Drive
 *                           For full source code, usage terms, and 100's more DHTML scripts, 
 *                           visit http://www.dynamicdrive.com/dynamicindex1/
 *            a2 - 21Mar03 - converted from text links to graphic buttons and ALT tags
 *                           added printWindow function from another source
 *            a3 - 21Mar03 - added bordercolor attributes (MSIE only) for contrast
 *            a4 - 24Mar03 - added mouseover effects for button indent & message line
 *            01 - 26Mar03 - added menu header image, changed ALT & msg line text slightly
 *            a6 - 01Oct03 - added close menu option (DEVELOPMENT VERSION ... ALL CODE OPTIONS SAVED)
 *            02 - 01Oct03 - close floating menu on "menu" titlebar click, shows "X" image on mouseover
 *                           (close function now works for all modern browsers, but not Netscape 4)
 *            03 - 08Oct03 - bust any frames that might enclose any Boedeker.com pages 
 *                           (since MFLOAT.JS is called by every page in the site)
 *            04 - 17Sep04 - close floating menu when "print" option is selected
 *            05 - 06Oct04 - suspend frame-break code for TR test
 *            06 - 01Nov04 - restored frame-break code for TR test
 */

/*  
Break out of any frames that might hold this page
*/
// suspended on 06Oct2004 sb, restored 01Nov2004
if (window != top) top.location.href = location.href;

/*
Print Page script - CodeLifter.com (support@codelifter.com)
This script available free online at http://javascript.internet.com
*/

function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) {
  floatoff();
  window.print();
  }
}

/*
Close Floating Menu function - by Scott Baer
*/
function floatoff(){
  document.getElementById('divStayTopLeft').style.display="none";
  }

/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com)
This script available free online at http://www.dynamicdrive.com
Floating Menu HTML code for images and links below by Scott Baer
*/
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute; z-index:2">')

document.write('<layer id="divStayTopLeft">')
document.write('<table width="50" border="0" height="50" cellspacing="0" cellpadding="0">')
document.write('  <tr>')
document.write('    <td>')
// onClick calls floatoff function - works fine in MSIE & Opera & Firebird, but Netscape 4 menu will not close
document.write('<a href="#top"><img src="/images/bt_top.png" width="50" height="50" border="0"></a>')
document.write('    </td>')
document.write('  </tr>')
document.write('</table>')
document.write('</layer>')

//Enter "frombottom" or "fromtop"
var verticalpos="fromtop"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
// Horizontal "X" screen coordinate of upper LH corner of floating menu
   var startX = 148,
// Vertical "Y" screen coordinate of upper LH corner of floating menu
   startY = 450;
   var ns = (navigator.appName.indexOf("Netscape") != -1);
   var d = document;
   function ml(id)
   {
     var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
     if(d.layers)el.style=el;
     el.sP=function(x,y){this.style.left=x;this.style.top=y;};
     el.x = startX;
     if (verticalpos=="fromtop")
       el.y = startY;
     else{
       el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
       el.y -= startY;
     }
     return el;
   }
   window.stayTopLeft=function()
   {
     if (verticalpos=="fromtop"){
       var pY = ns ? pageYOffset : document.body.scrollTop;
       ftlObj.y += (pY + startY - ftlObj.y)/8;
     }
     else{
       var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
       ftlObj.y += (pY - startY - ftlObj.y)/8;
     }
     ftlObj.sP(ftlObj.x, ftlObj.y);
//   Speed of position menu re-position is number below 10=fast, 40=slow, 100=crawl                
     setTimeout("stayTopLeft()", 30);
   }
   ftlObj = ml("divStayTopLeft");
   stayTopLeft();
}
JSFX_FloatTopDiv();

// end of script
