function DisplayHelp( ID, w, h )
{
	open( ID, "popupWindow", "scrollbars=yes,width=" + w + ",height=" + h + ",status=0,toolbar=1,menubar=0,resizable=1"); 
}

function Display2nd( ID, w, h )
{
	open( ID, "popupWindow2", "scrollbars=yes,width=" + w + ",height=" + h + ",status=0,toolbar=1,menubar=0,resizable=1"); 
}

function OpenSurveyDesigner( ID, w, h )
{
	open( ID, "SurveyDesigner", "scrollbars=yes,width=" + w + ",height=" + h + ",status=0,toolbar=1,menubar=0,resizable=1"); 
}

function DisplayPopup( ID, w, h )
{
	open( ID, "surveyPopup", "scrollbars=yes,width=" + w + ",height=" + h + ",status=0,toolbar=0,menubar=0,resizable=1"); 
}

function DisplaySurvey( ID, w, h )
{
	open( ID, "AVNSurvey", "scrollbars=yes,width=" + w + ",height=" + h + ",status=0,toolbar=0,menubar=0,resizable=0"); 
}

function OurCheckAll( state )
{
	var theForm = document.forms(0);
	var eSrc = window.event.srcElement;

	for ( i = 0; i < theForm.length; i++ )
	{
		//theForm.item( i ).checked = state;
		if ( theForm.item(i).className == 'AVNCheckbox' ) 
		{
			if ( eSrc.checked )
				theForm.item(i).checked = true;
			else
				theForm.item(i).checked = false;
		}
	}
}	

function CheckAllClass( classstring )
{
	var theForm = document.forms(0);
	var eSrc = window.event.srcElement;

	for ( i = 0; i < theForm.length; i++ )
	{
		//theForm.item( i ).checked = state;
		if ( theForm.item(i).className == classstring ) 
		{
			if ( eSrc.checked )
				theForm.item(i).checked = true;
			else
				theForm.item(i).checked = false;
		}
	}
}

function showHideContent(id,bOn)
{
	var bMO = false;
	var oContent = document.all.item(id+"Content");
	var oImage   = document.all.item(id+"Button");
	if (!oContent || !oImage) return;

	if (event.srcElement)
	{
		bOn = (oContent.style.display.toLowerCase() == "none");
	}

	if (bOn == false)
	{
		oContent.style.display = "none";
		oImage.src = "/secure/images/avn_check_blank.gif";
	}
	else
	{
		oContent.style.display = "";
		oImage.src = "/secure/images/avn_check.gif";
	}
}

function ToggleCheckBox( id, bOn )
{
	var bMO = false;
	var oContent = document.all.item( id + "Content" );
	if (!oContent) return;

	if (event.srcElement)
	{
		bOn = (oContent.style.display.toLowerCase() == "none");
	}

	if (bOn == false)
		oContent.style.display = "none";
	else
		oContent.style.display = "";
}

function HilightRow(id)
{
	var bMO = false;
	var oContent = document.all.item("Row"+id);
	if (!oContent) return;
/*
	if (event.srcElement)
	{
		bOn = (oContent.style.background.toLowerCase() == "#eeeeee");
	}

	if (bOn == false)
	{
		oContent.style.background = "#eeeeee";
	}
	else
	{
		oContent.style.background = "";
	}
*/
	if ( event.srcElement )
	{
		if ( event.srcElement.checked )
			oContent.style.background = "#eeeeee";
		else
			oContent.style.background = "";
	}	
}

function TabHiliteRow( id )
{
	var bMO = false;
	var oContent = document.all.item("Row"+id);
	if (!oContent) return;

	if ( event.srcElement )
	{
		if ( event.srcElement.checked )
			oContent.className = "TabRowHiLite";
		else
			oContent.className = "";
	}		
}

