//用户登录表单Check
function checkLogin(){
	var LoginForm=document.getElementById("LoginForm");
	if (LoginForm.userName.value ==""){
		alert("请输入用户名！");
		LoginForm.userName.focus();
		return false;
	}
	if (LoginForm.password.value ==""){
		alert("请输入用户密码！");
		LoginForm.password.focus();
		return false;
	}
	return true;
}
//加入收藏
function addFavorite(sURL,sName){
	if (document.all){
		window.external.addFavorite(sURL,sName);
	}
 	else if (window.sidebar){
		window.sidebar.addPanel(sName,sURL, "");
	}
}
//设为首页
function setHomePage(obj,sURL){
	if (document.all){
		obj.style.behavior='url(#default#homepage)';
		obj.setHomePage(sURL);
	}
 	else if (window.sidebar){
		if(window.netscape){
			alert("抱歉，由于浏览器的原因，不能进行此操作。");
		}
	}
}
//显示隐藏功能菜单
function showHiddenFunctionMenu(){
	var functionArea=document.getElementById("functionArea");
	var contentArea=document.getElementById("contentArea");
	var mainArea=document.getElementById("mainArea");
	var albumTree=document.getElementById("albumTree");
	if(functionArea){
		if(functionArea.style.display=='none'){
			functionArea.style.display="";
			contentArea.style.width = contentArea.offsetWidth +4 - functionArea.offsetWidth - 6; //留6px
			setSameHeight(); //同步高度
			
			if(albumTree){
				albumTree.style.display="none";
			}
		}
		else{
			functionArea.style.display="none";
			contentArea.style.width=mainArea.offsetWidth-4; //留4px空隙，别太满
			if(albumTree){
				albumTree.style.display="";
			}
		}
	}
}
//隐藏功能菜单
function hiddenFunctionMenu(){
	var functionArea=document.getElementById("functionArea");
	var contentArea=document.getElementById("contentArea");
	var mainArea=document.getElementById("mainArea");
	if(functionArea){
		functionArea.style.display="none";
	}
		contentArea.style.width=mainArea.offsetWidth-4; //留4px空隙，别太满
}
//同步功能区和内容区的高度
function setSameHeight(){
	var functionArea=document.getElementById("functionArea");
	var contentArea=document.getElementById("contentArea");
	if(functionArea && contentArea && functionArea.style.display!='none'){
		if(functionArea.offsetHeight<contentArea.offsetHeight){
			functionArea.style.height=contentArea.offsetHeight;
		}
	}
}
//参数：true|false,内容
function setLocation(isAppend,htmlContent){
	var myLocation=document.getElementById("myLocation");
	if(isAppend){
		myLocation.innerHTML += htmlContent;
	}else{
		myLocation.innerHTML += htmlContent;
	}
}