﻿			//登录后台
			function LoginTo(){
			
				if(document.loginForm.usr.value == "" || document.loginForm.pwd.value == ""){
					alert("请输入用户名和登录密码。");
					return false;
				}
			
				var ltObj = document.getElementById("lt");
			
				if(ltObj.value == "1"){
					document.loginForm.action = "./Enterprise/Login.aspx";
				}else{
					document.loginForm.action = "./SystemBack/Login.aspx";
				}
				
				document.loginForm.submit();
				
			}
			
			//切换TAB状态
			function changeTabState(dn,index,oncn,cn){
				
				for(var i=1;i<100;i++){
					
					var obj = document.getElementById(dn + i);
					
					if(obj){
						
						if(i == index){
							obj.className = oncn;
						}else{
							obj.className = cn;
						}
						
					}else{
						break;
					}
					
				}
				
			}


function $(cn){
	return document.getElementById(cn);
}

function Search(){
	
	var selobj  = $("searchtype");
	var keyword = $("keyword");
	var tobj    = $("type");
	
	if(keyword.value == ""){
		alert("请输入关键词");
	}else{
	
		var index = selobj.options[selobj.selectedIndex].value;
		var path  = "";
		
		switch(index){
			
			case "0":
				path = "AuctionList.aspx";
				break;
			case "1":
				path = "AuctionShow.aspx";
				break;
			case "2":
				path = "EntList.aspx";
				break;
			case "3":
				path = "CmsList.aspx";
				break;
			default:
				break;
		}
		
		var xtype = tobj.options[tobj.selectedIndex].value;
		
		var type = xtype.split(",")[0];
		var index  = xtype.split(",")[1];
		
		if(path == ""){
			alert("未知的去向。");
		}else{
		
			location.href = path + "?keyword=" + encodeURIComponent(keyword.value) + "&nid="+ type +"&typeid=" + type + "&i=" + index;
		}
	}
	
}

function OpenWin(linkPath,width,height,scroll,resiz){

	var left = (window.screen.width  - width)  / 2 - 30;
	var top  = (window.screen.height - height) / 2 - 30;
	
	var scrollbars = "no";
	var resizable  = "no";
	
	if(scroll) scrollbars = scroll;
	if(resiz)  resizable  = resiz;
	
	window.open(linkPath,"","width="+ width +",height="+ height +",left="+ left +",top="+ top +",scrollbars="+ scrollbars +",resizable=" + resizable);
}
