/******************************************
 *
 * BitifEye
 *
 ******************************************/

function ShowOnly(element)
{
	var isContiguous = document.getElementById('allresults').checked;
	
	if(isContiguous)
	{
		document.getElementById(element).scrollIntoView();
	}
	else
	{	
		var listOfElements;
		if (isInternetExplorer())
			listOfElements = document.querySelectorAll('div.procedure');
		else
			listOfElements = document.getElementsByClassName('procedure');
		
		for(index = 0; index < listOfElements.length; ++index)
		{	
			if (element == listOfElements[index].id)
			{
				document.getElementById(listOfElements[index].id).style.display = 'block';
			}
			else
			{
				document.getElementById(listOfElements[index].id).style.display = 'none';
			}
		}
		
		if (isInternetExplorer())
			listOfElements = document.querySelectorAll('hr.procfooter');
		else
			listOfElements = document.getElementsByClassName('procfooter');
		for(index = 0; index < listOfElements.length; index++)
		{
			listOfElements[index].style.display = "none";
		}
	}
}
			
function ShowAll()
{
	var listOfElements;
	if (isInternetExplorer())
		listOfElements = document.querySelectorAll('div.procedure');
	else
		listOfElements = document.getElementsByClassName('procedure');
	for(index = 0; index < listOfElements.length; ++index)
	{
		document.getElementById(listOfElements[index].id).style.display = 'block';
	}
	
	if (isInternetExplorer())
		listOfElements = document.querySelectorAll('hr.procfooter');
	else
		listOfElements = document.getElementsByClassName('procfooter');
	for(index = 0; index < listOfElements.length; index++)
	{
		listOfElements[index].style.display = 'block';
	}
}

function PrintAll()
{
	var restorePage = document.body.innerHTML;
	
	var listOfElements;
	if (isInternetExplorer())
		listOfElements = document.querySelectorAll('div.procedure');
	else
		listOfElements = document.getElementsByClassName('procedure');
	var printContent = "";
	for(index = 0; index < listOfElements.length; ++index)
	{
		if(document.getElementById(listOfElements[index].id).style.display == 'block')
			printContent = printContent + document.getElementById(listOfElements[index].id).innerHTML;
	}
	document.body.innerHTML = printContent;
	window.print();
	document.body.innerHTML = restorePage;
}

// Returns true if the Browser is Internet Explorer
function isInternetExplorer()
{
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		return true;
	}
	else
	{
		return false;
	}
}