<!--
////////////////////////////
// General Functions
////////////////////////////

function popURL(p_url, p_width, p_height)
{	
	window.open(p_url,"","width=" + p_width + ",height=" + p_height + ",scrollbars,resizable")
}

// p_limit - returns  at most p_limit split, where the last element encompasses the rest of the string
function splitLimit(p_str, p_separator, p_limit)
{
	var r_arrSplit;
	
	r_arrSplit = p_str.split(p_separator, p_limit);	// CCFIX:: don't want to chop off rest of string
	
	return (r_arrSplit);
}

function in_array(p_arr, p_val)
{
	for (var i=0; i<p_arr.length; i++)
	{
		if (p_arr[i] == p_val)
			return (true);
	}
	return (false);
}

function AddOptToBox(t_box, t_value, t_text)
{
	var len = t_box.length;
	t_box.options[len] = new Option();
	t_box.options[len].value = t_value;
	t_box.options[len].text = t_text;
}

function DelOptFromBox(t_box, t_idx)
{
	t_box.options[t_idx] = null;
}

function MoveToBoxByIdx(t_fromIdx, fromBox, toBox)
{
	var t_fromOpt = fromBox.options[t_fromIdx];
	
	AddOptToBox(toBox, t_fromOpt.value, t_fromOpt.text);
	DelOptFromBox(fromBox, t_fromIdx);
}

// p_destURL - destination URL
// p_method - "get" or "post"
// p_hidElem	- Hidden Elem to set the value
// p_hidValue	- Sets the created Hidden element with this value
function submitForm(p_destURL, p_method, p_hidElem, p_hidValue)
{
	var t_form = p_hidElem.form;
	// Set Hidden value in the form
	p_hidElem.value = p_hidValue;
	// Set Method and DestURL
	t_form.method = p_method;
	t_form.action = p_destURL;

	// Submits the from
	t_form.submit();
}
//-->
