﻿// JScript File

//var topLoginId = 'topLogin_topLogin';
//var sideLoginId = 'signIn_user_signin';
var footerObjId = 'footerObj';
var footerObjArray = new Array();
var subElementCount;
var footerIndex;
var footerWidth = 7;


//var loginBlockId='loginBlock';
//var logoutBlockId = 'logOffBlock';

//function hideLogins()
//{
//    try
//    {
//        var sideLoginObj = document.getElementById(sideLoginId);
//        if (sideLoginObj != null)
//            sideLoginObj.style.display='none';
//        var topLoginObj = document.getElementById(topLoginId);
//        if (topLoginObj != null)
//            topLoginObj.style.display='none';
//    }
//    catch(err)
//    {
//    }
//}

//function setUserControlToLoggedIn()
//{
//    try
//    {
//        var sideLoginObj = document.getElementById(sideLoginId);
//        if (sideLoginObj != null)
//            sideLoginObj.style.display='none';
//    }
//    catch(err)
//    {}
//    try
//    {
//        var topLoginObj = document.getElementById(loginBlockId);
//        if (topLoginObj != null)
//            topLoginObj.style.display='none';
//    }
//    catch(err)
//    {}
//    try
//    {
//        var topLogoutObj = document.getElementById(logoutBlockId);
//        if (topLogoutObj != null)
//            topLogoutObj.style.display='block';
//    }
//    catch(err)
//    {}
//}
//function setUserToLoggedOut()
//{
//    try
//    {
//        var sideLoginObj = document.getElementById(sideLoginId);
//        if (sideLoginObj != null)
//            sideLoginObj.style.display='block';
//    }
//    catch(err)
//    {}
//    try
//    {
//        var topLoginObj = document.getElementById(loginBlockId);
//        if (topLoginObj != null)
//            topLoginObj.style.display='block';
//    }
//    catch(err)
//    {}
//    try
//    {
//        var topLogoutObj = document.getElementById(logoutBlockId);
//        if (topLogoutObj != null)
//            topLogoutObj.style.display='none';
//    }
//    catch(err)
//    {}
//}
function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}                             
                        
function DefaultOnLoadEvents()
{
    initBottomFooters();
}

function initBottomFooters()
{
    if (document.all)                                        // If IE
    {
        initFooterForIE();
    }
    else
    {
        initFooterForMOZ();
    }
}
function initFooterForIE()
{
    try
    {
        var footerObj = document.getElementById(footerObjId);   // Get footer UL
        subElementCount = footerObj.children.length;        // Get all LIs in UL
        for (i = 1; i < subElementCount - 1; i++)               // Omit prev-next buttons and Copyright text
        {
            footerObjArray[i - 1] = footerObj.children[i];      // Add other items into array
        }
        footerIndex = 0;                                        // Init index at startup position
        redrawFooterIE();                                         // Draw footers for start
    }
    catch(err)
    {
    }
}
function initFooterForMOZ()
{
    var addIndex = 0;
    var footerObj = document.getElementById(footerObjId);   // Get footer UL
    if (footerObj != null)
    {
        subElementCount = footerObj.childNodes.length;      // Get all LIs in UL
        for (i = 1; i < subElementCount - 1; i++)               // Omit prev-next buttons and Copyright text
        {
            if ((footerObj.childNodes[i].tagName != null)&&(footerObj.childNodes[i].tagName == 'LI'))
            {
                footerObjArray[addIndex] = footerObj.childNodes[i];      // Add other items into array
                addIndex++;
            }
        }
    }
    footerIndex = 0;                                        // Init index at startup position
    redrawFooterMOZ();                                         // Draw footers for start    
}
function prevFooter()
{
    if (footerIndex > 0)                                    // If we still are not at the first item
    {
        footerIndex--;                                      // Decrease index
        if (document.all)
            redrawFooterIE();                                     // Redraw footers for new position
        else
            redrawFooterMOZ();                                     // Redraw footers for new position
    }
}
function nextFooter()
{
    if (footerIndex < (footerObjArray.length - footerWidth + 1))    // If we still are not at the last item
    {
        footerIndex++;                                      // Increase index
        if (document.all)
            redrawFooterIE();                                     // Redraw footers for new position
        else
        {
            if (footerIndex < (footerObjArray.length - footerWidth))
                redrawFooterMOZ();                                     // Redraw footers for new position
        }
    }
}
function redrawFooterIE()
{
    for (i = 0; i < footerObjArray.length; i++)             // For every valid LI in UL
    {
        var tempObj = footerObjArray[i];                    // Get LI object
        if ((i >= footerIndex)&&(i < footerIndex + footerWidth - 1))  // If the LI is within the drawing range
        {
            tempObj.style.display='block';                  // Display LI
        }
        else    
        {
            tempObj.style.display='none';                   // Hide LI
        }
    }
}
function redrawFooterMOZ()
{
    var footerObjArray2 = new Array();
    for (i = 1; i < footerObjArray.length - 1; i++)
    {
        footerObjArray2[i - 1] = footerObjArray[i];
    }
    for (i = 0; i < footerObjArray2.length; i++)             // For every valid LI in UL
    {
        var tempObj = footerObjArray2[i];                    // Get LI object
        if ((i >= footerIndex)&&(i < footerIndex + footerWidth - 1))  // If the LI is within the drawing range
        {
            tempObj.style.display='block';                  // Display LI
        }
        else    
        {
            tempObj.style.display='none';                   // Hide LI
        }
    }
//    var tempObj = footerObjArray[0];                    // Get LI object
//    var tempObj = footerObjArray[footerObjArray.length - 1];                    // Get LI object
//    tempObj.style.display='block';                  // Display LI
}

function reloadPage()
{
    window.setTimeout("window.location.reload(true)", 3000);
}




//hasan added for phone number
function getIt()
{
    var dd = document.getElementById('FormView_Register_SignMeDailySMS');
    var torf = dd.checked;
    var phDiv = document.getElementById('phoneDIV');
    if(torf==true)
    {
        phDiv.style.display="block";
    }
    else
    {
        phDiv.style.display="none";
    }
    
}