function newWindow(file, window, w, h) 
{
    msgWindow=open(file,window,'resizable=no,width='+w+',height='+h+',titlebar=no,toolbar=no,scrollbars=yes');
    if (msgWindow.opener == null) msgWindow.opener = self;
}  
function changeDynaList_contend( listname, source, key, orig_key, orig_val ) {
			var list = eval( listname );
			//var list = document.getElementById(listname);

			// empty the list
			 var str = '<table border="0" cellspacing="6" cellpadding="0"><tr>'
		
               
                
               
			str +=''
			str += '<td width="170px"><input type="checkbox" name="bdsqh_main" id="bdsqh_main" value="1" class="cb_sty" onClick="add_qhmain()" checked/>Tất cả&nbsp;&nbsp;&nbsp;</td>'
			s = 1
			for (x in source) {
				if (source[x][0] == key) {
				
					str +='<td width="170px"><input type="checkbox" name="bds_2" id="bds_2" value="'+source[x][1]+'" class="cb_sty" onClick="return add_qh(this)"/>'+source[x][2]+'&nbsp;&nbsp;&nbsp;</td>'
					s++
					if(s%3==0)
						str +='</tr><tr>'
				}
			}
			str += '</tr></table><input name="qh_main" id="qh_main" type="hidden" value="" />'
			con = document.getElementById('bdsqh_contend'); 
			con.innerHTML = str;
			
			
		}
	function add_qhmain(){
			//alert('ddd');
			qh_main = document.getElementById('qh_main'); 
			
			qh_main.value ='';
			
			
			
			
		}
		function add_qh(cb){
			bd = document.getElementById('bdsqh_main'); 
			bd.checked = false;
			qh_main = document.getElementById('qh_main'); 
			
			var val_old  = qh_main.value;
			qh_main.value = val_old + '_' + cb.value;
		
			//return true;
			
			
		}
		function changeDynaList( listname, source, key, orig_key, orig_val ) {
			var list = eval( listname );
			//var list = document.getElementById(listname);

			// empty the list
			for (i in list.options.length) {
				list.options[i] = null;
			}
			i = 0;
			opt = new Option();
			opt.value = '';
			opt.text = 'Tất cả';
			opt.selected = true;
			list.options[i++] = opt;
			for (x in source) {
				if (source[x][0] == key) {
					opt = new Option();
					opt.value = source[x][1];
					opt.text = source[x][2];

					
					list.options[i++] = opt;
				}
			}
			
			list.length = i;
		}
		