
function set_select_to_null(select)
{
    while( select.options.length > 0 ) {
 	   select.options[0] = null;   
    }
}

function new_options_list(obj,newselect) {
   set_select_to_null(obj);
   for(i=0;i<newselect.length;i++){
     obj.options[obj.options.length] = new Option( newselect[i][1], newselect[i][0], false, false);
   } 
}

function clear_umbrueche(val) {
	while(val.indexOf(String.fromCharCode(13)) >= 0) {
	  val = val.replace(String.fromCharCode(13),"\\n");
	}
	while(val.indexOf(String.fromCharCode(10)) >= 0) {
	  val = val.replace(String.fromCharCode(10),"\\n");
	}
	return val;
}

var new_win = null;
function f_OpenWin(url,name,x,y,scrollbars,resizable) {
  if( ! resizable ) resizable = "yes";
  if( ! scrollbars ) scrollbars = "no";
  //if( ! new_win )
    new_win = open( url, name,"width=" + x + ",height=" + y + ",resizable=" + resizable + ",scrollbars=" + scrollbars );
  if(new_win) {
    new_win.focus();
    if( new_win.scrollbars )
      new_win.scrollbars.visible = true;
  }
}

function set_text_element(txt,ele) {
  if(txt=="")
    txt = " ";
  if( document.getElementById ) {
	document.getElementById(ele).firstChild.nodeValue = txt;
  }
}

function select_combovalue(obj,val) {
  for(i=0; i < obj.options.length; i++) {
    if(obj.options[i].value == val) {
      obj.options[i].selected = true;
      break;
    }
  }
}

function select_combotext(obj,val) {
  for(i=0; i < obj.options.length; i++) {
    if(obj.options[i].text == val) {
      obj.options[i].selected = true;
      break;
    }
  }
}


