﻿// JScript File

//Start tooltips
document.onmousemove=positiontip

var ns6=document.getElementById && !document.all
var ie=document.all

var offsetxpoint=-40 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var enabletip=false
var tipobj=document.getElementById("dhtmltooltip")
var frame = window.frames[0].document

function ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function mouseOver(objId, fheight, fwidth){

    var f = document.getElementById("iFrameTip")

    f.style.width = fwidth + "px";
    f.style.height = fheight + "px";

if (objId=="traditional") {
    offsetxpoint=-500
    offsetypoint=-250
    }   
    tipobj.style.margin="0px;";
    tipobj.style.padding= "0px";
    tipobj.style.border="0px;";

    frame.open();
    frame.write("<html><body style='padding: 5px 10px 10px 10px; border: 1px solid #719f9f;'><link href='../App_Themes/SealyTheme/SealyMain.css' rel='stylesheet' type='text/css' />" + getHTML(objId) + "</body></html>");  
    frame.close();
     
        enabletip=true
        
        return false
}

function getHTML(objId){

if (objId=="convolutedMemoryFoam") { var html = "<font class=glossaryHeader>Convoluted memory foam</font><br/><font class=glossaryCopy>Pressure relieving convoluted SpaceTech™ materials provide unsurpassed conformance and comfort.</font>";}
if (objId=="quilt") { var html = "<font class=glossaryHeader>Quilt</font><br/><font class=glossaryCopy>The knit fabric-covered Quilt is the uppermost layer of the SpringFree. Varying in thickness and composition by model, the Quilt works in conjunction with the Topper to determine plushness.</font>";}
if (objId=="topper") { var html = "<font class=glossaryHeader>Topper</font><br/><font class=glossaryCopy>Second from the top, the Topper layer works in conjunction with the Quilt to determine plushness. Its thickness, components, even its very presence varies by model.</font>";}
if (objId=="orthopedicallyCorrectSupport") { var html = "<font class=glossaryHeader>Orthopedically Correct Support</font><br/><font class=glossaryCopy>The first Sealy Posturepedic mattresses were designed in cooperation with leading orthopedic surgeons to provide correct support for your back and body.<br/><br/> Today, Sealy continues our commitment to deliver orthopedically correct support by investing heavily in Research and Development. For example, Sealy uses Digital Motion Capture technology and Pressure Mapping to ensure its mattresses provide proper spinal alignment and conformance for deep, restorative sleep.</font>";}
if (objId=="comfortLevels") { var html = "<font class=glossaryHeader>Comfort Levels</font><br/><font class=glossaryCopy>Which comfort level best suits you? Simply take a test rest and select the one that feels best. Whatever comfort level you prefer, all Sealy Posturepedic mattresses provide orthopedically correct support.<br/><br/><b>Ultra-Plush</b><br />Soft, yet also supportive. Luxurious comfort layers offer a plush surface feel enveloping and, at the same time, supporting your entire body.<br /><br /><b>Plush</b><br />Soft, cushioning materials cradle and support your body providing a relaxing surface feel with proper support.<br /><br /><b>Cushion Firm</b><br />A combination of firm materials and softer comfort layers offer support with a bit of surface softness.<br /><br /><b>Firm</b><br />The ultimate in firm support, comfort materials are constructed to provide proper support and a firm surface feel.</font>";}
if (objId=="traditional") { var html = "<font class=glossaryHeader>Traditional and Non-traditional Sizes</font><br/><font class=glossaryCopy>Sealy sleep sets are available in a wide range of sizes. See below for dimensions. Note: For Sealy cribs, visit kolcraft.com<br/><br/><img src=../Assets_Global/glossarySizes.gif></font>";}
if (objId=="frame") { var html = "<font class=glossaryHeader>Correct Bed Frames for Queen- and King-Size Sets</font><br/><font class=glossaryCopy>The frame should include a center support with at least 5 legs or 5 hardwood cross-slats for queen and king sets.<br/><br/><img src=../Assets_Global/glossaryBedFrame.gif></font>";}
//Bed Types
if (objId=="huntington") { var html = "<font class=glossaryHeader>Huntington Beach Cushion Firm</font><br/><font class=glossaryCopy>An outstanding value, this cushion firm model promises a perfect night&#39s sleep.</font>";}
if (objId=="manhattan") { var html = "<font class=glossaryHeader>Manhattan Beach Firm</font><br/><font class=glossaryCopy>Beautiful and comfortable, this unique model offers the firmest comfort of our latex foam collection.</font>";}
if (objId=="imperial") { var html = "<font class=glossaryHeader>Imperial Beach Cushion Firm Euro Top</font><br/><font class=glossaryCopy>A unique comfort feel complements the unique styling of this exquisite cushion firm EuroTop model.</font>";}

if (objId=="newport") { var html = "<font class=glossaryHeader>Newport Beach Plush</font><br/><font class=glossaryCopy>Reward yourself with the unique comfort and incredible value of this superior plush latex foam mattress.</font>";}
if (objId=="venice") { var html = "<font class=glossaryHeader>Venice Beach Plush</font><br/><font class=glossaryCopy>Sweet dreams start here with the sumptuous comfort and luxurious feel of this ultra plush model.</font>";}

if (objId=="waikiki") { var html = "<font class=glossaryHeader>Waikiki Beach Pillow Top</font><br/><font class=glossaryCopy>Rest and relaxation are inevitable when enjoying this cradling soft plush Pillow Top model.</font>";}
if (objId=="laguna") { var html = "<font class=glossaryHeader>Laguna Beach Plush Pillow Top</font><br/><font class=glossaryCopy>Cradle yourself in decadent softness with this luxurious ultra plush Pillow Top latex foam mattress.</font>";}
if (objId=="solana") { var html = "<font class=glossaryHeader>Solana Beach Ultra Plush Super Pillow Top</font><br/><font class=glossaryCopy>The ultimate in softness, this unique ultra plush Super Pillow Top model envelops you in a cloud of comfort.</font>";}

//RighTouch
if (objId=="quickConnect") { var html = "<font class=glossaryHeader>Quick Connect</font><br/><font class=glossaryCopy>The color-coded mechanisms that are used to connect the air hoses to the RightTouch air pump. Quick connects make it easier to connect the hoses than conventional screw-on connectors.</font>";}
if (objId=="lowProfileBoxSpring") { var html = "<font class=glossaryHeader>Low-Profile Box Spring</font><br/><font class=glossaryCopy>A box spring that measures 5 1/8” inches in height versus the traditional 9”. It is designed to reduce the height of bedding sets to make them easier to enter and to reduce the height of the mattress against the headboard of the bed.</font>";}
if (objId=="upholstery") { var html = "<font class=glossaryHeader>Upholstery materials</font><br/><font class=glossaryCopy>The foam and fiber layers under the quilted layer and on top of the air chambers of the RightTouch mattress.  They are designed to provide the comfortable surface feel and reduce pressure points.</font>";}
if (objId=="knitFabric") { var html = "<font class=glossaryHeader>Knit Fabric</font><br/><font class=glossaryCopy>Polyester or nylon fabric produced through a knitting process rather than weaving. It is characterized by a very soft feel and superior stretch capabilities.</font>";}
if (objId=="memoryFoam") { var html = "<font class=glossaryHeader>Memory Foam</font><br/><font class=glossaryCopy>Visco-elastic foam that conforms and responds to your unique shape and helps to relieve pressure points. Also called space-age foam.</font>";}
if (objId=="autoMemory") { var html = "<font class=glossaryHeader>Auto Memory Function</font><br/><font class=glossaryCopy>A remote control function that allows the user to set the RightTouch mattress to his or her comfort setting and forget about it.  The RightTouch mattress will self-adjust when the consumer lies down, and inflate in the morning so that mattress looks good when the bed is made.</font>";}
if (objId=="comfortSetting") { var html = "<font class=glossaryHeader>Comfort Setting</font><br/><font class=glossaryCopy>The individualized setting that each RightTouch user sets for his/her sleeping preference.  The RightTouch mattress can be set from .00 psi to .50 psi.</font>";}
if (objId=="pillowTop") { var html = "<font class=glossaryHeader>Pillowtop</font><br/><font class=glossaryCopy>A top finishing treatment where a big layer (pillow) of soft materials is sewn onto the mattress as a separate top layer.</font>";}
if (objId=="adjAirChamber") { var html = "<font class=glossaryHeader>Adjustable Air Chamber</font><br/><font class=glossaryCopy>The core of the RightTouch mattress. Made of laminated layers of flexible materials with a PVC (vinyl) cover. The amount of air in the chamber can be changed to create different comfort feels, allowing each RightTouch user to choose his/her comfort setting. The chambers are multi-baffled to reduce motion transfer and allow the RightTouch user to sleep undisturbed, even if their partner is tossing and turning.</font>";}
if (objId=="multiBaffled") { var html = "<font class=glossaryHeader>Baffle</font><br/><font class=glossaryCopy>A structure that reduces motion transfer in the adjustable air chamber. Inside the chamber, walls are set up that restrict the speed of air accelerated through the chamber when the user changes position or their comfort setting. The restricted speed eliminates quick pressure changes at pressure points ensuring reduced motion transfer.</font>";}
if (objId=="edgeSupport") { var html = "<font class=glossaryHeader>Edge Support System</font><br/><font class=glossaryCopy>RightTouch has a unique edge support system that locks the air chambers in place, provides a firmer seating edge with more usable sleep surface. Sealy’s unique design reduces the transition feel between the edge of the bed and the air chambers.</font>";}
if (objId=="fiber") { var html = "<font class=glossaryHeader>Fiber</font><br/><font class=glossaryCopy>A high-quality fiber placed under the quilt of the mattress that helps distribute body weight to lower comfort layers.</font>";}
if (objId=="pump") { var html = "<font class=glossaryHeader>Pump</font><br/><font class=glossaryCopy>The electrical unit that allows the RightTouch mattress to be filled with air.</font>";}
if (objId=="airHoses") { var html = "<font class=glossaryHeader>Air Hose</font><br/><font class=glossaryCopy>A durable, wire-wrapped hose that connects the outlet of the pump to the adjustable air chamber. The hose allows air to enter and exit the air chamber so the RightTouch mattress can be adjusted to the user’s comfort setting.</font>";}
if (objId=="shockAbzzorber") { var html = "<font class=glossaryHeader>Shock Abzzorber Foundation</font><br/><font class=glossaryCopy>A functional box spring that acts in conjunction with the RightTouch mattress to provide optimal comfort and support. All other air bed manufacturers use a platform style (non-functional) box spring that does not contribute to comfort and support and may reduce the life of the mattress, since none of the body weight is absorbed by the box springs in competitors’ air mattresses.</font>";}

return html

}

function mouseOut(){

       enabletip=false
       
       tipobj.style.visibility="hidden";
       //tipobj.style.left="-1000px"
       //tipobj.style.top="-1000px"
       //tipobj.style.backgroundColor=''
       //tipobj.style.width=''

}

function iFrameTip(thetext){

        var frame = window.frames["dhtmlframeTip"].document;

        offsetxpoint=-400;
        offsetypoint=-140;

        frame.open();
        frame.write(thetext);
        frame.close();

        enabletip=true
        return false
 
}

function positiontip(e){

    if (enabletip){

        var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
        var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
        
        //Find out how close the mouse is to the corner of the window
        var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
        var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

        var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

        //if the horizontal distance isn't enough to accomodate the width of the context menu
        if (rightedge<tipobj.offsetWidth)
            //move the horizontal position of the menu to the left by it's width
            tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
        else if (curX<leftedge)
            tipobj.style.left="5px"
        else
            //position the horizontal position of the menu where the mouse is positioned
            tipobj.style.left=curX+offsetxpoint+"px"
                    
        //same concept with the vertical position
        if (bottomedge<tipobj.offsetHeight)
            tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
        else
           tipobj.style.top=curY+offsetypoint+"px"
           tipobj.style.visibility="visible";
    } 
}
//End tooltip