<!--

//////////////////////COMMON//////////////////////////////////////

//////////////////////////////////////////////////////////////////
function SetChildInputContent(inp,opts_obj,selected_parent_id,selected_child_id){
	if( inp && opts_obj){
		var child_list = opts_obj[selected_parent_id];
		SetInputContent(inp,child_list,selected_child_id,inp.id);
	}
}
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
function SetParentSelectContent(sel,opts_obj,selected_parent_id,header){
	if( sel && opts_obj){
		SetSelectContent(sel,opts_obj,selected_parent_id,header);
	}
}
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
function SetChildSelectContent(sel,all_opts_obj,selected_parent_id,selected_child_id,header){
	if( sel && all_opts_obj){
		var child_list = all_opts_obj[selected_parent_id];
		SetSelectContent(sel,child_list,selected_child_id,header);
	}
}
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
function SetSelectContent(sel,opts_obj,selected_id,header_is){
	if(!sel){
		alert("select element is not found");
		return;
	}
	var opts = sel.options;
	if(!opts){
		alert("select element is not found");
		return;
	}
	var header_text = "";
	var header_value = "null";
	if(header_is && opts.length != 0 ){
		header_text = opts[0].text;
		header_value = opts[0].value;
	}
	while( opts.length != 0 ){
		sel.remove(0);
	}
	var j = 0;
	if(header_is){
		var oOption = document.createElement("OPTION");
		oOption.text = header_text;
		oOption.value = header_value;
		if(navigator.appName=="Netscape"){
			sel.appendChild(oOption);
		}else{
			opts.add(oOption);
		}
		j++;
	}
	var selected = 0;
	if( opts_obj ){
		for( var i in opts_obj ){
			if( i instanceof Function || !opts_obj[i].id) continue;
			if(String(i)==String(selected_id)) selected = j;
			var oOption = document.createElement("OPTION");
			oOption.text = opts_obj[i].text;
			oOption.value = opts_obj[i].id;
			if(navigator.appName=="Netscape"){
				sel.appendChild(oOption);
			}else{
				opts.add(oOption);
			}
			j++
		}
	}
	sel.selectedIndex = selected;
}
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
function SetInputContent(inp,opts_obj,selected_id,selected_property){
	var tmp = "";
	if(opts_obj){
		if( opts_obj[selected_id] ) tmp = String( opts_obj[selected_id][selected_property] );
	}
	inp.value = tmp;
}
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
function OpenWindow(url,width,height,resizable)
{
  if ( String(resizable) == "undefined" )
  	resizable = "no";
  window.open(url,"","left="+((window.screen.width-width)/2)+",top="+((window.screen.height-height)/2)+",width="+width+",height="+height+",status=yes,toolbar=no,directories=no,location=no,scrollbars=yes,menubar=no,resizable="+resizable);
}
//////////////////////////////////////////////////////////////////
-->
