
var MaxTips;

function SetFaqCount(count)
{
	MaxTips = eval(count);

	// pre-cache images used for faq imageswap - eliminate swap delay
	blue = new Image();
	blue.src = "../images/faq_blue.gif";

	bright = new Image();
	bright.src = "../images/faq_bright.gif";

	gold = new Image();
	gold.src = "../images/faq_gold.gif"

	expand = new Image();
	expand.src = "../images/faq_expand.gif"

	collapse = new Image();
	collapse.src = "../images/faq_collapse.gif"
}

function On(index)
{
	if (document.getElementById('answer' + index).style.display == "none")
		document.getElementById('question' + index).style.background = 'url(../images/faq_bright.gif)';
}

function Off(index)
{
	if (document.getElementById('answer' + index).style.display == "none")
		document.getElementById('question' + index).style.background = 'url(../images/faq_blue.gif)';
}

function FAQ(index)
{
	DisplayNew = true;
	if (document.getElementById('answer' + index).style.display == "block")
		DisplayNew = false;

	for (i = 0; i <= MaxTips; i++)
	{
		document.getElementById('answer' + i).style.display = "none";
		document.getElementById('question' + i).style.background = 'url(../images/faq_blue.gif)';
		if (i > 0)
			document.getElementById('arrow' + i).src = "../images/faq_expand.gif";
	}

	if (DisplayNew)
	{
		document.getElementById('answer' + index).style.display = "block";
		document.getElementById('question' + index).style.background = 'url(../images/faq_gold.gif)';
		document.getElementById('arrow' + index).src = "../images/faq_collapse.gif";
	}
}

function OpenAll()
{
	window.location = "#top";

	if (document.getElementById('answer0').style.display == "block")
	{
		for (i = 0; i <= MaxTips; i++)
		{
			document.getElementById('answer' + i).style.display = "none";
			document.getElementById('question' + i).style.background = 'url(../images/faq_blue.gif)';
			if (i > 0)
				document.getElementById('arrow' + i).src = '../images/faq_expand.gif';
		}
	}
	else
	{
		for (i = 0; i <= MaxTips; i++)
		{
			document.getElementById('answer' + i).style.display = "block";
			document.getElementById('question' + i).style.background = 'url(../images/faq_gold.gif)';
			if (i > 0)
				document.getElementById('arrow' + i).src = "../images/faq_collapse.gif";
		}
	}
}

function ShowProducts(section, button)
{
	var section = document.getElementById(section);
	var button = document.getElementById(button);

	if (section.style.display == "none")
	{
		section.style.display = "block";
		button.src = "images/minus.gif";
	}
	else
	{
    	section.style.display = "none";
		button.src = "images/plus.gif";
	}
}

function DisplaySection(showSection, hideSection)
{
	var hideSection = document.getElementById(hideSection);
	var showSection = document.getElementById(showSection);

	hideSection.style.display = "none";
	showSection.style.display = "block";
}

function isDemoOk()
{
	IsOk = true;
	bver = Math.round(parseFloat(navigator.appVersion) * 1000);

	if (navigator.appName.substring(0,8) == "Netscape")
	{
		if ((bver < 5000) && (navigator.appVersion.indexOf("Mac") > 0))
			IsOk = false;
		else if (bver < 4060)
			IsOk = false;
	}

	if (navigator.appName.substring(0,9) == "Microsoft")
	{
		if (bver < 4000)
			IsOk = false;
	}

	plugins = navigator.plugins;

	if (plugins != null && IsOk == false)
	{
		for (i = 0; i != plugins.length; i++)

		if ((plugins[i].name.indexOf("1.0") < 0) && (plugins[i].name.indexOf("Java Plug-in") >= 0))
			IsOk = true;
	}

	return IsOk;
}

function openDemo(htmlFile, htmlWidth, htmlHeight)
{
	var bua = navigator.userAgent;

	s = 'resizable=0,toolbar=0,menubar=0,scrollbars=0,status=0,location=0,directory=0,width=350,height=200';

	if (!isDemoOk())
		open("http://www.turbodemo.com/error.html",'',s);
	else
	{
		if (bua.indexOf("Opera") != -1)
			window.open(htmlFile + ".html",'','width=' + htmlWidth + ',height=' + htmlHeight + ',top=10,left=10');
		else
			window.open(htmlFile + ".html",'','width=' + htmlWidth + ',height=' + htmlHeight + ',top=10,left=10');
	}
}
