function toggleSub(id, status)
{
	switch (status) {
		case 0:
			document.getElementById('s0' + id).style.display = 'none';
			//document.getElementById(id).style.visibility = 'hidden';
		break;

		case 1:
			document.getElementById('s0' + id).style.display = 'block';
			//document.getElementById(id).style.visibility = 'visible';
		break;
	}
}

function toggleTab(id)
{
	for (i = 1; i < 5; i = i + 1)
	{
		if (document.getElementById("t0" + i).className != 'empty' && i != id)
		{
			document.getElementById("t0" + i).className = '';
			document.getElementById("a0" + i).className = '';
			document.getElementById("c0" + i).style.display = 'none';
		}
	}
	document.getElementById("t0" + id).className = 'current';
	document.getElementById("c0" + id).style.display = 'block';
	document.getElementById("a0" + id).className = 'currenta';
	document.getElementById("a0" + id).blur();

	return false;
}

function toggleAnswer(on)
{
	if (document.getElementById(on).style.display !== 'block')
	{
		document.getElementById(on).style.display = 'block';
		ajax_faq_watch(on);
	}
	else
	{
		document.getElementById(on).style.display = 'none';
	}

	return false;
}

function enlargeImage(src, w, h, alt)
{
	var img_w = w;
	var img_h = h;

	// adjust sizes for Firefox
	if (navigator.userAgent.indexOf("Firefox") != -1) {
		w = w + 29;
		//h = h + 15;
 	}

 	// window properties
	myw = Math.floor((screen.width - w)/2);
	myh = Math.floor((screen.height - h)/2);
	options = "toolbar=0,status=0,location=0,menubar=0,resizable=0,width=" + w + ",height=" + h + ",screenx=" + myw + ",screeny=" + myh + ",left=" + myw + ",top=" + myh;

	if (win && win.open && !win.closed) win.close();

	var win = window.open("", "enlarge", options);
	with (win.document) {
  		open("text/html", "replace");
  		write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n');
  		write('<html xmlns="http://www.w3.org/1999/xhtml">\n');
  		write('<head>\n');
  		write('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n');
  		write('<title>Superna | ' + alt + '</title>\n');
  		write('</head>\n');
  		write('<body topmargin="5" leftmargin="5" marginheight="5" marginwidth="5" bgcolor="#ffffff">\n');
  		write('<img src="' + src + '" width="' + img_w + '" height="' + img_h + '" alt="' + alt + '" />\n');
  		write('</body>\n');
  		write('</html>');
  		close();
	}

	win.focus();

	return false;
}

function popWindow(src, w, h)
{
	var img_w = w;
	var img_h = h;

	// adjust sizes for Firefox
	if (navigator.userAgent.indexOf("Firefox") != -1) {
		w = w + 29;
		//h = h + 15;
 	}

 	// window properties
	myw = Math.floor((screen.width - w)/2);
	myh = Math.floor((screen.height - h)/2);
	options = "toolbar=0,status=0,location=0,menubar=0,resizable=0,width=" + w + ",height=" + h + ",screenx=" + myw + ",screeny=" + myh + ",left=" + myw + ",top=" + myh;

	if (win && win.open && !win.closed) win.close();

	var win = window.open(src, "enlarge", options);
	win.focus();

	return false;
}

function fileNotice(url)
{
	if (document.getElementById('i_agree').checked)
	{
		location.href = url;
	}
	else
	{
		alert('Please read and confirm before proceeding with the software download')
		document.getElementById('i_agree_text').style.color = '#d40b49';
	}
}
