﻿function imgout(objTemp){
	objTemp.className = 'ImgOut';
}

function imgover(objTemp){
	objTemp.className = 'ImgOver';
}

function changeimg(objTemp){
	// 
	var bigImg = document.getElementById("bigImg");
	var nowImg = document.getElementById("view_" + objTemp);
	
	if(bigImg!=null && nowImg.tagName=='IMG'){
		bigImg.src = nowImg.src;
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function OpenNode(obj,int){
	var targetObj = document.getElementById('child'+int);//obj.parentNode.nextSibling;
	targetObj.style.display = (targetObj.style.display == 'none')?'block':'none';
	obj.src = (obj.src == 'http://localhost/Scitek/Style/images/pointjia.gif') ? '/Scitek/Style/images/pointjian.gif' : '/Scitek/Style/images/pointjia.gif';
}

function submitit()
{	var strTemp = "";
	
	var Keywords		= document.getElementById("Keywords").value;
	var intCatalogID_1	= document.getElementById("intCatalogID_1").value;
	var intCatalogID_2 	= document.getElementById("intCatalogID_2").value;
	
	if(Keywords != "")
	{
		document.getElementById('searchForm').submit();
		/*
	var strTemp  = "ProductSearch.asp";
		strTemp += "?Keywords="+Keywords;
		strTemp += "&intCatalogID_1="+intCatalogID_1;
	    strTemp += "&intCatalogID_2="+intCatalogID_2;
		//alert(strTemp);
		
		//if(confirm('确定执行更新操作？'))
		location.href=strTemp+'&FromUrl='+window.location;*/
	}
	else
	{
		alert('You must enter the keyword');
	}
}

function ChangeNavigator(ids)
{
	// Hide all
	var arrNav = ['nav_home','nav_about','nav_news','nav_product','nav_tech'];
	for(var i=0;i<arrNav.length;i++)
	{
		var tempObj = document.getElementById(arrNav[i]+"_");
		if(tempObj!=null)tempObj.style.display = 'none';
	}
	document.getElementById(ids+"_").style.display = 'block';
}

//
function ChangeVersion(strVer){
	var strTemp = document.location.href;
	var intF = strTemp.indexOf('?');
	if(intF>0){
		strTemp = strTemp.substring(0,intF);
	}
	//alert(strTemp);
	
	
	if(strVer=='en')
	{
		location.href = strTemp.replace('/cn/','/en/');
	}
	else if(strVer=='cn')
	{
		location.href = strTemp.replace('/en/','/cn/');
	}
}