

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function OpenWindow(url, name, width, height) {
    OpenWindow(url, name, height, width, false);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function OpenWindow(url, name, width, height, enableScrollbars) {
    OpenWindow(url, name, height, width, enableScrollbars, false);
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function OpenWindow(url, name, width, height, enableScrollbars, resizable) {
	if(navigator.appName.indexOf("WebTV")!=-1)
		window.location.href=url;
	else
	{
		winhandle=window.open(url, name, "width=" + width + ",height=" + height + ",scrollbars=" + GetWindowBoolString(enableScrollbars) + ",resizable=" + GetWindowBoolString(enableScrollbars) + ",status=no,menubar=no");
		winhandle.focus();
	}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function GetWindowBoolString(value) {
    if(value) 
        return "yes";
    else
        return "no";   
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function ClearStatusText() {
    window.status='';
    return true;
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function SetStatusToToolTip(item) {
    if(item && item.title) window.status=item.title;
    return true;
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function SetStatus(text) {
    if(item) window.status=item.text;
    return true;
}


//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function OpenGameResult(gameID) {
    var windowName = 'gameresult' + gameID;
    var url = '/soccer/GameResults/Results.aspx' + '?gid=' + gameID;
    
    OpenWindow(url, windowName, 740, 550, false);
    
}


//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function OpenScheduledGameResult(scheduleID) {
    var windowName = 'gameresult' + scheduleID;
    var url = '/soccer/GameResults/Results.aspx' + '?sid=' + scheduleID;
    
    OpenWindow(url, windowName, 740, 550, false);
    
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function OpenClubProfile(clubID, showChallenge) {

    var windowName = 'club' + clubID;
    var url = '/soccer/ClubProfile/Default.aspx' + '?cid=' + clubID + '&challenge=' + showChallenge;

    OpenWindow(url, windowName, 975, 550, false);
    
}

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function OpenPlayerProfile(playerID, section) 
{
    var windowName = 'player' + playerID;
    var url = '/soccer/PlayerProfile/Default.aspx' + '?pid=' + playerID;
    if(section) {
        url += '&section=' + section;
    }

    OpenWindow(url, windowName, 750, 550, false);
}
