/* ----------------------------------------------------------------------------
Description: site-specific JavaScript utility functions.
Copyright (c) 2000, by Competitive Computing, Inc.
-----------------------------------------------------------------------------*/

// This function is called from within submitPage()
// if the return value is hard-coded to true, then
// the event arg list will always be cleared at the
// beginning of submitPage().  
// This prevents the possibility of a state being 
// passed extra event args (such as when a user 
// clicks on two buttons in rapid succession)

function _solutionAlwaysClearEventArgs()
{
	return true;
}


function okToLeavePage()
{
	if (g_blnPageDirty)
		return confirm(g_strMsgOkToLeavePage);
	else
		return true;
}


function okToDeleteRecord(strDescription)
{
	return confirm(strDescription + g_strMsgOkToDeleteRecord);
}


function one2two(strMenu1,strMenu2) {
	m1 = eval("document.frm." + strMenu1);
	m2 = eval("document.frm." + strMenu2);

	m1len = m1.length ;
	for ( i=0; i < m1len ; i++){
		if (m1.options[i].selected == true ) {
			m2len = m2.length;
	        m2.options[m2len]= new Option(m1.options[i].text, m1.options[i].value);
	    }
	}

	for ( i = (m1len -1); i >= 0 ; i--)
	{
		if (m1.options[i].selected == true ) {
			m1.options[i] = null;
	    }
	}
}

function two2one(strMenu1,strMenu2) {
	m1 = eval("document.frm." + strMenu1);
	m2 = eval("document.frm." + strMenu2);

	m2len = m2.length ;
	for ( i=0; i < m2len ; i++){
		if (m2.options[i].selected == true ) {
			m1len = m1.length;
	        m1.options[m1len]= new Option(m2.options[i].text, m2.options[i].value);
        }
	}
    for ( i=(m2len-1); i >= 0; i--) {
		if (m2.options[i].selected == true ) {
			m2.options[i] = null;
        }
    }
}
