 <!--
//参数：
//	url 链接地址
//	target 目标frame，其中
//		_top:表示主frame
//		_blank:新窗口
function openurl(surl,target){
	if (target=='_top'){
		parent.location=surl;
	}else if (target=='_blank'){
		var newwin = window.open('','_blank','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=0,top=0,width=680,height=450');
		
		newwin.location=surl;
		newwin.focus();
	}else if (target=='_blank1'){
		var newwin = window.open('','_blank','scrollbars=1,resizable=0,left=0,top=0,width=650,height=560');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='_blank2'){
		var newwin = window.open('','_blank','toolbar=1,location=1,status=1,menubar=1,scrollbars=1,resizable=1,left=0,top=0');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='_blank3'){
		var newwin = window.open('','_blank','scrollbars=no,resizable=no,left=0,top=0,width=790,height=550');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='_mncg'){
		var newwin = window.open('','_blank','scrollbars=no,resizable=no,left=250,top=200,width=300,height=350');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='chatroom'){
		var newwin = window.open('','searchWin','scrollbars=no,resizable=no,left=0,top=0,width=790,height=550');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='newform'){
		var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=650,height=430');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='yhsq'){
		var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=790,height=380');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='msg'){
		var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=400,height=200');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='zj'){
		var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=500,height=400');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='chart'){
		var newwin = window.open('','_blank','width=780,height=400,resizable=1');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='zxxd'){
		var newwin = window.open('','_blank','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,left=0,top=0,width=630,height=450');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='_new'){
		var newwin = window.open('','_blank','');
		newwin.location=surl;
		newwin.focus();
	}else{
		if (parent.frmaes != null){
			parent.frames(target).location=surl;
		}else{
			this.location=surl;
		}
	}
	return;
}


	function openVoteResultWindow()
					{		
						window.open('about:blank','VoteResult','resizable=1,width=400,height=300,scrollbars=1');
					}

					function checkVoteFormData(){
						if (chk()){
							return true;
						/*}else{
							alert("请选择!");
							return false;*/
						}
					}

					function chk()
					{
						for(var i=0;i<frmVote.elements.length;i++){
							if (document.frmVote.elements[i].checked==true) {
								return true;
							}
						}
						return false;
					}



function openNewWin(surl){
	var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=790,height=550');
	var rid=window.parent.topFrame.runid.value
	if (rid!="" && rid!="0"){
		if (surl.indexOf("?")>=0){
			surl = surl+'&runid='+rid
		}else{
			surl = surl+'?runid='+rid
		}
	}
	newwin.location=surl;
	newwin.focus();
}

function tabOver(o) {
    o.style.backgroundColor = "#E96F34";
    o.style.cursor="hand";
}
function tabOut(o) {
    o.style.backgroundColor = "#CC3300"; 
}
function tabdown(o) {
    o.style.backgroundColor = "#EBEBEB"; 
}

function showWin(href){
	var newwin = window.open("","TitleCont","scrollbars=yes,resizable=yes,left=0,top=0,width=652,height=520");
	newwin.location=href;
	newwin.focus();
}	
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_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_findObj(n, d) { //v3.0
  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); 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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function openUrls(surl){
	var rid=window.parent.topFrame.runid.value
	if (rid=="" || rid=="0"){
		alert("请先登陆 !");
		return;
	}	
	if (surl.indexOf("?")>=0){
		document.location.href=surl+'&runid='+rid
	}else{
		document.location.href=surl+'?runid='+rid
	}
}

function openWin(surl){
	var rid=window.parent.topFrame.runid.value
	if (rid=="") rid = "0"
	if (surl.indexOf("?")>=0){
		document.location.href=surl+'&runid='+rid
	}else{
		document.location.href=surl+'?runid='+rid
	}
}

function openWT(type){
	var rid=window.parent.topFrame.runid.value;
	var str="/goldbull/bulleye/question.jsp?type="+type+"&uid="+rid;
	var newwin = window.open('','_blank',' toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,left=0,top=0 ,width=750,height=300');
	newwin.location=str;
	newwin.focus();
}

function yhsq(type){
	var rid=window.parent.topFrame.runid.value;
	var str="/goldbull/secucenter/yh.jsp?sqtype="+type+"&runid="+rid;
	var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=790,height=380');
	newwin.location=str;
	newwin.focus();
}

function nextpage(ul){
	var rid=window.parent.topFrame.runid.value;
	if (rid==""){
		rid="0";
	}
	var str;
	if (ul.indexOf("?")>=0)
		str=ul+"&runid="+rid;
	else 
		str=ul+"?runid="+rid;	
		
	location.href=str;
}


function writes(){
        var ttt;
       // if((window.parent.topFrame.runid.value!="0" && window.parent.topFrame.runid.value!="")){
       //     ttt="https://www.kingbull.com.cn/wsjy/index.jsp?runid="+window.parent.topFrame.runid.value;
      //  }else{
        //    alert("尚未进行成员登录!");
            ttt="https://www.kingbull.com.cn/wsjy/tradelogin_gold.jsp";
       // }
        navigate(ttt);
}


function checkQHCode(){
    var code=fsfm.code.value;
    if (code.length !=4 && code.length!=6){
        alert('代码错误');
        return false;
    }	
    return true;
}

function getRid(){

	 var rid=window.parent.topFrame.runid.value;
	return rid;
}


function switchImg(theImg,theDefault)
	{	
		
		 
                  
		img1.src="/images/sa.gif";
		img2.src="/images/sb.gif";		
		img3.src="/images/ha1.gif";		
		img4.src="/images/HB.gif";				
		
		if(theImg == img1)
		{
			theDefault.src = "/images/sza.gif";	
			theDefault.alt="深证Ａ股指数";	
			img1.src="/images/sc.gif";
			
		}
		if(theImg == img2)
		{
			theDefault.src = "/images/szb.gif";
		        theDefault.alt="深证Ｂ股指数";
			img2.src="/images/sb1.gif";		
		
		}		
		if(theImg == img3)
		{
			theDefault.src = "/images/sha.gif";
			theDefault.alt="上证Ａ股指数";
			img3.src="/images/ha.gif";		
			
		}		
		if(theImg == img4)
		{
			theDefault.src = "/images/shb.gif";
			 theDefault.alt="上证Ｂ股指数";
			img4.src="/images/HB1.gif";		
		}		
	}
	
	
function checkgg()       
 { 
  var code=document.all.stockcode.value;
  var item=document.all.menu1.value;
  if (code == "")
  {
   window.alert (" 代码不能为空,请重新输入! "); 
   document.all.stockcode.focus ();
   return false;
   }
  if(item==1) 
 {     
	window.open ("/servers/gghqht.jsp?dm="+code+"&mode=1027");
 }
  else
  if(item==2)
{
  window.open("/bbs/ggltlist.jsp?page=1&stockcode="+code);
}
  else
  if(item==3)
{
  window.open("/research/ggdp.jsp?dm="+code+"&sl=1");
}
  else
  if(item==4)
{
   window.open("/data/index.jsp?SUID=1&StockCode="+code);
}
   return true;
}   

function hqlnkxs(href){
	var newwin = window.open(href,"_blank","scrollbars=yes,resizable=yes,left=0,top=0,width=632,height=367");
	newwin.focus();
}

function SendPwd()
{
  var userName;
  userName=prompt("请输入您的用户名:","");
  if(userName!=null && userName!="")
   window.open("/include/sendpassword.jsp?userName="+userName,"密码发送","scrollbars=no,status=no,width=200,height=250")
  return ;
 }	
 
 function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function convertor(old_code) {
  if (old_code.length == 4) {
    var fl = old_code.substring (0, 1);
    var tl = old_code.substring (0, 2);
    if (old_code == "0696")		return "001696";
    else if (old_code == "0896")	return "001896";
    else if (old_code == "1990")	return "131990";
    else if (fl == "0")		return ("00" + old_code);
    else if (fl == "1") {
      if (tl == "10")		return ("1110" + old_code.substring(2,4));
      else if (tl == "12")	return ("1312" + old_code.substring(2,4));
      else if (tl == "13")	return ("1313" + old_code.substring(2,4));
      else if (tl == "14")	return ("1314" + old_code.substring(2,4));
      else if (tl == "16")	return ("1016" + old_code.substring(2,4));
      else if (tl == "17")	return ("1017" + old_code.substring(2,4));
      else if (tl == "18")	return ("1318" + old_code.substring(2,4));
      else if (tl == "19")	return ("1019" + old_code.substring(2,4));
    }
    else if (fl == "2")	return ("200" + old_code.substring(1,4));
    else if (fl == "3")	return ("030" + old_code.substring(1,4));
    else if (fl == "4") {
      if (tl == "40")		return ("1740" + old_code.substring(2,4));
      else if (tl == "45")	return ("1745" + old_code.substring(2,4));
      else if (tl == "46")	return ("1846" + old_code.substring(2,4));
      else if (tl == "47")	return ("1847" + old_code.substring(2,4));
    }
    else if (fl == "5")	return ("125" + old_code.substring(1,4));
    else if (fl == "7")	return ("070" + old_code.substring(1,4));
    else if (fl == "8")	return ("080" + old_code.substring(1,4));
    else if (fl == "9")	return ("090" + old_code.substring(1,4));
  } else if (old_code.length > 0 && old_code.length <= 6) {
    var new_code = old_code;
    for (var i = 0; i < 6-old_code.length; i++)
      new_code = "0" + new_code;
    return new_code;
  } else	return null;
}

//漂浮图片鼠标跟随
function mousemoving(e) {
 if(document.layers) { 
   document.floatDiv.x=e.pageX;
   document.floatDiv.y=e.pageY;
 } 
 if(document.all) { 
   floatDiv.style.left=event.x+document.body.scrollLeft;
   floatDiv.style.top=event.y+document.body.scrollTop;
 }
 //document.onmousemove=mousemoving;
 if(document.layers) { 
   document.captureEvents(Event.MOUSEMOVE);
 }
}

//漂浮图片一直在左或右边（flag=0左边；flag=1右边）
function initAdLR(layerName, flag) {
eval("document.all." + layerName + ".style.posTop = -200");
//设置onLoad事件激发以后，广告层相对于固定后的y方向位置 
eval("document.all." + layerName + ".style.visibility = 'visible'");  //设置层为可见 
MoveLayer(layerName, flag);  //调用函数MoveLayer() 
}
function MoveLayer(layerName, flag) {
var x1 = 0;  	//浮动广告层固定于浏览器的x方向位置 
var y1 = 200;	//浮动广告层固定于浏览器的y方向位置
if (flag == '1') {  //如果是一直在右边
  x1 = window.screen.width - 22 - parseInt(eval("document.all." + layerName + ".style.width"));
}
var diff = (document.body.scrollTop + y1 - eval("document.all."+layerName+".style.posTop"))*.40;
var y1 = document.body.scrollTop + y1 - diff;
eval("document.all." + layerName + ".style.posTop = y1"); 
eval("document.all." + layerName + ".style.posLeft = x1");//移动广告层 
setTimeout("MoveLayer('"+layerName+"', '"+flag+"');", 20);//设置20毫秒后再调用函数MoveLayer() 
}

//漂浮图片四处浮动
function adstart(layerName) {
var yPos = document.body.clientHeight;
var vimg = eval("document.all."+layerName);
vimg.visibility = "visible";
vimg.style.top = yPos;
changePos(layerName,20,yPos,1,0,0);  //调用函数changePos()
}
function changePos(layerName,xPos,yPos,step,yon,xon) {
var width = document.body.clientWidth;
var height = document.body.clientHeight;
var vimg = eval("document.all."+layerName);
var Hoffset = vimg.offsetHeight;
var Woffset = vimg.offsetWidth;
vimg.style.left = xPos + document.body.scrollLeft;
vimg.style.top = yPos + document.body.scrollTop;
if (yon) {
  yPos = yPos + step;
} else {
  yPos = yPos - step;
}
if (yPos < 0) {
  yon = 1;
  yPos = 0;
}
if (yPos >= (height - Hoffset)) {
  yon = 0;
  yPos = (height - Hoffset);
}
if (xon) {
  xPos = xPos + step;
} else {
  xPos = xPos - step;
}
if (xPos < 0) {
  xon = 1;
  xPos = 0;
}
if (xPos >= (width - Woffset)) {
  xon = 0;
  xPos = (width - Woffset);
}
//设置30毫秒后再调用函数changePos()
setTimeout("changePos('"+layerName+"',"+xPos+","+yPos+","+step+","+yon+","+xon+");", 30);
}

//-->
