//**************************************************************
// function toggle_display( item, image )					   *
//**************************************************************

function toggle_display( item, image )
{
	// get is none
	var is_none = ( document.getElementById( item ).style.display == "none" );
	
	// toggle state
	document.getElementById( item ).style.display = is_none ? "inline" : "none";
	
	// toggle image
	document.getElementById( image ).src = is_none ? "images/less.gif" : "images/more.gif";
}

//**************************************************************
// function download( file )								   *
//**************************************************************

function download( file )
{
	// do actual download
	window.open( file, '_self', '');
}

//**************************************************************
// function show_pplan_code()								   *
//**************************************************************

function show_pplan_code()
{
	// do actual download
	var wnd = window.open( 
		"pplan-code.aspx", 
		"regcode", 
		"menubar=0,status=0,toolbar=0,resizable=0,width=400,height=150" );
		
	// if not null...
	if ( wnd != null )
	{
		// set focus
		wnd.focus();
	} 
}

//**************************************************************
// function show_tab( menu, block )							   *
//**************************************************************

function show_tab( menu, block )
{
	// get divs
	var divs = document.getElementsByTagName("div");
	
	// for each div...
	for ( var item = 0; item < divs.length; item++ )
	{
		// if showcase_block...
		if ( divs[ item ].className == "showcase_block" )
		{
			// set to hidden
			divs[ item ].style.display = "none";
		}
	}
	
	// show block
	document.getElementById( block ).style.display = "inline";

	// get spans
	var spans = document.getElementsByTagName("span");
	
	// for each span...
	for ( var item = 0; item < spans.length; item++ )
	{
		// if showcase_menu_item...
		if ( spans[ item ].className == "showcase_menu_item" )
		{
			// set to normal
			spans[ item ].style.fontWeight = "normal";
		}
	}
	
	// bold menu
	document.getElementById( menu ).style.fontWeight = "bold";
}

//**************************************************************
// function enter_code( rb )								   *
//**************************************************************

function enter_code( rb )
{
	// set selected
	document.getElementById( rb ).checked = "checked";	
}
	
//**************************************************************
// function show_demo_window  								   *
//**************************************************************

function show_demo_window( demo )
{
	// set url
	var demo_url = "demo_frame.aspx?demo=" + demo;

	// open demo window
	var wnd = window.open( 
		demo_url, 
		"demo", 
		"menubar=0,status=0,toolbar=0,resizable=0,width=680,height=585" ); 
		
	// if not null...
	if ( wnd != null )
	{
		// set focus
		wnd.focus();
	} 
}

//**************************************************************
// function cvcinfo()										   *
//**************************************************************

function cvcinfo()
{
	window.open(
		'../images/cvc.jpg',
		'_blank',
		'width=430,height=325,status=no,resizable=no,scrollbars=no,left=50,top=50');
}
