// displays confirm message before exiting to "Alka-Seltzer en Espanol"
function go_espanol() {
golink = confirm("You are about to visit Alka-Seltzer's website in Mexico. \nNot all information will be relevant or appropriate for the U.S. \nDo you want to continue?");
if (golink) window.location='http://www.alka-seltzer.com.mx/';
}

//general use Spotlight click tracking
function trackclick(type,cat) {
var click1 = new Image();
var axel = Math.random() + "";
var a = axel * 1000000000000000000;
click1.src = 'http://fls.doubleclick.net/activityi;src=1017324;type='+type+';cat='+cat+';ord=1;num='+a +'?';
}

//opens popup window for blastem game
function popBlastem() {
	var pw = window.open('img/blastem_300x250/alkaseltzer_blastem_300x250to560x300.html','printthis','width=560,height=300,menubar=no,toolbar=no,scrollbars=no');
}

//opens popup window for forward to a friend
function forwardpopup(page) {
	var ff = window.open('forwardfriend.php?page='+page,'forwardfriend','width=475,height=475,menubar=no,toolbar=no,scrollbars=no,location=no,status=no,resizable=no');
}

//stretch sidebar height to match content height
window.onload = function()
{
	var sidebar = document.getElementById('sidebar');
	if(!sidebar) return;
	var contentheight = document.getElementById('content').clientHeight;
	var sidebarheightdiff = sidebar.clientHeight - parseInt(getStyle(sidebar,'height'));
	if(sidebar.clientHeight < contentheight) sidebar.style.height = contentheight-sidebarheightdiff + "px";
	
}


// get computed style
function getStyle(element, style)
{
    var value = element.style[style];
	if(!value)
	{
		if (element.currentStyle)
		{
			value = element.currentStyle[style];
		}
		else if (window.getComputedStyle)
		{
			value = document.defaultView.getComputedStyle(element,null).getPropertyValue(style);
		}
		if (value == 'auto')
		{
			if ((style == 'width' || style == 'height') && (getStyle(element,'display') != 'none'))
			{
				var Style = style.charAt(0).toUpperCase() + style.substring(1).toLowerCase();
				return element['offset' + Style] + 'px';
			}
		}
	}
    return value == 'auto' ? null : value;
}