
function openurl(surl, target){
	if (target=='_top'){
		parent.location=surl;
	}else if (target=='_blank'){
		var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=620,height=450');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='_blank1'){
		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=='_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=750,height=450');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='_blank4'){
		var newwin = window.open('','_blank','scrollbars=no,resizable=no,left=0,top=0,width=750,height=520');
		newwin.location=surl;
		newwin.focus();
	}else if (target=='trade'){
		var newwin = window.open('','_blank','scrollbars=no,resizable=no,left=0,top=0,width=750,height=550');
		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=240');
		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=='zx'){
		var newwin = window.open('','_blank','scrollbars=1,resizable=1,left=0,top=0,width=1,height=1');
		newwin.location=surl;
		newwin.focus();
	}else{
		if (parent.frmaes != null){
			parent.frames(target).location=surl;
		}else{
			this.location=surl;
		}
	}
	return;
}

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];
   	 // alert(a[i+2]);
   	// alert(x.name);
   	
   	
    }
}







function writeIndexHQMap(){
   
    
      	   var str= '<map name="HQMap1" >';
      	   str+=' <area shape="rect"   coords="77,1,110,18" href="#";  onclick="switchImg(2,1);return false;">';
      	   str+='<area shape="rect" coords="112,3,140,18"  href="#";   onclick="switchImg(3,1);return false;">';
      	   str+='<area shape="rect" coords="141,2,169,17"  href="#";   onclick="switchImg(4,1);return false;">';
      	   str+='</map>';
      	  
      	  
      	   str+='<map name="HQMap2"  style="cursor:hand">';
      	   str+='<area shape="rect" coords="82,2,109,17"   href="#";   onclick="switchImg(1,1);return false;">';
      	   str+='<area shape="rect" coords="112,1,140,19"  href="#";   onclick="switchImg(3,1);return false;">';
      	   str+='<area shape="rect" coords="141,2,168,17"  href="#";   onclick="switchImg(4,1);return false;">';
      	   str+='</map>';
      	   
      	   str+=' <map name="HQMap3"  style="cursor:hand">';
      	   str+='<area shape="rect" coords="81,0,110,18"  href="#";   onclick="switchImg(4,1);return false;">';
      	   str+=' <area shape="rect" coords="112,1,138,19"  href="#";   onclick="switchImg(1,1);return false;">';
      	   str+='<area shape="rect" coords="141,1,170,18"  href="#";   onclick="switchImg(2,1);return false;">';
      	   str+='</map>';
      	   
      	   str+=' <map name="HQMap4" style="cursor:hand">';
      	   str+='<area shape="rect" coords="81,0,111,18"  href="#";   onclick="switchImg(3,1);return false;">';
      	   str+='<area shape="rect" coords="113,1,139,17"  href="#";    onclick="switchImg(1,1);return false;">';
      	   str+='<area shape="rect" coords="140,2,168,17"  href="#";    onclick="switchImg(2,1);return false;">';
      	   str+='</map>';
      	  
         document.write(str); 
    
}
function switchImg(lx,lx1){
    
       switch(lx){	 
    	 case 1: 
    	        if (lx1 == 1){
    	        	chimg.useMap="#HQMap1";
    	        	chimg.src="/images/title_ha.gif";
    	        }else{
    	        	 chimg.src="/images/ss_2.gif";
    	        }	 
    	 		hqimg.src="/images/sha.gif";
    	 		
    	 	break;
    	  case 2: 
    	  	 if (lx1 == 1){
    	        	chimg.useMap="#HQMap2";
    	        	chimg.src="/images/title_hb.gif";
    	        	
    	        }else{
    	        	 chimg.src="/images/ss_3.gif";
    	        }	 
    	  	
    	 	hqimg.src="/images/shb.gif";
    	 	break;
    	 	
    	 case 4:
    	         if (lx1 == 1){
    	            chimg.useMap="#HQMap4";
    	           chimg.src="/images/title_sb.gif";
    	          
    	        }else{
    	             chimg.src="/images/ss_1.gif";
    	       } 	 
    	         
    	 	hqimg.src="/images/szb.gif";
    	 	break;	
    	 case 3: 
    	   	if (lx1 == 1){
    	   	  chimg.useMap="#HQMap3";
    	          chimg.src="/images/title_sa.gif";
    	          
    	        }else{
    	           chimg.src="/images/ss.gif";
    	         }  
    	        
    	        hqimg.src="/images/sza.gif";
    	 	break;
       }
      

}
/*
function switchImg(theImg,theDefault)
{	   
	img1.src="/images/title_ha.gif";
	img2.src="/images/title_ha.gif";		
	img3.src="/images/title_ha.gif";		
	img4.src="/images/title_ha.gif";				
	
	if(theImg == img1)
	{
		theDefault.src = "/images/sza.gif";	
		theDefault.alt="深证Ａ股指数";	
		img1.src="/images/sc1.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/hc1.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) 
  {     
    document.location.replace("/comInfo/index.jsp?SUID=6&StockCode="+code);
  }
  else
  if(item==2)
{
  document.location.replace("/comInfo/index.jsp?SUID=1&StockCode="+code);
}
  else
  if(item==3)
{
   
   document.location.replace("/bbs/bbs.jsp?frameid=4&flag=3&stkcode="+code);
}
  else
  if(item==4)
{
   window.open ("http://202.102.193.130/tmp/HQCLIENT.asp?stockid="+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 onEnter(){
	var m;
	if(document.all)
		m=event.keyCode;
	else
		m=e.which;
	if(m==13)
		loginform.submit();
	return false;
}


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_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; }
}

