
//显示结构式
function jmeshow(id){
	if(navigator.javaEnabled()){
	var outstr="<applet id=\"app"+id+"\" code=\"JME.class\" archive=\"/inc/JME.jar\" width=\"250\" height=\"120\"><param name=\"options\" value=\"depict\" /></applet>";	
	document.write(outstr);
	$.get("/inc/structure.jsp?id="+id,function(data){
		var f="document.app"+id+".readMolFile(data); "
		if(data.length>100){
			eval(f);
		}else{
			$("#app"+id).remove();
		}
	} 
	);
	}
}

function show3dmod(id){
	if(navigator.javaEnabled()){
	var outstr="<applet code=\"JmolApplet\" id=\"app3d"+id+"\" codebase=\"/inc/\"  width=\"250\" height=\"250\" archive=\"JmolApplet.jar\" >";
	outstr+="<param name=\"load\" value=\"/inc/structure.jsp?id="+id+"\" />";
	outstr+="<param name=\"bgcolor\" value=\"#FFFFFF\" />";
	outstr+="<param name=\"style\" value=\"wireframe\" />";
	outstr+="<param name=\"label\" value=\"symbol\" />";
	outstr+="<param name=\"wireframeRotation\" value=\"true\" />";
	outstr+="<param name=\"perspectiveDepth\" value=\"false\" />";
	outstr+="<param name=\"progressbar\" value=\"true\" />";
	outstr+="<param name=\"progresscolor\" value=\"blue\" />";
	outstr+="<param name=\"script\" value=\"move 0 0 360 0 0 0 0 0 5\" />";
	outstr+="</applet>";
	document.write(outstr);
	}
	}
	
//回车所触发的事件
function KeyDown(evt,functions)
{
if(evt==null){evt=window.event}
	if(evt.keyCode==13  || evt.which == 13)  
	{ 
		evt.returnValue=false;
		evt.cancel = true;
		eval(functions);
	}   
}
function selectid(id){
	for( var i=1;i<=3;i++){
		if(i==id){
			$("#_a"+id).show();
		}else{
			$("#_a"+i).hide();
		}
	}
	for( var i=4;i<=6;i++){
		if(i==(id+3)){
			$("#_a"+(id+3)).hide();
		}else{
			$("#_a"+i).show();
		}
	}
	$("#way").val(id);
}

String.prototype.Trim = function() 
{ 
return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 

function ckform(){
var a=document.searchform;
if(a.keyword.value.Trim().length==0){
	window.location='/product-index/a-1.html';
	}else{
	way=$("#way").val();
	if(way==1){
		window.location='/search.jsp?keyword='+escape(a.keyword.value);
	}if(way==2){
		
	}else if(way==3){
		window.location='/trade/search.jsp?keyword='+escape(a.keyword.value);
	}
}
}
 /**
 * 定义ForceWindow类构造函数
 * 无参数
 * 无返回值
 */
function Win ()
{
  this.r = document.documentElement;
  this.f = document.createElement("FORM");
  this.f.target = "_blank";
  this.f.method = "post";
  this.r.insertBefore(this.f, this.r.childNodes[0]);
}

/**
 * 定义open方法
 * 参数sUrl：字符串，要打开窗口的URL。
 * 无返回值
 */
Win.prototype.open = function (sUrl)
{
  this.f.action = sUrl;
  this.f.submit();
}

