function disExt()
{	 
	var exts = document.all("extValue");
	if(exts != null && exts.length > 0)
	{
		for(var i=0;i<exts.length;i++)
		{
			if(exts[i].style.display == "")
			{
				exts[i].style.display = "none";
			}
			else
			{
				exts[i].style.display = "";
			}
		}
	}
}
//跳转到某页
function pageto(url,pageCount) {
	var pid = document.forms[0].pageIndex.value;
	if(pid==null||pid==""){
		alert("不能为空");
		document.forms[0].pageIndex.focus();
		return false;
	}
	pid = pid.replace(/^\s+|\s+$/g,"");
	var reg=/[^0-9]/;
	if(reg.test(pid)){
		alert("需填写数字!");
		return false;
	}
	pid = parseInt(pid,10);
	pageCount = parseInt(pageCount,10);
	if(event.keyCode == 13) {
		if(pid>pageCount||pid<1){
			alert("没有这一页！");
			return false;
		}
		document.forms[0].action=url+"&pageIndex="+pid;
		document.forms[0].submit();
	}
}

function pageto1(url,pageCount) {
	var pid = document.forms[0].pageIndex.value;
	if(pid==null||pid==""){
		alert("不能为空");
		document.forms[0].pageIndex.focus();
		return false;
	}
	pid = pid.replace(/^\s+|\s+$/g,"");
	var reg=/[^0-9]/;
	if(reg.test(pid)){
		alert("需填写数字!");
		return false;
	}
	pid = parseInt(pid,10);
	pageCount = parseInt(pageCount,10);
	if(pid>pageCount||pid<1){
		alert("没有这一页！");
		return false;
	}
	document.forms[0].action=url+"&pageIndex="+pid;
	document.forms[0].submit();
}


function searchSubmit()
{    
    var searchText=document.all.searchText.value;
	var qsrq=document.all.qsrq.value;
	var zzrq=document.all.zzrq.value;
	var classid=document.all.classid.value;
	if(searchText==null||searchText.replace(/ /g,"")==""||searchText.replace(/　/g,"")==""){
		alert("请输入关键字！");
		return false;
	}else{
		window.location.href="/web/news/search6.jsp?searchText="+searchText+"&qsrq="+qsrq+"&zzrq="+zzrq+"&classid="+classid+"&fg=54&kind=80&pageIndex=1";	
	}
}
function searchSubmit1()
{    
    var searchText=document.all.searchText.value;
	var sc=document.getElementById("select3").value;
	var qsrq=document.all.qsrq.value;
	var zzrq=document.all.zzrq.value;
	var classid=document.all.classid.value;
	if(searchText==null||searchText.replace(/ /g,"")==""||searchText.replace(/　/g,"")==""){
		alert("请输入关键字！");
		return false;
	}else{
		window.location.href="/web/news/search5.jsp?searchText="+searchText+"&sc="+sc+"&qsrq="+qsrq+"&zzrq="+zzrq+"&classid="+classid+"&fg=53&kind=80&pageIndex=1";	
	}
}
function searchSubmit2()
{    
    var searchText=document.all.searchText.value;
	if(searchText==null||searchText.replace(/ /g,"")==""||searchText.replace(/　/g,"")==""){
		alert("请输入关键字！");
		return false;
	}else{
		window.location.href="/web/news/search.jsp?searchText="+searchText+"&fg=96&kind=122&pageIndex=1";	
	}
}
function searchSubmit3()
{    
    var searchText=document.all.searchText.value;
	var sc=document.getElementById("select3").value;
	var qsrq=document.all.qsrq.value;
	var zzrq=document.all.zzrq.value;
	var anniu;
	var radioes = document.getElementsByName("radiobutton"); 
	for(var i=0;i<radioes.length;i++)
        {
            if(radioes[i].checked==true)
            {
                anniu=radioes[i].value;
            }
        }

	if(searchText==null||searchText.replace(/ /g,"")==""||searchText.replace(/　/g,"")==""){
		alert("请输入关键字！");
		return false;
	}else{
		window.location.href="/web/news/search4.jsp?searchText="+searchText+"&sc="+sc+"&qsrq="+qsrq+"&zzrq="+zzrq+"&anniu="+anniu+"&fg=51&kind=80&pageIndex=1";	
	}
}
function searchSubmit4()
{    
    var searchText=document.all.searchText.value;
	var sc="全部市场";
	var qsrq=document.all.qsrq.value;
	var zzrq=document.all.zzrq.value;
	var classid=document.all.classid.value;
	if(searchText==null||searchText.replace(/ /g,"")==""||searchText.replace(/　/g,"")==""){
		alert("请输入关键字！");
		return false;
	}else{
		window.location.href="/web/news/search5.jsp?searchText="+searchText+"&sc="+sc+"&qsrq="+qsrq+"&zzrq="+zzrq+"&classid="+classid+"&fg=53&kind=80&pageIndex=1";	
	}
}
//鼠标点击清空文字
function clearUp(){
	document.forms[0].searchText.value = "";
}
//控制图片
function DrawImage(ImgD,FitWidth,FitHeight)
{     
	var image=new Image();     
	image.src=ImgD.src;     
	if(image.width>0 && image.height>0){
		if(image.width/image.height>= FitWidth/FitHeight){
			if(image.width>FitWidth){
				ImgD.width=FitWidth;
				ImgD.height=(image.height*FitWidth)/image.width;
			}else{ 
					ImgD.width=image.width;
					ImgD.height=image.height; 
			} 
		} else{
			if(image.height>FitHeight){
				ImgD.height=FitHeight;
				ImgD.width=(image.width*FitHeight)/image.height;
			}else{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}
	} 
} 

function validateext()
{
	if(document.forms[0].uid.value==null||document.forms[0].uid.value=="")
	{

		alert("您的用户名不能为空");
        document.forms[0].uid.focus();
		return false;
	}else if(document.forms[0].pwd.value==null||document.forms[0].pwd.value==""){
	    alert("您的密码不能为空");
		document.forms[0].pwd.focus();
		return false;
	}
	else{
		document.forms[0].action="/web/news/sky.jsp?fg=132&kind=125&kd=login";
		document.forms[0].submit();
	}
}
/*触发回车键*/
function loginwrap(url,pageCount) {
	if(event.keyCode == 13) {
		pageto(url,pageCount);
	}
}
//注销
function logout(context){
	document.forms[0].action=context+"/web/news/logout.jsp";
	document.forms[0].submit();
}
//重置
function reset(){
	document.forms[0].uid.value="";
	document.forms[0].pwd.value="";
	document.forms[0].uid.focus();
}

function hangqing(){
	window.open("http://192.168.0.215:16901/hqApplet/hq.html");
}
/*function shuaxin()
{    
	var sc=document.getElementById("select").value;
		var url = "";
		if(sc=="吉林玉米"){
			url = "/web/info/hq2.jsp";
		}
		if(sc=="中国果品"){
			url = "/web/info/hq1.jsp";
		}
		window.location.href=url;	
}*/
function wpz(id,type){
	window.open("/web/hyzq/wpz_error.jsp?id="+id+"&type="+type+"","cw","height=200,width=350,status=yes,toolbar=no,top=400,left=400,menubar=no,location=no,resizable=no,scrollbars=yes")
}
function dhhzb(uid,sTimeStr,pwd){
	window.open("http://192.168.0.212:16901/unitrade_manager/register/statements.jsp?customerid="+uid+"&baobiao=3&date="+sTimeStr+"&ps="+pwd+"","bb","height=1000,width=1100,status=yes,toolbar=no,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=yes")
}
function dhmxb(uid,sTimeStr,pwd){
	window.open("http://192.168.0.212:16901/unitrade_manager/register/statements.jsp?customerid="+uid+"&baobiao=2&date="+sTimeStr+"&ps="+pwd+"","bb","height=1000,width=1100,status=yes,toolbar=no,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=yes")
}
function cjhzb(uid,sTimeStr,pwd){
	window.open("http://192.168.0.212:16901/unitrade_manager/register/statements.jsp?customerid="+uid+"&baobiao=1&date="+sTimeStr+"&ps="+pwd+"","bb","height=1000,width=1100,status=yes,toolbar=no,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=yes")
}
function cjmxb(uid,sTimeStr,pwd){
	window.open("http://192.168.0.212:16901/unitrade_manager/register/statements.jsp?customerid="+uid+"&baobiao=0&date="+sTimeStr+"&ps="+pwd+"","bb","height=1000,width=1100,status=yes,toolbar=no,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=yes")
}
function zjjsb(uid,sTimeStr,pwd){
	window.open("http://192.168.0.212:16901/unitrade_manager/register/statements.jsp?customerid="+uid+"&baobiao=4&date="+sTimeStr+"&ps="+pwd+"","bb","height=1000,width=1100,status=yes,toolbar=no,top=0,left=0,menubar=no,location=no,resizable=no,scrollbars=yes")
}
