// JavaScript Document
function GetKongJian(strkj)
{
	try
	{
		if (GetKongJian)
		{
			return eval('document.getElementById("'+strkj+'")');
		}
		else
		{
			return eval('document.all.'+strkj);
		}
	}
	catch(e)
	{}
}
function GetUrl(NewId){
	var x = GetKongJian("menu");
	if(!x) return;
	var y = x.getElementsByTagName("span");	
	for (var i=0;i<y.length;i++){
		if (i+1==NewId) y[i].className = "oLink";
		else  y[i].className = "";
	}	
}
function ToSearch(){
	var t = GetKongJian("iKeyWords").value.replace(" ","")
	if(t == ""){
	    alert("Please input keywords");
		return false;	
	}else{
	    var iAction = GetKongJian("tSearchType").options[GetKongJian("tSearchType").selectedIndex].value;
		var iUrl = "/Electronic-Picture/" + t + "/t1-p1.aspx";
		if (iAction==1) iUrl = "/Inventory/" + t + "/t1-p1.aspx";
		if (iAction==2) iUrl = "/DownLoad/" + t + "/t1-p1.aspx";
		window.location = iUrl;
	}
}
function  EnterKey()
{
if(event.keyCode == 13) GetKongJian("Searchbtn").focus();
}
function GetPage(iPage){
	var xx=location.href;
	var s;
	if (xx.indexOf("-p") == -1){
		 s=xx.replace('.aspx','-p'+escape(iPage)+'.aspx');     
	}else s=xx.replace(/-p\d+.aspx/,'-p'+escape(iPage)+'.aspx'); 	    
	window.location=s;
}