﻿function killErrors(){
 return true;
 }
window.onerror = killErrors;
function showindex(id,str){
for(i=1;i<=3;i++){
	document.getElementById("news"+i).className='news1';
	document.getElementById("newscon"+i).style.display='';
	document.getElementById("newscon"+i).style.display='none';
}
document.getElementById(id).className='news2';
document.getElementById(str).style.display='inline';
}

function showindex1(id,str){
for(i=1;i<=4;i++){
	document.getElementById("newid1"+i).className='indextitle';
	document.getElementById("newindex1"+i).style.display='none';
}
document.getElementById(id).className='indextitle2';
document.getElementById(str).style.display='inline';
}

function showindex2(id,str){
for(i=21;i<=24;i++){
	document.getElementById("newid"+i).className='indextitle';
	document.getElementById("newindex"+i).style.display='none';
}
document.getElementById(id).className='indextitle2';
document.getElementById(str).style.display='inline';
}

function showmenu(a){
	var str = a.src.replace(".jpg","_02.jpg");
	a.src=str;
}
function hidemenu(a){
	var str = a.src.replace("_02.jpg",".jpg");
	a.src=str;
}
function mychart(){
	show_quote("http://chart2.678678.cn/indexcharts.aspx");
}
function showtime(){
mychart();
setTimeout("showtime()",5000)
}
showtime();
function checksearch(a){
with(a){
	keyword.value=keyword.value.replace(" ","")
	if (keyword.value=="" || keyword.value==" ") {
	alert("请输入你要搜索的关键字！");
	keyword.focus();
	return false;
	}
}
}

function checksearchen(a){
with(a){
	keyword.value=keyword.value.replace(" ","")
	if (keyword.value=="" || keyword.value==" ") {
	alert("Please enter your search keywords!");
	keyword.focus();
	return false;
	}
}
}

function DrawImage(ImgD,ImgID,w,h){ 
var image=new Image(); 
image.src=ImgD; 
imgid=ImgID;
if(image.width>0 && image.height>0){ 
//宽大于高
  if((image.width/image.height>= w/h)&&image.width>w){
    if(image.width>w){
    document.images[imgid].width=w; 
    document.images[imgid].height=(image.height*w)/image.width; 
   }else{ 
    document.images[imgid].width=image.width;
    document.images[imgid].height=image.height; 
   } 
   /*ImgD.alt="bigpic"  */
  }
//高大于宽
  else{ 
   if(image.height>h){
    document.images[imgid].height=h; 
    document.images[imgid].width=(image.width*h)/image.height; 
   }else{ 
    document.images[imgid].width=image.width;
    document.images[imgid].height=image.height; 
   } 
    /*ImgD.alt="bigpic"  */ 
  } 
}
}
