function OpenPopup(URL, width, height) {
	window.self.name = "main";
	var now = new Date();
	var remote = window.open(URL, "popup" + now.getTime(), "width=" + width + ",height=" + height + ",toolbar=0,location=0,directories=0,resizable=0,status=0,menubar=0,scrollbars=1");
}

function f_checkall(){
	var chbox = document.frm.check; 
	if(document.frm.checkall.checked) 
		for(i=0; i<chbox.length; i++) {
			chbox[i].checked = true;
			window.document.getElementById("col" + chbox[i].id).style.backgroundColor = "DFE0E2";
		}
	else 
		for(i=0; i<chbox.length; i++) {
			chbox[i].checked = false;
			window.document.getElementById("col" + chbox[i].id).style.backgroundColor = "FFFFFF";
		}
		
	//disable_but();
}

function is_all(obj) {
	//disable_but();
	
	var chbox = document.frm.check;
	var allchecked = true;
		
	for(i=0; i<chbox.length; i++){
		if(!chbox[i].checked) {
			allchecked = false;
			break;
		}
	}
	document.frm.checkall.checked = allchecked;
	if(obj.checked) {
		window.document.getElementById("col" + obj.id).style.backgroundColor = "DFE0E2"; 
	}
	else 
		window.document.getElementById("col" + obj.id).style.backgroundColor = "ffffff";
}

function disable_but() {
	var dis = true;
	var chbox = document.frm.check;
	for(i=0; i<chbox.length; i++){
		if(chbox[i].checked) {
			dis = false;
			break;
		}
	}
	var but = window.document.frm.act;
	for(i=0; i<but.length; i++) {
		if( but[i].value == "Hide unselected")
			but[i].disabled=dis;
	}
}

function check_selected(){
	var chbox = document.frm.check;
		
	for(i=0; i<chbox.length; i++){
		if(chbox[i].checked)
			return true;
	}
	alert("Please select at least one.");
	return false;
}
		


function goPage(f,page){
	document.frm.begin.value = f;
	document.frm.curpage.value = page;
	document.frm.showall.value = 1;
	document.frm.submit();
}
