String.prototype.Trim = function()
{
 return this.replace(/(^\s*)|(\s*$)/g, "");
}


function MM_o(selObj)
{ 
window.open(selObj.options[selObj.selectedIndex].value);
} 



function top()
{
document.writeln("   <table width=\"776\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("          <tr> ");
document.writeln("            <td>");
document.writeln("<div id=\"Layer2\" style=\"position:absolute; width:102px; height:19px; z-index:2\">");
document.writeln("                <div id=\"Layer1\" style=\"position:absolute; left:482px; top:170px; width:81px; height:54px; z-index:1; background-color: 5C5C5C; layer-background-color: 5C5C5C; border: 1px none #000000; visibility: hidden;\" onMouseOver=\"MM_showHideLayers('Layer1','','show')\" onMouseOut=\"MM_showHideLayers('Layer1','','hide')\"> ");
document.writeln("                  <table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td height=\"8\"></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                  <table width=\"78%\" height=\"41\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td width=\"16%\"><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td width=\"84%\" class=\"link2\"><a href=\"xhgg.htm\">协会公告</a></td>");
document.writeln("                    </tr>");
document.writeln("                    <tr> ");
document.writeln("                      <td><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td class=\"link2\"><a href=\"xhjs.htm\">协会介绍</a></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                </div>");
document.writeln("                <div id=\"Layer3\" style=\"position:absolute; left:397px; top:170px; width:82px; height:54px; z-index:3; background-color: 5C5C5C; layer-background-color: 5C5C5C; border: 1px none #000000; visibility: hidden;\" onMouseOver=\"MM_showHideLayers('Layer3','','show')\" onMouseOut=\"MM_showHideLayers('Layer3','','hide')\"> ");
document.writeln("                  <table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td height=\"8\"></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                  <table width=\"78%\" height=\"41\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td width=\"14%\"> <div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td width=\"84%\" class=\"link2\"><a href=\"qsgg.htm\">劵商公告</a></td>");
document.writeln("                    </tr>");
document.writeln("                    <tr> ");
document.writeln("                      <td><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td class=\"link2\"><a href=\"qsjs.htm\">劵商介绍</a></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                </div>");
document.writeln("                <div id=\"Layer4\" style=\"position:absolute; left:316px; top:170px; width:79px; height:80px; z-index:3; background-color: 5C5C5C; layer-background-color: 5C5C5C; border: 1px none #000000; visibility: hidden;\" onMouseOver=\"MM_showHideLayers('Layer4','','show')\" onMouseOut=\"MM_showHideLayers('Layer4','','hide')\"> ");
document.writeln("                  <table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td height=\"8\"></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                  <table width=\"89%\" height=\"58\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td width=\"19%\"> <div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td width=\"81%\" class=\"link2\"><a href=\"lsbb.htm\">临时报告</a></td>");
document.writeln("                    </tr>");
document.writeln("                    <tr> ");
document.writeln("                      <td><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td class=\"link2\"><a href=\"dqbb.htm\">定期报告</a></td>");
document.writeln("                    </tr>");
document.writeln("                    <tr> ");
document.writeln("                      <td><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td class=\"link2\"><a href=\"gsgk.jsp\">档案资料</a></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                </div>");
document.writeln("                <div id=\"Layer5\" style=\"position:absolute; left:194px; top:171px; width:121px; height:75px; z-index:3; background-color: 5C5C5C; layer-background-color: 5C5C5C; border: 1px none #000000; visibility: hidden;\" onMouseOver=\"MM_showHideLayers('Layer5','','show')\" onMouseOut=\"MM_showHideLayers('Layer5','','hide')\"> ");
document.writeln("                  <table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td height=\"8\"></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                  <table width=\"100%\" height=\"41\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td width=\"14%\"><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td width=\"86%\" class=\"link2\"><a href=\"bjlb.htm\">总报价和成交揭示</a></td>");
document.writeln("                    </tr>");
document.writeln("                    <tr> ");
document.writeln("                      <td><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td class=\"link2\"><a href=\"ggbj.jsp\">个股报价揭示</a></td>");
document.writeln("                    </tr>");
document.writeln("                    <tr>");
document.writeln("                      <td><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td class=\"link2\"><a href=\"ggcj.jsp\">个股成交信息</a></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                </div>");
document.writeln("                <div id=\"Layer6\" style=\"position:absolute; left:258px; top:170px; width:86px; height:54px; z-index:3; background-color: 5C5C5C; layer-background-color: 5C5C5C; border: 1px none #000000; visibility: hidden;\" onMouseOver=\"MM_showHideLayers('Layer6','','show')\" onMouseOut=\"MM_showHideLayers('Layer6','','hide')\"> ");
document.writeln("                  <table width=\"75%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td height=\"8\"></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                  <table width=\"102%\" height=\"41\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("                    <tr> ");
document.writeln("                      <td width=\"14%\"><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td width=\"86%\" class=\"link2\"><a href=\"cjlb.htm\">总成交信息</a></td>");
document.writeln("                    </tr>");
document.writeln("                    <tr> ");
document.writeln("                      <td><div align=\"center\"><img src=\"images/q16.jpg\" width=\"3\" height=\"7\"></div></td>");
document.writeln("                      <td class=\"link2\"><a href=\"ggcj.htm\">个股成交信息</a></td>");
document.writeln("                    </tr>");
document.writeln("                  </table>");
document.writeln("                </div>");
document.writeln("                ");
document.writeln("              </div>");
document.writeln("              <img src=\"images/top.jpg\" width=\"776\" height=\"145\" border=\"0\" usemap=\"#Map2\"></td>");
document.writeln("          </tr>");
document.writeln("        </table>");
document.writeln("        ");
document.writeln("    <table width=\"776\" height=\"50\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("      <tr>");
document.writeln("            <td width=\"776\" height=\"50\" valign=\"top\" background=\"images/q1.jpg\"> ");
document.writeln("              <table width=\"737\" height=\"41\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("                <tr> ");
document.writeln("                  <td width=\"89\" height=\"41\"> <div align=\"center\" class=\"link2\"><a href=\"http://www.gfzr.com.cn\">首　页</a></div></td>");
document.writeln("                  <td width=\"84\"><div align=\"center\" class=\"link2\"><a href=\"index.htm\">报价首页</a></div></td>");
document.writeln("                  <td width=\"121\"> <div align=\"center\" class=\"link2\"><a href=\"bjlb.htm\" onMouseOver=\"MM_showHideLayers('Layer5','','show')\" onMouseOut=\"MM_showHideLayers('Layer5','','hide')\">报价和成交信息</a></div></td>");
document.writeln("                  <td width=\"82\"> <div align=\"center\" class=\"link2\"><a href=\"lsbb.htm\" onMouseOver=\"MM_showHideLayers('Layer4','','show')\" onMouseOut=\"MM_showHideLayers('Layer4','','hide')\">挂牌公司</a></div></td>");
document.writeln("                  <td width=\"85\"> <div align=\"center\" class=\"link2\"><a href=\"qsgg.htm\" onMouseOver=\"MM_showHideLayers('Layer2','','show','Layer3','','show')\" onMouseOut=\"MM_showHideLayers('Layer2','','hide','Layer3','','hide')\">报价券商</a></div></td>");
document.writeln("                  <td width=\"83\"> <div align=\"center\" class=\"link2\"><a href=\"xhgg.htm\" onMouseOver=\"MM_showHideLayers('Layer1','','show')\" onMouseOut=\"MM_showHideLayers('Layer1','','hide')\">主管机构</a></div></td>");
document.writeln("                  <td width=\"85\"> <div align=\"center\" class=\"link2\"><a href=\"flfg.htm\">法规规则</a></div></td>");
document.writeln("                  <td width=\"108\"> <div align=\"center\" class=\"link2\"><a href=\"tzzy.htm\">投资者指引</a></div></td>");
document.writeln("                </tr>");
document.writeln("              </table></td>");
document.writeln("          </tr>");
document.writeln("        </table>");

document.writeln("<map name=\"Map2\">");
document.writeln("  <area shape=\"rect\" coords=\"9,57,144,122\" href=\"http://www.sac.net.cn\" target=\"_blank\"> ");
document.writeln("  <area shape=\"rect\" coords=\"238,103,578,127\" href=\"http://bjzr.gfzr.com.cn/bjzr/fina/2006-01-16/16379174.html\" target=\"_blank\" >");
document.writeln("  <area shape=\"rect\" coords=\"658,52,764,126\" href=\"http://www.cninfo.com.cn\" target=\"_blank\" >");
document.writeln("  </map>");
}

function bottom()
{
document.writeln(" <table width=\"776\" height=\"63\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("          <tr> ");
document.writeln("            <td height=\"63\" background=\"images/q15.jpg\"><div align=\"center\"><font color=\"#FFFFFF\">承办：深圳证券信息有限公司 ");
document.writeln("                <br>");
document.writeln("                Constructed by ：Shenzhen Securities Information Co., Ltd.</font></div></td>");
document.writeln("          </tr>");
document.writeln("        </table>");
 }


function check(code){

 var f = document.myform;
if (code==1)
 {
   if (f.baojia.value == "")
   {
   alert("报价必须填写!");
   f.baojia.focus();
   return false;
   }
   var ss;
   ss=f.baojia.value;
   window.location.href="ggbj.jsp?gpdm="+ss;
 }

if (code==2)
 {

if (f.chenjiao.value == "" )
   {
   alert("成交价必须填写!");
   f.chenjiao.focus();
   return false;
   }
   var ss;
   ss=f.chenjiao.value;
   window.location.href="ggcj.jsp?gpdm="+ss;
 
 }
 
 if (code==3)
 {

if (f.gszl.value == "" )
   {
   alert("公司资料必须填写!");
   f.gszl.focus();
   return false;
   }
   var ss;
   ss=f.gszl.value;
   window.location.href="gsgk.jsp?gpdm="+ss;
 
 }


}

function checkNumRange(num, type, start, end)
{
	var tmp = 0; 
	if (type == "int") 
	{
		tmp = parseInt(num, 10); 
	}
	else if (type == "float")
	{
		tmp = parseFloat(num, 10); 
	}
	if (end == "E")
	{
		if (isNaN(tmp) || (tmp != num) || (tmp < start)) return false;
	}
	else 
	{
		if (isNaN(tmp) || (tmp != num) || (tmp < start) || (tmp > end)) return false; 
	} 
	return true; 
} 



function isdate(str,ttt) 
{
  var len1=str.Trim();
	len1=len1.length; 
	if (len1 == 0) return true; 
	if (len1 != 8)
	{
		alert(ttt+"日期输入非法，请输入象 20010817 的8位日期！");
		return false;
	} 
	var tmp_str = str.Trim(); 
	var yy,mm,dd,yy_int,mm_int,dd_int; 
	var months = new Array("","一月份","二月份","三月份","四月份","五月份","六月份","七月份","八月份","九月份","十月份","十一月份","十二月份"); 
	yy = tmp_str.substr(0,4); 
	mm = tmp_str.substr(4,2); 
	dd = tmp_str.substr(6,2); 
	if (checkNumRange(yy, "int", 1000, "E") ==false)
	{
		alert(ttt+"年份输入非法！");
		return false;
	} 
	if (checkNumRange(mm, "int", 1, 12) ==false)
	{
		alert(ttt+"月份输入非法！");
		return false;
	} 
	if (checkNumRange(dd, "int", 1, 31) ==false)
	{
		alert(ttt+"日期输入非法！");
		return false;
	}
	yy_int = yy*1; 
	mm_int = mm*1; 
	dd_int = dd*1; 
	if (mm_int == 2) 
		if (yy_int % 4 > 0 && dd_int > 28)
		{ 
			alert(ttt+months[mm_int]+"只有 28 天"); 
			return false; 
		} 
		else if (dd_int > 29)
		{
			alert(ttt+months[mm_int]+"只有 29 天"
		); 
		return false; 
	} 
	if ((mm_int == 4 || mm_int == 4 || mm_int == 4 || mm_int == 4) && dd_int > 30)
	{
		alert(ttt+months[mm_int]+"只有 30 天"); 
		return false; 
	} 
	else if (dd_int > 31)
	{ 
		alert(ttt+months[mm_int]+"只有 31 天"); 
		return false; 
	} 
	return true; 
} 

function istel(telstr)
{
var reg=/[^0-9-]/g;
if (telstr!="") {
if (reg.test(telstr)){
return false ;
 }
else
{
return true ;
 }
 }
 }
 

function query()
{
  var f = document.dateform;

  if (f.begindate.value == "" && f.enddate.value == "" && f.querytitle.value=="")
   {
   alert("查询条件的其中一个条件必须填写!");
   f.begindate.focus();
   return false;
   }
 
 if (isdate(f.begindate.value,'起始') == false)
	{
		f.begindate.focus();
		return false;
	}
	if (isdate(f.enddate.value,'终止') == false)
	{
		f.enddate.focus();
		return false;
	}
	if (f.begindate.value > f.enddate.value && f.enddate.value.length != 0)
	{
		alert("起始日期不能大于终止日期！");
		f.enddate.focus();
		return false;
	}
  
   f.submit();
 }

function pagequery()
{
  var g= document.pageform;
  
  if (g.pageNo.value=="")
  {
   alert("查询条件的其中一个条件必须填写!");
   g.pageNo.focus();
   return false;
 	}
 	
if (istel(g.pageNo.value)== false)
   {
    alert("请输入合法页码数！");
	  g.pageNo.focus();
	  return false;
   }
 return true;
 
}



function hqquery()
{
  var f = document.dateform;

  if (f.begindate.value == "" && f.enddate.value == "")
   {
   alert("开始日期必须填写!");
   f.begindate.focus();
   return false;
   }
 
 if (f.enddate.value == "")
   {
   alert("结束日期必须填写!");
   f.begindate.focus();
   return false;
   }
   
 if (isdate(f.begindate.value,'起始') == false)
	{
		f.begindate.focus();
		return false;
	}
	if (isdate(f.enddate.value,'终止') == false)
	{
		f.enddate.focus();
		return false;
	}
	if (f.begindate.value > f.enddate.value && f.enddate.value.length != 0)
	{
		alert("起始日期不能大于终止日期！");
		f.enddate.focus();
		return false;
	}
  
   f.submit();
 }
