
function winOpen(page) 
{
	popupWin=open(page,"popup","status=yes,toolbar=no,directories=no,scrollbars=yes,menubar=no,resizable=yes")
	popupWin.focus()
	return false;
}

function bpressed(el,btn)
{
el.form.submitted.value=btn;
}

function selectplan(el,btn)
{
el.form.plan_name.value=btn;
}


function copyToList(from,to)
{


	//fromList = eval(form1 + 'category_1');
	
	//toList = eval(form1 + to);
	
	fromList=from;
	toList=to;
	if (toList.options.length > 0 && toList.options[0].value == 'temp')
	{
		toList.options.length = 0;
	}
	var sel = false;
	for (i=0;i<fromList.options.length;i++)
	{
		var current = fromList.options[i];
		if (current.selected)
		{
			sel = true;
			if (current.value == 'temp')
			{
				alert ('You cannot move this text!');
				return;
			}
			txt = current.text;
			val = current.value;
			toList.options[toList.length] = new Option(txt,val);
			fromList.options[i] = null;
			i--;
		}
	}
	if (!sel) alert ('You haven\'t selected any options!');
	
}

function phpPrepareForm(form1) 
{
	for ( i=0; i < form1.length; i++ )
	{
		if (form1.elements[i].type=="select-multiple")
		{
			namebrackets=form1.elements[i].name + "[]";
			form1.elements[i].name=namebrackets;
		}
	}
}


function allSelect(select1)
{
	List = select1;

	for (i=0;i<List.length;i++)
	{
		List.options[i].selected = true;
	}
	
}
