﻿function TypeOtherValidateButton()
{
    var rbtList = document.getElementById("rbtnsType");
    var arrayOfRadioButtons = rbtList.getElementsByTagName("input");
    for(var i=0; i<arrayOfRadioButtons.length; i++)
    {
    	if(arrayOfRadioButtons[i].checked)
	    {
	        if(arrayOfRadioButtons[i].value == arrayOfRadioButtons.length)
	        {
	            document.getElementById('txtTypeOther').style.visibility = 'visible';
	            document.getElementById('valTypeOther').style.visibility = 'visible';  
	        }
	        else
	        {
	            document.getElementById('txtTypeOther').style.visibility = 'hidden'; 
	            document.getElementById('valTypeOther').style.visibility = 'hidden'; 
	        }
	    }
    }
}

function TypeOtherValidateText(source, args)
{
    if(document.getElementById('txtTypeOther').style.visibility == 'visible')
    { 
        args.IsValid = false;
        if(document.getElementById('txtTypeOther').value != '') 
        {
            args.IsValid = true;
        }
    }
    else
    {
        args.IsValid = true;
    }
}

function TypeValidate(source, args)
{
    args.IsValid = false;
    var rbtList = document.getElementById("rbtnsType");
    var arrayOfRadioButtons = rbtList.getElementsByTagName("input");
    for(var i=0; i<arrayOfRadioButtons.length; i++)
    {
	    if(arrayOfRadioButtons[i].checked)
	    {
		    args.IsValid = true;
	    }
    }
}

function Transfer()
{
	window.parent.frames['top'].location.href="http://www.digitalsports.com";
}


/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//
function ChangeCheckBoxState(id, checkState)
{
    var cb = document.getElementById(id);
    if (cb != null)
    {
        if(!cb.disabled)
        {
            cb.checked = checkState;
        }
    }
}

//*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//       
function ChangeAllCheckBoxStates(checkState)
{
    if (GViewCheckBoxIDs != null)
    {
        for (var i = 0; i < GViewCheckBoxIDs.length; i++)
        {
           ChangeCheckBoxState(GViewCheckBoxIDs[i], checkState);
        }
    }
}


/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//
function GoToClient(ClientID)
{
	window.open('AdminClientEdit.aspx?ClientID=' + ClientID, ClientID, 'width=' + 750 + ', height=' + (screen.availHeight - 120) + ', top=' + 5 + ', left=' + (screen.availWidth-750)/2 + ', status=yes, toolbar=yes, scrollbars=yes, resizable=yes');    
}

/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//			
function Exit()
{
    window.parent.frames['top'].window.close();  
}

/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//			
function GoToPage(Page)
{
    window.parent.frames['frameBottom'].location.href=Page;
}

/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//			
function divMessageRegister()
{
    document.getElementById('divMessageRegister').firstChild.nodeValue = 'Loading...';
}

function divMessageClientAdd()
{
    document.getElementById('divMessageClientAdd').firstChild.nodeValue = 'Saving...';
}
