
/** [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 - 22Oct08 - restored frame-break code
 */


// Break out of any frames that might hold this page

if (window != top) top.location.href = location.href;


// Print Page script - CodeLifter.com (support@codelifter.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)
// (HTML code for images and links below by Scott Baer)

if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')

document.write('<layer id="divStayTopLeft">')
document.write('<table border="2" cellspacing="0" cellpadding="0" bordercolorlight="3366FF" bordercolordark="#003399">')
document.write('  <tr>')
document.write('    <td bgcolor="#CCCCCC" align="center">')
// onClick calls floatoff function - works fine in MSIE & Opera & Firebird, but Netscape 4 menu will not close
document.write('      <img name=menu src="menu-btn.gif" width="23" height="11" alt="Close this Floating Menu Bar" border="0" onClick="javascript:floatoff(); return true;" onmouseover="document.menu.src=\'menu-btn-x.gif\';window.status=\'Close this Floating Menu Bar\'; return true" onmouseout="document.menu.src=\'menu-btn.gif\';window.status=\' \'; return true"><br>')
document.write('      <a href="index.htm" onmouseover="document.home.src=\'bdiam-btn-in.gif\';window.status=\'Go to Boedeker.com Home Page\'; return true" onmouseout="document.home.src=\'bdiam-btn.gif\';window.status=\' \'; return true"><img name=home src="bdiam-btn.gif" width="23" height="22" alt="Go to Boedeker.com Home Page" border="0"></a><br>')
document.write('      <a href="mguide.htm" onmouseover="document.guide.src=\'guide-btn-in.gif\';window.status=\'Go to Materials Guide\'; return true" onmouseout="document.guide.src=\'guide-btn.gif\';window.status=\' \'; return true"><img name=guide src="guide-btn.gif" width="23" height="22" alt="Go to Materials Guide" border="0"></a><br>')
document.write('      <a href="mtable.htm" onmouseover="document.sort.src=\'sort-btn-in.gif\';window.status=\'Go to Sortable Properties Table\'; return true" onmouseout="document.sort.src=\'sort-btn.gif\';window.status=\' \'; return true"><img name=sort src="sort-btn.gif" width="23" height="22" alt="Go to Sortable Properties Table" border="0"></a><br>')
document.write('      <a href="search.cgi" onmouseover="document.search.src=\'search-btn-in.gif\';window.status=\'Search Our Site\'; return true" onmouseout="document.search.src=\'search-btn.gif\';window.status=\' \'; return true"><img name=search src="search-btn.gif" width="23" height="22" alt="Search Our Site" border="0"></a><br>')
document.write('      <a href="javascript:printWindow();" onmouseover="document.print.src=\'print-btn-in.gif\';window.status=\'Print This Page\'; return true" onmouseout="document.print.src=\'print-btn.gif\';window.status=\' \'; return true"><img name=print src="print-btn.gif" width="23" height="22" alt="Print This Page" border="0"></a><br>')
document.write('      <a href="contact.htm" onmouseover="document.mail.src=\'mail-btn-in.gif\';window.status=\'Send Us A Message\'; return true" onmouseout="document.mail.src=\'mail-btn.gif\';window.status=\' \'; return true"><img name=mail src="mail-btn.gif" width="23" height="22" alt="Send Us A Message" border="0"></a><br>')
document.write('      <img name=phone src="phone-btn.gif" width="23" height="22" alt="Call USA TollFree at 1-800-444-3485" border="0" onmouseover="document.phone.src=\'phone-btn-in.gif\';window.status=\'Call USA TollFree at 1-800-444-3485\'; return true" onmouseout="document.phone.src=\'phone-btn.gif\';window.status=\' \'; return true"><br>')
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 = 2,
// Vertical "Y" screen coordinate of upper LH corner of floating menu
   startY = 20;
   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()", 50);
   }
   ftlObj = ml("divStayTopLeft");
   stayTopLeft();
}
JSFX_FloatTopDiv();

// end of script

