function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

 
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function gotoPage(pagenum){
	document.PageForm.jumpPage.value = pagenum;
	document.PageForm.submit();
	return;
}

function jumping(){
  document.PageForm.submit();
  return ;
}

function checkLogin1(n) {
	
	var userName = document.getElementById("stock_so")
	if (n == 0 && userName.value == "输入股票代码或简称"){userName.value="";}
	if (n == 1 && userName.value == ""){userName.value = "输入股票代码或简称";}
}

function search(n) {

	var userName = document.getElementById("stockid")
	if (n == 0 && userName.value == "输入股票代码"){userName.value="";}
	if (n == 1 && userName.value == ""){userName.value = "输入股票代码";}
}

function check()
{
	var checkIdObj = eval("form1.checkbox1"); 
	var t = "";
	//判断对象是否为空 
    if (checkIdObj == null) 
	{ 
        return; 
    }	
    for (i=0; i<checkIdObj.length; i++) 
	{ 
        if(checkIdObj[i].checked)
		{ 	
		   t = t + checkIdObj[i].value ;
        } 
    } 
	document.form1.t.value = t;	
	document.form1.submit();
}


function RadioCheck()
{
	var checkIdObj = eval("form1.radiobutton"); 
	var t = "";
	//判断对象是否为空 
    if (checkIdObj == null) 
	{ 
        return; 
    }	
    for (i=0; i<checkIdObj.length; i++) 
	{ 
        if(checkIdObj[i].checked)
		{ 	
		   t = t + checkIdObj[i].value ;
        } 
    } 
	document.form1.t.value = t;	
	document.form1.submit();
	
}





function DateCheck(sDate)
{
	var iaMonthDays = [31,28,31,30,31,30,31,31,30,31,30,31]
    var iaDate = new Array(3)
    var year, month, day

    iaDate = sDate.toString().split("-")
    if (iaDate.length != 3) return false
    if (iaDate[1].length > 2 || iaDate[2].length > 2) return false

    year = parseFloat(iaDate[0])
    month = parseFloat(iaDate[1])
    day=parseFloat(iaDate[2])

    if (year < 1900 || year > 2100) return false
    if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) iaMonthDays[1]=29;
    if (month < 1 || month > 12) return false
    if (day < 1 || day > iaMonthDays[month - 1]) return false
    return true
}




function CheckDate()
{
	var startdate = document.form1.start_date.value
	var enddate = document.form1.end_date.value
	
	if(startdate.length > 0 )
	{
		if(DateCheck(startdate))
		{
		}
		else
		{
			alert("日期输入有误,格式例如 '2006-01-01'");
			document.form1.start_date.focus();
			return ;
		}
	}
	if(enddate.length > 0)
	{
		if(DateCheck(enddate))
		{
		}
		else
		{
			alert("日期输入有误,格式例如 '2006-01-01'");
			document.form1.end_date.focus();
			return ;
		}
	}
	
	document.form1.submit();
}

function CheckDateReport()
{
	document.form1.submit();
}

function openWin(surl)
{
	var newwin = window.open(surl,'_blank','scrollbars=0,resizable=0,left=200,top=100,width=620,height=460');       
}
function openNew(surl)
{
	var w=828,h=600,x=7,y=30;
	var newwin = window.open(surl,'_blank','scrollbars=1,resizable=0,left='+x+',top='+y+',width='+w+',height='+h);   
}
function openWin1(surl)
{
	var newwin = window.open(surl,'_blank','scrollbars=0,resizable=0,left=100,top=0,width=720,height=600');       
}


function open_report_detail(surl)
{
	var w=640,h=460,x=7,y=30;
	var newwin = window.open(surl,'_blank','scrollbars=1,resizable=1,left='+x+',top='+y+',width='+w+',height='+h);
}
function open_rating_detail(surl)
{
	var w=786,h=460,x=17,y=30;
	var newwin = window.open(surl,'_blank','scrollbars=1,resizable=1,left='+x+',top='+y+',width='+w+',height='+h);
}
function no_access_right()
{
	alert('这是会员栏目，请注册后访问');
	open('/register.jsp');
	return false;
}

function need_more_right()
{
	alert('这是高级会员功能，请升级后访问，您目前只能查询基本股票');
	open('/register.jsp');
}

