function searchstockcode()
{
stockcode_current=document.getElementById("StockCode").value;
if (stockcode_current=="输入股票代码、证券名称或拼音缩写" || stockcode_current=="") stockcode_current="600900";
var re=/[0-9]{6}/; 
var re2=/[0-9]{1,}/; 
var re3=/[^0-9]{1,}/; 
bool1=stockcode_current.match(re)
bool2=stockcode_current.match(re2)
bool3=stockcode_current.match(re3)
if(bool1!=null && stockcode_current.length==6){
window.open('http://quote.eastmoney.com/'+stockcode_current+'.html');}
else {
if (bool2!=null && bool3==null && stockcode_current.length<3){alert("股票代码至少输入3位！");return false;}
if (bool2==null && bool3!=null && stockcode_current.length<2){alert("模糊查询时关键字至少2位！");return false;}
window.open('http://quote.eastmoney.com/quote.asp?stockcode='+stockcode_current);}
return(false);
}
function rewrite()
{
stockcode_current=document.getElementById("StockCode").value;
if (stockcode_current=="输入股票代码、证券名称或拼音缩写" || stockcode_current=="") stockcode_current="600900";
var re=/[0-9]{6}/; 
var re2=/[0-9]{1,}/; 
var re3=/[^0-9]{1,}/; 
bool1=stockcode_current.match(re)
bool2=stockcode_current.match(re2)
bool3=stockcode_current.match(re3)
if(bool1!=null && stockcode_current.length==6){
window.open('http://quote.eastmoney.com/'+stockcode_current+'.html');}
else {
if (bool2!=null && bool3==null && stockcode_current.length<3){alert("股票代码至少输入3位！");return false;}
if (bool2==null && bool3!=null && stockcode_current.length<2){alert("模糊查询时关键字至少2位！");return false;}
window.open('http://quote.eastmoney.com/quote.asp?stockcode='+stockcode_current);}
return(false);
}
function searchgsstockcode()
{
stockcode_current=document.getElementById("StockCode").value;
window.open('http://q.eastmoney.com/q.aspx?StockCode='+stockcode_current);
}
function aa()
{
stockcode_current=document.getElementById("StockCode").value;
window.open('http://q.eastmoney.com/q.aspx?StockCode='+stockcode_current);
}
function researchstockcode()
{
stockcode_current=document.getElementById("ReStockCode").value;
if (stockcode_current=="输入股票代码、证券名称或拼音缩写" || stockcode_current=="") stockcode_current="600900";
var re=/[0-9]{6}/; 
var re2=/[0-9]{1,}/; 
var re3=/[^0-9]{1,}/; 
bool1=stockcode_current.match(re)
bool2=stockcode_current.match(re2)
bool3=stockcode_current.match(re3)
if(bool1!=null && stockcode_current.length==6){
window.open('http://quote.eastmoney.com/'+stockcode_current+'.html');}
else {
if (bool2!=null && bool3==null && stockcode_current.length<3){alert("股票代码至少输入3位！");return false;}
if (bool2==null && bool3!=null && stockcode_current.length<2){alert("模糊查询时关键字至少2位！");return false;}
window.open('http://quote.eastmoney.com/quote.asp?stockcode='+stockcode_current);}
return(false);
}
function gguubbaareload(gburl)
{
document.getElementById("gguubbaa").src=gburl;
}
function gotohq2(stockcode)
{
window.open('http://hq2.eastmoney.com/favor_post.aspx?hq_stock='+stockcode);
}
function color(x)
{
	if(x=="1"){return '#FF0000'}
	else if(x=="-1"){return '#009900'}
	else{return '000000'}
}
function zhangdie(flag)
{
	if(flag==1||flag==-1){return 'id=\"hongdise\"';}
}
function myrefresh()
{
	window.location.reload();
}
function Getggheight()        
{
  var arr = document.cookie.match(new RegExp("(^| )"+escape("ggheight")+"=([^;]*)(;|$)"));
  if(arr != null) return unescape(arr[2]); return null;
}
function Setggheight(value)
{
    var exp  = new Date();
    exp.setTime(exp.getTime() + 5*60*1000);
    document.cookie = "ggheight="+ escape (value) + ";expires=" + exp.toGMTString()+";path=/;domain=.eastmoney.com";
}
function ggformcheck(aa){
if(checkspace(aa.topic.value)){alert("请输入留言标题。");aa.topic.focus();return(false);}
if(checkspace(aa.edit.value)){alert("请输入留言内容。");aa.edit.focus();return(false);}
return(true);
}
function checkspace(checkstr)
{
  var str = '';
  for(i = 0; i < checkstr.length; i++) 
  {str = str + ' ';}
  return (str == checkstr);
}
function getggformCookie(name) 
{  
  var cookieValue="";   
  var search = name + "=";   
  if(document.cookie.length>0)     
  {     
    offset= document.cookie.indexOf(search); 
    if(offset   !=   -1)
    {
   	  offset   +=   search.length;   
      end   =   document.cookie.indexOf(";",   offset);   
      if   (end   ==   -1)   end   =   document.cookie.length;
      cookieValue   =   unescape(document.cookie.substring(offset,end))
    }   
  }   
  return   cookieValue; 
}
