function show2(x, e)
{
	var posx=0,posy=0;
	if(e==null) e=window.event;
	if(e.pageX || e.pageY)
	{
		posx=e.pageX; posy=e.pageY;
    }
	else if(e.clientX || e.clientY)
	{
		if(document.documentElement.scrollTop)
		{
			posx=e.clientX+document.documentElement.scrollLeft;
			posy=e.clientY+document.documentElement.scrollTop;
        }
		else
		{
			posx=e.clientX+document.body.scrollLeft + 5 + 'px';
			posy=e.clientY+document.body.scrollTop + 5 + 'px';
        }
    }
	
	document.getElementById(x).style.display = 'block';
	document.getElementById(x).style.top = posy;
	document.getElementById(x).style.left = posx;
}
function hide2(x) 
{
	document.getElementById(x).style.display = 'none';
}

function AgreedToTermsUncheckMessage(x)
{
	chkControl = document.getElementById(x);

	if (chkControl.checked == false)
	{
		alert('By not checking this box, you are not agreeing to the Terms and Conditions of the ScoreCard Rewards Program. Therefore you will no longer receive Rewards Certificates or any communication from DICK\'S Sporting Goods\' ScoreCard Rewards Program');
	}
}

function showCWMessages()
{
/*
	var posx=0,posy=0;
	if(e==null) e=window.event;
	if(e.pageX || e.pageY)
	{
		posx=e.pageX; posy=e.pageY;
    }
	else if(e.clientX || e.clientY)
	{
		if(document.documentElement.scrollTop)
		{
			posx=e.clientX+document.documentElement.scrollLeft;
			posy=e.clientY+document.documentElement.scrollTop;
        }
		else
		{
			posx=e.clientX+document.body.scrollLeft + 5;
			posy=e.clientY+document.body.scrollTop + 5;
        }
    }
    */
    
	var o = getPos(document.getElementById('container'));

	
	document.getElementById('CWMessages').style.display = 'block'; 
	document.getElementById('CWMessages').style.top = o.y + 112 + 'px';
	document.getElementById('CWMessages').style.left = o.x + 568 + 'px';

}

function closeCWMessages()
{
	document.getElementById('CWMessages').style.display = 'none'; 
}

function getPos(inputElement) 
{
    var coords =  new Object();
    coords.x = 0;
    coords.y = 0;
    try 
    {
        targetElement = inputElement;
        if(targetElement.x && targetElement.y) 
        {
            coords.x = targetElement.x;
            coords.y = targetElement.y;
        } 
        else 
        {
            if(targetElement.offsetParent) 
            {
                coords.x += targetElement.offsetLeft;
                coords.y += targetElement.offsetTop;
                while(targetElement = targetElement.offsetParent) 
                {
                    coords.x += targetElement.offsetLeft;
                    coords.y += targetElement.offsetTop;
                }
            } 
            else 
            {
                //alert(\"Could not find any reference for coordinate positioning.\");
            }
        }
        return coords;
    } 
    catch(error) 
    {
        //alert(error.msg);
        return coords;
    }
}

/*
*/




function highlight(x)
{
	var y = document.getElementsByTagName('div');
	for (var i=0;i<y.length;i++)
	{
		if(y[i].id.indexOf('faq') != -1)
			y[i].style.backgroundColor = '';
	}
	
	document.getElementById(x).style.backgroundColor = '#ddd';
}




function display(x) 
{
	var y = document.getElementsByTagName('div');
	for (var i=0;i<y.length;i++)
	{
		if(y[i].id.substr(0,5) == 'desc_' && y[i].style.display == 'block')
			y[i].style.display = 'none';
	}
	if(x != 'desc_')
	{
		if(document.getElementById(x).style.display == 'block')
			document.getElementById(x).style.display = 'none';
		else
			document.getElementById(x).style.display = 'block';			
	}
}


function peek(x) 
{
	if(document.getElementById('dtl_'+x).style.display == 'block')
	{
		document.getElementById('dtl_'+x).style.display = 'none';
		document.getElementById('hdr_'+x).className = 'out';
	}
	else
	{
		document.getElementById('dtl_'+x).style.display = 'block';
		document.getElementById('hdr_'+x).className = 'selected';
	}
}
function over(x)
{
	if(document.getElementById(x).className != 'selected')
	{
		document.getElementById(x).className = 'over';	
	}
}
function out(x)
{
	if(document.getElementById(x).className != 'selected' )
	{
		document.getElementById(x).className = 'out';
	}

}
