/*
HANUU.COM
2009-7-17
v1.0
*/
//打开窗口
function winOpen(url,name,width,height,left,top){
	if(!left)left = screen.availWidth/2 - width/2;
	if(!top)top   = screen.availHeight/2 - height/2;
	var newwin=window.open(url,name,"width="+width+"px,height="+height+",left="+left+",top="+top+",scrollbars=no");
	newwin.focus();
	return newwin;
}
//表单检查
function ckform(empty,equal,checked,selected) {
	//检查表单是否为空
	for(var i=0;i<empty.length;i++){
		if(empty[i][0].value=="") {
			alert(empty[i][1]);
			empty[i][0].focus();
			return false;
		}
	}
}
//复选框
function ckboxall(formid,ckallname,listname){
	var ckbox = document.getElementById(formid).document.getElementsByName(listname);
	for (var j=0; j<ckbox.length; j++){
		ckbox[j].checked=ckallname.checked;
	}
}
function ckboxitem(formid,ckallname,listname,curbox){
	var ckall = document.getElementsByName(ckallname)[0];
	if(!curbox.checked)ckall.checked = false;
	else{
		var ckbox = document.getElementById(formid).document.getElementsByName(listname);
		for (var j=0; j<ckbox.length; j++)
		if(!ckbox[j].checked) return;
		ckall.checked = true;
	}
}
function menustyle_1(htmlid,subid,level,sta) {
	var subbg   = document.getElementById("subbg_"+subid);
	var sublist = document.getElementById("sublist_"+subid);
	var pointer = document.getElementById("pt_"+subid);
	if(level==1){
		var subpoz    = 'menu_sub_poz1_'+htmlid;
		var overclass = 'supmouseover_'+htmlid;
		var outclass  = 'supmouseout_'+htmlid;
	}
	else {
		var subpoz    = 'menu_sub_poz2_'+htmlid;
		var overclass = 'submouseover_'+htmlid;
		var outclass  = 'submouseout_'+htmlid;
	}
	if(sta=="over"){
		if(subbg)subbg.className     = subpoz +' menu_sub_bg_'+htmlid;
		if(sublist)sublist.className = subpoz +' menu_sub_list_'+htmlid;
		pointer.className            = overclass;
	}
	else {
		if(subbg)subbg.className     = "hidden";
		if(sublist)sublist.className = "hidden";
		pointer.className            = outclass;
	}
}