﻿// JScript File
var resultElement

//CALLS THE WEB SERVICE GROUPNAME WHICH RETURNS DIVISION INFORMATION
function GetInfo(obj, year, compID, labelID)
//obj is 'this', year is competition year, compID is competition ID, and labelID is the label to display
{
    if (obj.style.backgroundImage.match('plus1.gif'))
    {   
        obj.style.backgroundImage = "url(/images/minus1.gif)";
        resultElement = document.getElementById(labelID);
        pullDivisions.groupName(year, compID, showResults);
        document.getElementById(labelID).style.display = "block";
    }
    else
    {   
        obj.style.backgroundImage = "url(/images/plus1.gif)";
        document.getElementById(labelID).style.display = "none";
    }
    
}

//DISPLAYS THE HIDDEN TEXT
function displayInfo(obj, labelID)
{
    if (obj.style.backgroundImage.match('plus1.gif'))
    {
        obj.style.backgroundImage = "url(/images/minus1.gif)";
        document.getElementById(labelID).style.display = "block";
    }
    else
    {
        obj.style.backgroundImage = "url(/images/plus1.gif)";
        document.getElementById(labelID).style.display = "none";
    }
    
}

//DISPLAYS THE RESULTS
function showResults(result)
{
    resultElement.innerHTML = result;
}

//CHANGE MOUSE POINTER
function changePointer(obj)
{
    if (obj.style.cursor == "pointer")
    {
        obj.style.cursor = "default";
    }
    else
    {
        obj.style.cursor = "pointer";
    }
}
