﻿
function SelectPageMenuOption()
{
    var strPath, strPage;
    var objMenuOption
    
    strPath = window.location.pathname;
    strPage = strPath.substring(strPath.lastIndexOf('/') + 1);
    strPage = strPage.substring(0, strPage.lastIndexOf('.'));
    
    
    if(strPage.length == 0)
    {
        strPage = 'default'
    
    }
    
    
    objMenuOption = document.getElementById('objMenuOption' + strPage.toLowerCase());
    objMenuOption.style.color = '#00adef';
    
}


function ViewEyewear(strEyewearName, strEyewearType, strEyewearCode, strEyewearCodeSuffix)
{
    LaunchNewWindow('eyewearpopup.aspx', 'strEyewearName=' + strEyewearName + '&strEyewearType=' + strEyewearType + '&strEyewearCode=' + strEyewearCode + '&strEyewearCodeSuffix=' + strEyewearCodeSuffix, 'wdnEyeBiz', 536, 600)

}


function LaunchNewWindow(strPageName, strQueryString, strWindowName, intWindowWidth, intWindowHeight)
{
    var intWindowLeftPosition;

    objNewWindow = null;

    strPageName = '/' + strPageName


    if(strQueryString != '')
    {
        strQueryString = '?' + strQueryString;

    }


    objNewWindow = window.open(strPageName + strQueryString, strWindowName, 'width=' + intWindowWidth + ', height=' + intWindowHeight + ', toolbar=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no');

    intWindowLeftPosition = ((screen.width - intWindowWidth) / 2);
    objNewWindow.moveTo(intWindowLeftPosition, 120);

    objNewWindow.resizeTo(intWindowWidth, intWindowHeight);

}

