﻿function hideTabs()
{
    document.getElementById('divSummary').style.display = 'none';
    document.getElementById('divMyLists').style.display = 'none';
    document.getElementById('divMyPlays').style.display = 'none';
    document.getElementById('divFriends').style.display = 'none';
    
    var oSummary = document.getElementById('ctl00_ContentPlaceHolder1_hypSummary');
    var oMyLists = document.getElementById('ctl00_ContentPlaceHolder1_hypMyLists');
    var oMyPlays = document.getElementById('ctl00_ContentPlaceHolder1_hypMyPlays');
    var oFriends = document.getElementById('ctl00_ContentPlaceHolder1_hypFriends');
    
    oSummary.setAttribute('class', 'tab_off');
    oSummary.setAttribute('className', 'tab_off');
    oSummary.style.textDecoration = '';
    oSummary.style.color = '';
    oSummary.style.fontWeight = 'normal';
    
    oMyLists.setAttribute('class', 'tab_off');
    oMyLists.setAttribute('className', 'tab_off');
    oMyLists.style.textDecoration = '';
    oMyLists.style.color = '';
    oMyLists.style.fontWeight = 'normal';
    
    oMyPlays.setAttribute('class', 'tab_off');
    oMyPlays.setAttribute('className', 'tab_off');
    oMyPlays.style.textDecoration = '';
    oMyPlays.style.color = '';
    oMyPlays.style.fontWeight = 'normal';
    
    oFriends.setAttribute('class', 'tab_off');
    oFriends.setAttribute('className', 'tab_off');
    oFriends.style.textDecoration = '';
    oFriends.style.color = '';
    oFriends.style.fontWeight = 'normal';
}

function showTab(oLink, sDivId, sHiddenId, sButtonId, sProgressId)
{
    // hide all tabs
    hideTabs();
    
    // resize progress overlay
    var oProgress = document.getElementById(sProgressId);
    var oContainer = document.getElementById('tdContainer');
    oProgress.style.height = '500px' //oContainer.style.height;
    
    // show this tab
    var oDiv = document.getElementById(sDivId);
    oDiv.style.display = 'block';
    
    // change the link
    oLink.setAttribute('class', 'tab_on');
    oLink.setAttribute('className', 'tab_on');
    oLink.style.textDecoration = 'none';
    oLink.style.color = '#c97916';
    oLink.style.fontWeight = 'bold';
    
    var oHidden = document.getElementById(sHiddenId);
    if(oHidden.value == 'false')
    {
        // call async load on panel
        __doPostBack(sButtonId,'');
    }
}

function AutoCompleteExtenderSearch_ItemSelected(source, eventArgs)
{
    document.getElementById("ctl00_ContentPlaceHolder1_hidSearchId").value = eventArgs.get_value();
}

function AutoCompleteExtenderSearch_ClientPopulating(source, eventArgs)
{
    document.getElementById('divProgress').style.display = '';
}

function AutoCompleteExtenderSearch_ClientShowing(source, eventArgs)
{
    document.getElementById('divProgress').style.display = 'none';
}