//#$Id: common.js,v 1.7 2003/07/09 16:39:10 hy Exp amak $

function TermsPop(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=1,width=525,height=375,left=262,top=134');"); }
function filter_form($val)
{
	document.forms[0].limit.value=$val;
	document.forms[0].submit() ;

}

		function popup(url) {
		  window.open(url,'popup','width=450,height=420,top=100,left=100,resizable=0,scrollbars=yes,titlebar=0,toolbar=0,menubar=0,location=0,status=0,directories=0');
		}
    
function submit_button(action)
{
	document.entry.action = action;
	document.entry.submit();
}
function selectUsers () {
  url = "usersel.php?form=editviewform&listid=3&users=";
  // add currently selected users
  for ( i = 0, j = 0; i < document.forms[0].elements[3].length; i++ ) {
    if ( document.forms[0].elements[3].options[i].selected ) {
      if ( j != 0 )
	url += ",";
      j++;
      url += document.forms[0].elements[3].options[i].value;
    }
  }
  //alert ( "URL: " + url );
  // open window
  window.open ( url, "UserSelection",
    "width=500,height=500,resizable=yes,scrollbars=yes" );
}

function confirm_execute(message,command)
{
	var answer = confirm(message);
	if (answer) {
		document.location = command;
		return false;
	}
}
//change given Id (d_name) background color 
function bcolor(bcol, d_name)
{
	if (document.all)
	{
	 var thestyle = eval ('document.all.'+d_name+'.style');
	 thestyle.backgroundColor=bcol;
	}
}

//Place cursor at with the given input box
function setfocus(form_name, input_name)
{
	var theform = eval ('document.'+form_name+'.'+input_name);
	theform.focus();
}
  
