﻿	function confirm_delete()
	{
	if (confirm("Are you sure you want to delete this?")==true)
		return true;
	else
		return false;
	}    
    function ShowGameInfo(_gameID)
    {
            var HomeTeamInfo = document.getElementById('HomeTeamInfo' + _gameID);
	        var AwayTeamInfo = document.getElementById('AwayTeamInfo' + _gameID);
	        var GameInfo = document.getElementById('GameInfo' + _gameID);
	        if(HomeTeamInfo.style.display != 'block')
	        {
	            HomeTeamInfo.style.display = 'block';
	            AwayTeamInfo.style.display = 'block';      
	            GameInfo.style.display = 'inline'; 
            }
            else
            {
	            HomeTeamInfo.style.display = 'none';
	            AwayTeamInfo.style.display = 'none';
	            GameInfo.style.display = 'none';             
            }
    }
    function showBondHistory()
    {
        //Center the DIV
        var bondsArea = document.getElementById('bondsArea');

        var brows = getBrowserDimensions();
        
        var x = parseInt((brows.width - bondsArea.offsetWidth) / 2);
        var y = parseInt(((brows.height - bondsArea.offsetHeight) / 2) + brows.scrollH);

        bondsArea.style.top = y + "px";
        bondsArea.style.left = x + "px";
        bondsArea.style.visibility = "visible";
   
        document.getElementById('fadeBackground').style.visibility = "visible";
        document.getElementById('fadeBackground').style.height = parseInt(brows.height + brows.scrollH) + "px";
    }
    function hideBondHistory()
    {
        document.getElementById('fadeBackground').style.visibility = "hidden";
        document.getElementById('bondsArea').style.visibility = "hidden";
    }
    
    function showPointsHistory()
    {
        //Center the DIV
        var extrapointsArea = document.getElementById('extrapointsArea');

        var brows = getBrowserDimensions();
        
        var x = parseInt((brows.width - extrapointsArea.offsetWidth) / 2);
        var y = parseInt(((brows.height - extrapointsArea.offsetHeight) / 2) + brows.scrollH);

        extrapointsArea.style.top = y + "px";
        extrapointsArea.style.left = x + "px";
        extrapointsArea.style.visibility = "visible";
   
        document.getElementById('fadeBackground').style.visibility = "visible";
        document.getElementById('fadeBackground').style.height = parseInt(brows.height + brows.scrollH) + "px";
    }
    function hideBondHistory()
    {
        document.getElementById('fadeBackground').style.visibility = "hidden";
        document.getElementById('extrapointsArea').style.visibility = "hidden";
    }    
    
    
    function getBrowserDimensions() {
        var intH = 0;
        var intW = 0;
        var intscrollH = 0;
        
        if(typeof window.innerWidth  == 'number') {
         intH = window.innerHeight;
         intW = window.innerWidth;
         intscrollH = window.pageYOffset;
        } 
        else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
            intscrollH = document.documentElement.scrollTop;
        }
        else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
            intH = document.body.clientHeight;
            intW = document.body.clientWidth;
            intscrollH = document.body.scrollTop;
        } 

        return {width: parseInt(intW), height: parseInt(intH), scrollH: parseInt(intscrollH)};
        }