// JavaScript 
// Controls the Tab slide-down

var tabs = new Array();

function closeAlltabs( s  )
{
	
	for (i=0; i<tabs.length; i++)
	{
		var id = document.getElementById(tabs[i]);
		if( id != null && s != tabs[i] )
		{
			id.style.display = 'none';
			var el = document.getElementById( "a_" + tabs[i] );
			if( el != null )
			{
				el.className="not";	
			}
		}
	}
	var el = document.getElementById ( "a_" + s );
	if ( el != null )
	{
		if( el.className == "selected" )
		{
			el.className="not";
		}
		else
		{
			el.className="selected";
		}
		//el.blur();
	}
}

/* New Tab Function 3/8/2010 */

function showFeatureTab( s, h )
{
	var showTabId = $( s );
	showTabName = s;
	if( showTabId != null )
	{
		showTabId.show();
		$( "a_" + showTabName ).removeClassName( 'not' );
		$( "a_" + showTabName ).addClassName( 'selected' );
		
	}
		
	if( h != null )
	{
		for (i=0; i<h.length; i++)
		{
			var hideTabId = $( h[i] );
			hideTabName = h[i];
		
			if(hideTabId != null )
			{
				hideTabId.hide();
				$( "a_" + hideTabName ).removeClassName( 'selected' );
				$( "a_" + hideTabName ).addClassName( 'not' );
			}
		}
	}
}
function toggleTab( f, c )
{	
	var cl = c;
	tabs = new Array("lTabOne","lTabTwo","lTabThree","lTabFour","lTabFive","lTabSix","lTabSeven","lTabEight");
	//leave tabs open on product pages so visitor can compare features
	if( cl == 'closeall' ) 
	{
		closeAlltabs(f);
	}
	var el = document.getElementById( f );
	new Effect.toggle(el,'blind', {duration: 0.5});
}
function showTab( f, c )
{	
	var cl = c;
	tabs = new Array("lShowTabOne","lShowTabTwo","lShowTabThree","lShowTabFour","lShowTabFive");
	//leave tabs open on product pages so visitor can compare features
	if( cl == 'closeall' ) 
	{
		closeAlltabs(f);
	}
	var el = document.getElementById( f );
	el.style.display = 'block';
}

// Report Popups 
function popup( popup, image )
{
	var img_path = '/include/images/products/reports/';
	
	var id = document.getElementById( popup ).getElementsByTagName('img')[0];
	//var id = document.getElementById( popup );
	
	if( id != null )
	{
		id.src = img_path + image;
	}
	else
	{
		alert("ID is null");
	}
	
	var id = document.getElementById( popup );
	if( id != null )
	{
		id.style.display = 'block';
	}
	
	
}
function closePopup( popup )
{
	var img_path = '/include/images/products/reports/';
	var id = document.getElementById( popup ).getElementsByTagName('img')[0];
	//var id = document.getElementById( popup );
	if( id != null )
	{
		id.src = img_path + 'popupClear.jpg';
	}
	
	var id = document.getElementById( popup );
	if( id != null )
	{
		id.style.display = 'none';
	}
}

//
// Quote Forum check for Educational prospects and change Users to Systems
//
//
function typeOfOrganization( value )
{
	if( value != null )
	{
		if( value == "Education" )
		{
			var id = document.getElementById( "nonEDU" );
			if( id != null )
			{
				id.style.display = 'none';
			}
			var id = document.getElementById( "nonEDUNote" );
			if( id != null )
			{
				id.style.display = 'none';
			}
			var id = document.getElementById( "EDU" );
			if( id != null )
			{
				id.style.display = 'block';
			}
			var id = document.getElementById( "EDUNote" );
			if( id != null )
			{
				id.style.display = 'block';
			}
		}
		else
		{
			var id = document.getElementById( "nonEDU" );
			if( id != null )
			{
				id.style.display = 'block';
			}
			var id = document.getElementById( "nonEDUNote" );
			if( id != null )
			{
				id.style.display = 'block';
			}
			var id = document.getElementById( "EDU" );
			if( id != null )
			{
				id.style.display = 'none';
			}
			var id = document.getElementById( "EDUNote" );
			if( id != null )
			{
				id.style.display = 'none';
			}
		}
	
	}
	var id = document.getElementById( popup );
	if( id != null )
	{
		id.style.display = 'block';
	}
}
	
