//设置字体大小
function setfont(size){
	document.getElementById("news-text").style.fontSize=size+"px";
}

function swImg(iName,str)
{
	document.images[iName].src = str;
}

//搜索
function setv(obj){
	for(i=1;i<5;i++){
		document.getElementById("v"+i).className="";
	}
	document.getElementById("v"+obj).className="li2";
	document.getElementById("v").value=obj;
	sohot(obj);
}
var keyword=[["力士乐","萨澳","川崎","林德"],["马达系列","泵系列"],["力士乐","川崎","萨澳"],["聚氨酯","液压元件","液压维修"]];
//var keyword=[["维修"],["产品"],["配件"],["资讯"]];
function sohot(obj){
	var temp_hot="";
	for(var i=0;i<keyword[obj-1].length;i++){
		temp_hot+="<li><a href=/plus/tags.asp?n="+keyword[obj-1][i]+">"+keyword[obj-1][i]+"</a></li>";
//原来搜索链接地址取值		temp_hot+="<li><a href='/search.aspx?keyword="+keyword[obj-1][i]+"&&v="+obj+"' target='_blank'>"+keyword[obj-1][i]+"</a></li>";
	}
	document.getElementById("search-hot").innerHTML=temp_hot;
}

//“来源”编码
function Asi(str){
	var str_array=str.split(',');
	var temp_asi="";
	for(i=0;i<str_array.length;i++){
		temp_asi+=String.fromCharCode(str_array[i]);
	}
	document.write(temp_asi);
}

function MM_openBrWindow(theURL,winName,features){ //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//ObjectSwap
var ie = (document.defaultCharset && document.getElementById && !window.home);
var opera9 = false;
if (ie){
	var ver=navigator.appVersion.split("MSIE")
	ver=parseFloat(ver[1])
	ie = (ver >=6)
}else if (navigator.userAgent.indexOf("Opera")!=-1) {
	var versionindex=navigator.userAgent.indexOf("Opera")+6
	if (parseInt(navigator.userAgent.charAt(versionindex))>=9)
	opera9 = true;
}
var oswap = (ie || opera9)
if (oswap){
	document.write ("<style id='hideObject'> object{display:none;} </style>");
}
objectSwap = function(){
	if (!document.getElementsByTagName){
		return;
	}
	var stripQueue = [];
	var objects = document.getElementsByTagName('object');
	for (var i=0; i<objects.length; i++){			
		var o = objects[i];	
		var h = o.outerHTML;
		var params = "";
		var hasFlash = true;
		for (var j = 0; j<o.childNodes.length; j++) {
			var p = o.childNodes[j];
			if (p.tagName == "PARAM"){
				if (p.name == "flashVersion"){
					hasFlash = detectFlash(p.value);
					if (!hasFlash){
						o.id = (o.id == "") ? ("stripFlash"+i) : o.id;
						stripQueue.push(o.id);
						break;
					}
				} 
				params += p.outerHTML;		       
			}
		}	
		if (!hasFlash){
			continue;
		}		
		if (!oswap){
			continue;
		} 
		if (o.className.toLowerCase().indexOf ("noswap") != -1){
			continue;
		}		
		var tag = h.split(">")[0] + ">";			
		var newObject = tag + params + o.innerHTML + " </OBJECT>";	
		o.outerHTML = newObject;
	}
	if (stripQueue.length) {
		stripFlash(stripQueue)
	}
	if (oswap){
		document.getElementById("hideObject").disabled = true;
	}
}
detectFlash = function(version){
	if(navigator.plugins && navigator.plugins.length){
		var plugin = navigator.plugins["Shockwave Flash"];
		if (plugin == undefined){
			return false;
		}
		var ver = navigator.plugins["Shockwave Flash"].description.split(" ")[2];
		return (Number(ver) >= Number(version))
	} else if (ie && typeof (ActiveXObject) == "function"){
		try{
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + version);
			return true;
		}
		catch(e){
			return false;
		}
	}
	return true;
}
stripFlash = function (stripQueue){
	if (!document.createElement){
		return;
	}
	for (var i=0; i<stripQueue.length; i++){
		var o = document.getElementById(stripQueue[i]);
		var newHTML = o.innerHTML;	
		newHTML = newHTML.replace(/<!--\s/g, "");
		newHTML = newHTML.replace(/\s-->/g, "");
		newHTML = newHTML.replace(/<embed/gi, "<span");		
		var d = document.createElement("div");
		d.innerHTML = newHTML;
		d.className = o.className;
		d.id = o.id;
		o.parentNode.replaceChild(d, o);
	}
}
var tempFunc = window.onload;
window.onload = function(){
	if (typeof (tempFunc) == "function"){
		try{
			tempFunc();
		} catch(e){}
	}
	objectSwap();
}


	var arrMenu=['leftmenu1','leftmenu2','leftmenu3'];
var arrMenus=['leftmenu21','leftmenu22','leftmenu23','leftmenu24','leftmenu25','leftmenu26','leftmenu27','leftmenu28','leftmenu29','leftmenu30','leftmenu31','leftmenu32','leftmenu33','leftmenu34','leftmenu35'];

function initMenu(){
	for(var i=0;i<arrMenu.length;i++){
		var menu=document.getElementById(arrMenu[i]);
		if(menu != null){
			menu.style.display='block';
		}
	}
}
function closeMenus(){
	for(var i=0;i<arrMenus.length;i++){
		var menu=document.getElementById(arrMenus[i]);
		if(menu !=null){
			menu.style.display='none';
		}
	}
}
function ShowMenuToId(meun){
	closeMenus();
	var obj=document.getElementById(meun);
	if(obj){
		obj.style.display='block';
	}
}
function ShowMenu(obj)
{
	//var obj=document.getElementById(Obj);
	if(obj){
		if (obj.style.display!='none'){
			obj.style.display='none';
		}
		else{
			obj.style.display='';
		}
	}

	for(var i=0;i<arrMenus.length;i++){
		var menu=document.getElementById(arrMenus[i]);
		if(menu != null ){
		    if (obj!=document.getElementById(arrMenus[i]))
		    {
		    
			menu.style.display='none';}
		}
	}
}
