// 点击子栏目名时改变相应背色
function flashBg(id) {
	for(var i=1;i<10;i++) {
		if(document.getElementById("sm"+i)) {
			// document.getElementById("sm"+i).style.backgroundColor=(id==i)?"#C2121E":"";
			document.getElementById("sm"+i).style.background=(id==i)?"url(images/submenu_bg.gif)":"";
		} else return;
	}
}
// 改变图片区域显隐状态
function jSwitchPhotoArea(objPhoto,objTd) {
	if (objPhoto.style.display=='none') {
		objPhoto.style.display='';
		objTd.innerHTML="<img src='../images/arrow_left.gif' />";
		objTd.title="隐藏图片区域";
	} else {
		objPhoto.style.display='none';
		objTd.innerHTML="<img src='../images/arrow_right.gif' />";
		objTd.title="显示图片区域";
	}
}

// 切换图片
function jSwapImg(id, imgpath) {
	document.getElementById(id).src=imgpath;
}
// 二级菜单的伸缩
function TurnObj(objId)
{
	if (objId.style.display=="none") 
		objId.style.display="";
	else
		objId.style.display="none";
}
function ShowDiv(divName)
{	document.all(divName).style.visibility='visible'; }
function HideDiv(divName)
{	document.all(divName).style.visibility='hidden';}

// 参考PHP 函数
function trim(string) {
	if (string==null) return "";
	if (typeof(string)=='object'&&(''+string=='null'||''+string=='undefined')) return '';
	if (typeof(string)!="string") string=""+string;
	return string.replace(/^\s+|\s+$/g,"");
}
/* 选择页面上所有CHECKBOX元素 全选/反选 */
function jSetCheckboxes(the_form, do_check) {
    var elts      = (typeof(document.forms[the_form].elements['myCheckbox[]']) != 'undefined')
                  ? document.forms[the_form].elements['myCheckbox[]']
                  : document.forms[the_form].elements['ids[]'];
    var elts_cnt  = (typeof(elts.length) != 'undefined')
                  ? elts.length
                  : 0;
    if (elts_cnt)
        for (var i = 0; i < elts_cnt; i++)
            elts[i].checked = do_check;
	else
        elts.checked = do_check;
    return true;
}
/* 问题解答显示 */
var FaQold='';
function jFaq(obj) {
	if (FaQold!=obj) {
		if (FaQold!='')
			document.getElementById(FaQold).style.display='none';
		document.getElementById(obj).style.display='';
		FaQold=obj;
	}
	else {
		document.getElementById(obj).style.display='none';
		FaQold='';
	}
}
/* COOKIE 操作 */
function setCookie(name, value) {
  var Days = 365;  // 此 cookie 将被保存一年
  var exp  = new Date();  // new Date("December 31, 9998");
  exp.setTime(exp.getTime() + Days*24*60*60*1000);
  document.cookie = name + "="+ escape(value) +";expires="+ exp.toGMTString();
}
function getCookie(name) {
  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
  if (arr != null) return unescape(arr[2]); return null;
}
function delCookie(name) {
  var exp = new Date();
  exp.setTime(exp.getTime() - 1);
  var cval=getCookie(name);
  if (cval!=null) document.cookie=name +"="+cval+";expires="+exp.toGMTString();
}
/* 内容字体动态选择 */
function jZoomFonts(fsize) {
	if (fsize=="big" || fsize=="normal" || fsize=="small") {
		document.getElementById("zoomFontsArea").className='text_'+fsize;
        setCookie("fsize", fsize);
	}
}
/* 上传图片处理 */
function UploadPic(InputName, PicName) {
    var Width=320;
    var Height=280;
    var Left=window.screen.width/2-Width/2;
    var Top=window.screen.height/2-Height/2;
    window.open('../admin/upload_image.php?PicName='+PicName+'&code='+document.getElementsByName(InputName)[0].value+'&InputName='+InputName, 'UploadPic', 'width='+Width+', height='+Height+', top='+Top+', left='+Left+', resizable=no, scrollbars=yes');
}
function UploadOther(InputName, PicName) {
    var Width=320;
    var Height=280;
    var Left=window.screen.width/2-Width/2;
    var Top=window.screen.height/2-Height/2;
    window.open('../admin/upload_other.php?PicName='+PicName+'&code='+document.getElementsByName(InputName)[0].value+'&InputName='+InputName, 'UploadOther', 'width='+Width+', height='+Height+', top='+Top+', left='+Left+', resizable=no, scrollbars=yes');
}
function DelPic(InputName, PicName) {
    if (document.getElementsByName(InputName)[0].value!="")
        window.open('../admin/upload_save.php?PicName='+PicName+'&mtlAction=del&code='+ document.getElementsByName(InputName)[0].value+ '&InputName='+ InputName, 'up', 'width=1, height=1, top=2000, left=2000, resizable=no, scrollbars=no');
    else
        alert('Tips: 没有找到文件.');
}
function ViewPic(InputName, PicName) {
    if (document.getElementsByName(InputName)[0].value!="")
        window.open('../'+PicName+'/'+document.getElementsByName(InputName)[0].value, 'ViewPic', '');
    else
        alert('Tips: 没有找到任何文件.');
}
/* 弹出窗口 */
function jOpenWindow(url,w,h,r) {
	if (!w) var w = 700;
	w += 38;
	if (!h) h = 510;
	if (!r) r = "no";
	window.open(url,'opWindow','width='+w+',height='+h+',resizable='+r+',scrollbars=yes,top=0');
}

/* 搜索检查 */
function jCheckSearcher(theform, language) {
    var _msg;
    if (language=="cn")
        _msg="Tips：请输入搜索关键字后再进行查询。";
    else if (language=="en")
        _msg="Tips: you must input the keyword field.";
    else
        return false;
	if (theform.swhere.value=="") {
		alert(_msg);
		theform.swhere.focus();
		return false;
	}
	if (theform.keywords.value=="") {
		alert(_msg);
		theform.keywords.focus();
		return false;
	}
}
/* 检查登陆 */
function jCheckLogin(theform, language) {
    var _msg;
    if (language=="cn")
        _msg="Tips：请输入帐号及密码。";
    else if (language=="en")
        _msg="Tips: you must input the username & password field.";
    else
        return false;
	if (theform.username.value=="" || theform.password.value=="") {
		alert (_msg);
		theform.username.focus();
		return false;
	}
}
/* 注销登陆 */
function jLogout(language) {
    var _msg="";
    if (language=="cn")
        _msg="Tips：确定离开吗？";
    else if (language=="en")
        _msg="Tips: Do you want to leave?";
    else
        return false;
	if (confirm(_msg))
		return true;
	else
		return false;
}
/* INPUT样式 */
window.onload=flashstyle;
function flashstyle() {
	var obj=document.body.getElementsByTagName("input");
	for (var i=0;i<obj.length;i++) {
		switch (obj[i].type) {
			case "text" :case "password" :case "file" :
				obj[i].style.border="solid 1px #B7CCE0";
				obj[i].style.padding="2px";
				obj[i].onmouseover=function(){this.style.borderColor="#434648"}
				obj[i].onmouseout=function(){this.style.borderColor="#B7CCE0"}
			break;
			case "submit" :case "reset" :case "button" :
				obj[i].style.cursor="pointer";
				obj[i].style.fontWeight="bold";
				obj[i].style.padding="2px";
				obj[i].style.backgroundColor="#FFFFFF";
				obj[i].style.color="#808080";
				obj[i].style.border="solid 1px #CCCCCC";
				obj[i].onmouseover=function(){this.style.borderColor="#898989"}
				obj[i].onmouseout=function(){this.style.borderColor="#CCCCCC"}
				obj[i].style.filter="progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#E8E8E8,EndColorStr=#FFFFFF)";
			break;
		}
	}
}
/* 弹出窗口显示图片 */
function jShowPhoto(url, windowName) {
	var windowName=(windowName)?windowName:"";
	_url = "show_photo.php#" + url;
	window.open(_url,windowName,'width=0,height=0,resizable=no,scrollbars=no,top=0');
}
// 二级菜单显示/消失
function SubMenuShow(ObjID) {
	if(document.getElementById("subMenu"+ObjID)) {	document.getElementById("subMenu"+ObjID).style.visibility='visible'; }
	//if(document.getElementById("mIMG"+ObjID)) {  document.getElementById("mIMG"+ObjID).src="images/menu_0"+ObjID+"_on.gif"; }
}
function SubMenuHide(ObjID) {
	if(document.getElementById("subMenu"+ObjID)) {	document.getElementById("subMenu"+ObjID).style.visibility='hidden'; }
	//if(document.getElementById("mIMG"+ObjID)) {  document.getElementById("mIMG"+ObjID).src="images/menu_0"+ObjID+".gif"; }
}
/* -------------------------------------------------------------------------------------------------- */



/* 页面底部 */
function jB() {

reval  = "";
reval += "<table width=\"996\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
reval += "  <tr>";
reval += "    <td height=\"2\" bgcolor=\"CDCDCD\"></td>";
reval += "  </tr>";
reval += "  <tr>";
reval += "    <td height=\"1\" bgcolor=\"E8E8E8\"></td>";
reval += "  </tr>";
reval += "  <tr>";
reval += "    <td  bgcolor=\"DDDDDD\" ><table width=\"70%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"0\">";
reval += "  <tr>";
reval += "          <td align=\"center\"><a href=\"about_patent.php\">明博林专利</a> &nbsp;|&nbsp; <a href=\"catalog.php\">索取目录</a> &nbsp;|&nbsp; <a href=\"content.php\">联系我们</a></td>";
reval += "        </tr>";
reval += "        <tr>";
reval += "          <td align=\"center\">地址：深圳市罗湖区锦联路9号综合办公楼第8层806<br>电话：0755-25106053&nbsp;&nbsp;&nbsp;传真：0755-25106053&nbsp;&nbsp;&nbsp;E-mail：peacerli@sina.com.cn</td>";
reval += "        </tr>";
reval += "        <tr>";
reval += "          <td align=\"center\">Copyright © 2010 Shenzhen Minn Bolin Bio-Tech Co.,LTD., All Rights Reserved. <a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\">粤ICP备10200968号</a></td>";
reval += "        </tr>";
reval += "      </table></td>";
reval += "  </tr>";
reval += "</table>";



	document.write(reval);
}

/* 搜索 */
function jPSearch() {
	reval  = "";
	reval += "	  <table width=\"93%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">";
	reval += "      <form id=\"form_search\" name=\"form_search\" method=\"post\" action=\"search.php\">";
	reval += "      <tr>";
	reval += "        <td height=\"15\"></td>";
	reval += "      </tr>";
	reval += "      <tr>";
	reval += "        <td align=\"left\" bgcolor=\"#F2F2F2\" style=\"line-height: 180%;border-left: 1px solid #CFCFCF; border-top: 1px solid #CFCFCF; border-bottom: 1px solid #CFCFCF;border-right: 1px solid #E6E6E6;\">产品搜索<br>";
	reval += "        <input name=\"keyword\" type=\"text\" style=\"width:122px\" /><p align=\"right\"><input name=\"imageField\" type=\"image\" src=\"img/index_go.gif\" align=\"middle\" /></p></td>";
	reval += "      </tr>";
	reval += "      <tr>";
	reval += "        <td height=\"20\"></td>";
	reval += "      </tr>";
	reval += "      </form>";
	reval += "    </table>";

	document.write(reval);
}



/**
 * FlashObject v1.3d: Flash detection and embed - http://blog.deconcept.com/flashobject/
 *
 * FlashObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof com=="undefined"){var com=new Object();}
if(typeof com.deconcept=="undefined"){com.deconcept=new Object();}
if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object();}
if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object();}
com.deconcept.FlashObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
this.useExpressInstall=_7;
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new com.deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}
};
com.deconcept.FlashObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},createParamTag:function(n,v){
var p=document.createElement("param");
p.setAttribute("name",n);
p.setAttribute("value",v);
return p;
},getVariablePairs:function(){
var _19=new Array();
var key;
var _1b=this.getVariables();
for(key in _1b){_19.push(key+"="+_1b[key]);}
return _19;
},getFlashHTML:function(){
var _1c="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
}
_1c="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_1c+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1d=this.getParams();
for(var key in _1d){_1c+=[key]+"=\""+_1d[key]+"\" ";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_1c+="flashvars=\""+_1f+"\"";}
_1c+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_1c="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_1c+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _20=this.getParams();
for(var key in _20){_1c+="<param name=\""+key+"\" value=\""+_20[key]+"\" />";}
var _22=this.getVariablePairs().join("&");
if(_22.length>0){_1c+="<param name=\"flashvars\" value=\""+_22+"\" />";
}_1c+="</object>";}
return _1c;
},write:function(_23){
if(this.useExpressInstall){
var _24=new com.deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_24)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}
}else{this.setAttribute("doExpressInstall",false);}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _23=="string")?document.getElementById(_23):_23;
n.innerHTML=this.getFlashHTML();
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}}};
com.deconcept.FlashObjectUtil.getPlayerVersion=function(_26,_27){
var _28=new com.deconcept.PlayerVersion(0,0,0);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_28=new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{
try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_28=new com.deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_26&&_28.major>_26.major){return _28;}
if(!_26||((_26.minor!=0||_26.rev!=0)&&_28.major==_26.major)||_28.major!=6||_27){
try{
_28=new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}catch(e){}}}
return _28;
};
com.deconcept.PlayerVersion=function(_2c){
this.major=parseInt(_2c[0])||0;
this.minor=parseInt(_2c[1])||0;
this.rev=parseInt(_2c[2])||0;
};
com.deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}
return true;
};
com.deconcept.util={getRequestParameter:function(_2e){
var q=document.location.search||document.location.hash;
if(q){var _30=q.indexOf(_2e+"=");
var _31=(q.indexOf("&",_30)>-1)?q.indexOf("&",_30):q.length;
if(q.length>1&&_30>-1){
return q.substring(q.indexOf("=",_30)+1,_31);}}return "";
},removeChildren:function(n){
while(n.hasChildNodes()){
n.removeChild(n.firstChild);}}};
if(Array.prototype.push==null){
Array.prototype.push=function(_33){
this[this.length]=_33;
return this.length;};}
var getQueryParamValue=com.deconcept.util.getRequestParameter;
var FlashObject=com.deconcept.FlashObject;

