var ns = false;
var ie = false;
var layerRef,embedRef;
var m_noteWin = null;
var m_testWin = null;

if (document.layers)
{
	ns = true;
	layerRef = "document.layers.";
	embedRef = "document.embeds.";
}
if (document.all)
{
 	ie = true;
	layerRef = "document.all.";
} 


function playSound(in_Name)
{
	if (ie)
	{
		if(eval(layerRef + in_Name))
		{
			eval(layerRef + in_Name + ".DoPlayPause();");
		}
	}
	
	if (ns)
	{
		eval(embedRef + in_Name + ".DoPlayPause();");
	}
}

function showNotes(in_url)
{
	var s_param = "width=370,height=200,left=20,top=20,resizable=yes,copyhistory=no,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no";
	m_noteWin = window.open(in_url, "notes", s_param);
}

function showTest(in_url)
{
	var s_param = "width=370,height=200,left=30,top=30,resizable=yes,copyhistory=no,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no";
	m_testWin = window.open(in_url, "Test", s_param);
}

// function for onunload;
function killChilds()
{
	closeWinInstance(m_noteWin);
	closeWinInstance(m_testWin);
}

//********************
function closeWinInstance(in_win)
{
	if (ie)
	{
		if(in_win != null)
		{
			if( !in_win.closed)
			{
/*
			    	if ( in_win.s_flag != null)
			    	{
			    		in_win.s_flag = false; 
			    	}
*/
				in_win.close();
			}
			in_win = null;
		}		
	}
	else if(ns)
	{
		if((in_win != null) && !in_win.closed)
		{
			if( !in_win.closed )
			{
/*
				if ( in_win.s_flag != null)
				{
			    		in_win.s_flag = false; 
			    	}
*/
			    in_win.close();
			}
			in_win = null;
		}	
	}
}