function openwin(furl,model,width,height)
{
    height=height-30;
    c_x = screen.width - width - 40;
    if (c_x>0){c_x=c_x/2;}
    else{c_x=0;}
    c_y = screen.height - height- 180;
    if (c_y>0){c_y=c_y/2;}
    else{c_y=0;}
	if(model==' ') model='';
    window.open(furl,model,"width="+width+",height="+height+",top="+c_y+",left="+c_x+",resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no");
}
function opendatewin(furl,nameid)
{
  var whichdate = window.showModalDialog(furl+"?datefield="+nameid,null,"dialogwidth=307px;dialogheight=208px;center=yes");
  if((whichdate!=null)&&(whichdate!="")){
  	document.all(nameid).value=whichdate;		
  }
}
function cbox(name){
	var cboxobj=document.all(name);
	checksta=cboxobj.checked;
	for(var i=0;i<document.form.length;i++){
		if(document.form.elements[i].type=="checkbox"){
				document.form.elements[i].checked=checksta;
		}
	}
}
function cbox2(){//表格复选框选择情况
	for(var i=0;i<document.form.length;i++){
		if(document.form.elements[i].type=="checkbox"&&document.form.elements[i].checked==true){
			if(document.form.elements[i].name!="checkbox"){
				return true;
			}
		}
	}
	alert("请选择列表中的复选框！");
	return false;
}
function cbox3(messagestr){//表格复选框选择情况
	for(var i=0;i<document.form.length;i++){
		if(document.form.elements[i].type=="checkbox"&&document.form.elements[i].checked==true){
			if(document.form.elements[i].name!="checkbox"){
				return true;
			}
		}
	}
	alert("请选择所要删除的"+messagestr+"！");
	return false;
}
