// JavaScript Document
function onpageload(){
	var paths=location.pathname.split("/"); 
	var page = paths.pop();
	
	switch(page){
		
		case "index.shtml":
		document.getElementById("syjs").className="focus";
		document.getElementById("link_syjs").className="focus";
		break;
		
		case "top_managers.shtml":
		document.getElementById("gjglry").className="focus";
		document.getElementById("link_gjglry").className="focus";
		break;
		
		case "consultant.shtml":
		document.getElementById("gwt").className="focus";
		document.getElementById("link_gwt").className="focus";
		break;
		
		case "partner.shtml":
		document.getElementById("hzhb").className="focus";
		document.getElementById("link_hzhb").className="focus";
		break;
		
		case "news.aspx":
		document.getElementById("sydt").className="focus";
		document.getElementById("link_sydt").className="focus";
		break;
		
		case "reportage.aspx":
		document.getElementById("mtbd").className="focus";
		document.getElementById("link_mtbd").className="focus";
		break;
		
		case "history.aspx":
		document.getElementById("fzlc").className="focus";
		document.getElementById("link_fzlc").className="focus";
		break;
		
		case "echinachem.shtml":
		document.getElementById("syhgw").className="focus";
		document.getElementById("link_syhgw").className="focus";
		break;
		
		case "echinabio.shtml":
		document.getElementById("sysmkxw").className="focus";
		document.getElementById("link_sysmkxw").className="focus";
		break;
		
		case "buyers_guide.shtml":
		document.getElementById("symzzn").className="focus";
		document.getElementById("link_symzzn").className="focus";
		break;
		
		case "biotech_directory.shtml":
		document.getElementById("zgswzyzn").className="focus";
		document.getElementById("link_zgswzyzn").className="focus";
		break;
		
		case "chemical_frontier.shtml":
		document.getElementById("hgqy").className="focus";
		document.getElementById("link_hgqy").className="focus";
		break;
		
		case "ad_agency.shtml":
		document.getElementById("djggdl").className="focus";
		document.getElementById("link_djggdl").className="focus";
		break;
		
		case "expo_events.shtml":
		document.getElementById("hzhd").className="focus";
		document.getElementById("link_hzhd").className="focus";
		break;
		
		case "data_service.shtml":
		document.getElementById("sjzx").className="focus";
		document.getElementById("link_sjzx").className="focus";
		break;
		
		case "business_consulting.shtml":
		document.getElementById("zxfw").className="focus";
		document.getElementById("link_zxfw").className="focus";
		break;
		
		case "contact.shtml":
		document.getElementById("lxwm").className="focus";
		document.getElementById("link_lxwm").className="focus";
		break;
		
		
	}
}

//参数(图片,允许的宽度,允许的高度)
function JeffImage(ImgD, iwidth, iheight) {
	var flag = false;
	var image = new Image();
	image.src = ImgD.src;
	if (image.width > 0 && image.height > 0) {
		flag = true;
		if (image.width / image.height >= iwidth / iheight) {
			if (image.width > iwidth) {
				ImgD.width = iwidth;
				ImgD.height = (image.height * iwidth) / image.width;
			} 
			else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		}
		else {
			if (image.height > iheight) {
				ImgD.height = iheight;
				ImgD.width = (image.width * iheight) / image.height;
			} 
			else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
		}
	}
} 
