var yPosition = 80;

//new ypSlideOutMenu("number menu", "slide position", left, top, width, height)
var mWhy =    new ypSlideOutMenu("why",    "down", -1000, yPosition, 100, 550)
var mAccess = new ypSlideOutMenu("access", "down", -1000, yPosition, 140, 550)
var mRepay = new ypSlideOutMenu("repay", "down", -1000, yPosition, 130, 550)
var mCare = new ypSlideOutMenu("care", "down", -1000, yPosition, 114, 550)
// for each menu, we set up the onactivate event to call repositionMenu with the amount offset from center, in pixels
mWhy.onactivate = function() { repositionMenu(mWhy, -183); }
mAccess.onactivate = function(){ repositionMenu(mAccess, 13); }
mRepay.onactivate = function(){ repositionMenu(mRepay, 165); }
mCare.onactivate = function(){ repositionMenu(mCare, 255); }

// speed of the menus
ypSlideOutMenu.aniLen = 500

// delay time before the menus close
ypSlideOutMenu.hideDelay = 325


// this function repositions a menu to the speicified offset from center
function repositionMenu(menu, offset)
{
// the new left position should be the center of the window + the offset
    var newLeft = getWindowWidth() / 2 + offset;
    //alert(getWindowWidth());

// setting the left position in netscape is a little different than IE
    menu.container.style ? menu.container.style.left = newLeft + "px" : menu.container.left = newLeft;
}

// this function calculates the window's width - different for IE and netscape
function getWindowWidth()
{
    return window.innerWidth ? window.innerWidth : document.body.offsetWidth;
}

//ypSlideOutMenu.writeCSS();
