function LOGIN_ZX() {
	with(document.form2) {
		if(zydm.value == "") {
			alert('请输入用户名');
			zydm.focus();
			return;
		}
		if(kl.value == "") {
			alert('请输入密码');
			kl.focus();
			return;
		}
		login("/hnzx/loginAction.do?ACT_TYPE=QUERY&zydm=" + zydm.value + "&kl=" + kl.value, kl);
	}
}
function LOGIN_HY() {
	with(document.form3) {
		if(zydm.value == "") {
			alert('请输入用户名');
			zydm.focus();
			return;
		}
		if(kl.value == "") {
			alert('请输入密码');
			kl.focus();
			return;
		}
		login("/hnzx/hyloginAction.do?ACT_TYPE=QUERY&zydm=" + zydm.value + "&kl=" + kl.value, kl);
	}
}
function login(url, kl) {
	var req;
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	req.onreadystatechange = function(){
		if (req.readyState == 4) {
			if (req.status == 200) {
				if (req.responseText == "SUCCESS") {
					window.location = "/hnzx/hygl.jsp";
				} else if (req.responseText == "HY_SUCCESS") {
					window.location = "/hnzx/hy_index.jsp";
				} else {
					alert("登录失败！");
					kl.value = "";
				}
			} else {
				alert("登录失败！");
				kl.value = "";
			}
		}
	};
	req.open("GET", url, true);
	req.send(null);
}
function menuGo(bm,path) {
  if(bm=="0"){
    window.location.replace("index.jsp");
  }else{
    window.location.replace("index_lm.jsp?bm="+bm+ "&content=" + path);
  }
}
function getNSRINFOR(jfid){
	window.open("/hnzx/content_detail.jsp?jfid="+jfid,"newwin","height=700px,width=900px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
}
function getNSRINFOR1(jfid){
	window.open("/hnzx/newsPictureDetailQueryAction.do?ACT_TYPE=QUERY&jfid="+jfid,"newwin","height=700px,width=900px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
}
function dzfwm(){
	var p = window.open("/hnzx/dzfwm_query.jsp","dzfwm","height=600px,width=850px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function cxda(){
	var p = window.open("/hnzx/cxda/cxda_query.jsp","cxdacx","height=700px,width=900px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function yjfk(){
	var p = window.open("/hnzx/yjfkAction.do?ACT_TYPE=QUERY","yjfk","");
	p.focus();
}
function hyts(){
	var p = window.open("/hnzx/hyts.jsp","hyts","height=530px,width=680px,top=50,left=240,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no");
	p.focus();
}
function mszxx(){
	var p = window.open("/hnzx/mszAction.do?ACT_TYPE=QUERY","mszxx","");
	p.focus();
}
function njsws(){
	var p = window.open("/hnzx/njsws_query.jsp","njcx","height=700px,width=900px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function kscj(){
	var p = window.open("/hnzx/kscj_query.jsp","kscjcx","height=600px,width=800px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function hycx(){
	var p = window.open("/hnzx/hy_query.jsp","hycx","height=600px,width=800px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function hydj(){
	var p = window.open("/hnzx/hydj_query.jsp","hydjcx","height=600px,width=800px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function hygh(){
	var p = window.open("/hnzx/hygh_query.jsp","hyghcx","height=600px,width=800px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function hytw(){
	var p = window.open("/hnzx/hytw_query.jsp","hytwcx","height=600px,width=800px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function download(){
	var p = window.open("/hnzx/download.do?ACT_TYPE=QUERY","download","");
	p.focus();
}
function fzynj(){
	var p = window.open("/hnzx/fzy_hynj_query.jsp","fzyhynj","height=700px,width=900px,top=10,left=10,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");
	p.focus();
}
function znss(){
	var wd = document.getElementById('searchbox').value;
	var url = "/hnzx/xxjs.do?ACT_TYPE=QUERY&title=" + wd;
	url = encodeURI(encodeURI(url));
	var p = window.open(url, "znss", "");
	p.focus();
}
function more(t){
	var p = window.open("/hnzx/more_" + t + ".jsp", t, "");
	p.focus();
}
function f_yqlj(url){
	window.open(url, "", "");
}
window.onload=function(){
	var speed = 10;
	document.getElementById("demo2").innerHTML = document.getElementById("demo1").innerHTML;
	function Marquee1(){
		if (document.getElementById("demo2").offsetWidth - document.getElementById("img_news").scrollLeft <= 0){
			document.getElementById("img_news").scrollLeft -= document.getElementById("demo1").offsetWidth;
		} else {
			document.getElementById("img_news").scrollLeft++;
		}
	}
	MyMar1 = setInterval(Marquee1,speed);
	document.getElementById("img_news").onmouseover = function() 
	{clearInterval(MyMar1);}
	document.getElementById("img_news").onmouseout = function() 
	{MyMar1=setInterval(Marquee1,speed);}
}


//左右侧浮动层
$(function() {
	var name = ".jrhc";
	var menuYloc = null;
	menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")));
	$(window).scroll(function () {
		var offset = menuYloc+$(document).scrollTop()+"px";
		$(name).animate({top:offset},{duration:500,queue:false});
	});
	$('.jrhc a').css('opacity','0');
	$(".jrhc span").click(function(){
		$(this).parent(".jrhc").siblings(".jrhc").remove();
		$(this).parent(".jrhc").remove();
	});
});


/*旧版本 重要公告滚动 
	$(function() {

		
		var myTimer = null;
		var topPos = 0;
		var innerHeight = 0;
		function iScroll() {
			topPos -= 1;
			$('.inner').css('top', topPos + 'px');
			if (innerHeight + topPos <= 0)
				topPos = 0;
		}
		innerHeight = $('.inner').height();
			var dom = "";
			for ( var i = 0; i < $('#notice_area').height() / innerHeight + 1; i++) {
				dom += $('.inner').html();
			}
			$('.inner').html(dom);
			myTimer = setInterval(iScroll, 30);
			$('.inner').bind('mouseover', function() {
				clearInterval(myTimer);
			});
			$('.inner').bind('mouseout', function() {
				myTimer = setInterval(iScroll, 30);
			});
	});
*/

//新版本 重要公告滚动 
$(document).ready(function(){
	//首页重要公告 滚动文字
	$(function(){
		//多行应用@Mr.Think
		var _wrap=$("#notice_area ul");//定义滚动区域
		var _interval=1000;//定义滚动间隙时间
		var _moving;//需要清除的动画
		_wrap.hover(function(){
		clearInterval(_moving);//当鼠标在滚动区域中时,停止滚动
		},function(){
			_moving=setInterval(function(){
			var _field=_wrap.find('li:first');//此变量不可放置于函数起始处,li:first取值是变化的
			var _h=_field.height();//取得每次滚动高度
			_field.animate({marginTop:-_h+'px'},600,function(){//通过取负margin值,隐藏第一行
			_field.css('marginTop',0).appendTo(_wrap);//隐藏后,将该行的margin值置零,并插入到最后,实现无缝滚动
		})
		},_interval)//滚动间隔时间取决于_interval
		}).trigger('mouseleave');//函数载入时,模拟执行mouseleave,即自动滚动
	});
});


