function initBrand(){
	$(".brandCatSpan").mouseover(function (){
		id=$(this).attr("id").replace('brandCatSpan','');
		showHide('brandCatDiv'+id,'show');
	});
	$(".brandCatSpan").mouseout(function (){
		id=$(this).attr("id").replace('brandCatSpan','');
		showHide('brandCatDiv'+id,'hide');
	});
	$(".brandCatDiv").mouseover(function (){
		showHide($(this).attr("id"),'show');
	});
	$(".brandCatDiv").mouseout(function (){
		showHide($(this).attr("id"),'hide');
	});

	$(".brandShopSpan").mouseover(function (){
		id=$(this).attr("id").replace('brandShopSpan','');
		showHide('brandShopDiv'+id,'show');
	});
	$(".brandShopSpan").mouseout(function (){
		id=$(this).attr("id").replace('brandShopSpan','');
		showHide('brandShopDiv'+id,'hide');
	});
	$(".brandShopDiv").mouseover(function (){
		showHide($(this).attr("id"),'show');
	});
	$(".brandShopDiv").mouseout(function (){
		showHide($(this).attr("id"),'hide');
	});
}

function showHide(obj,act){
	if ($("#"+obj))
	{
		if (act=="hide")
		{
			$("#"+obj).hide();
		}else{
			$("#"+obj).show();
		}
	}
}

function setAjax(id,url){
	$.ajax({
		url: url,
		cache: false,
		success: function(html){
			$("#"+id).html(html);
		}
	});
}

function setAjaxAppend(id,url){
	$.ajax({
		url: url,
		cache: false,
		success: function(html){
			$("#"+id).append(html);
		}
	});
}

function checkLogin(){
	if (document.loginForm.username.value=="")
	  {
		  alert("用户名不能为空！");
		  loginForm.username.focus();
		  return false;
	  }
	if (document.loginForm.password.value=="")
	  {
		  alert("密码不能为空！");
		  loginForm.password.focus();
		  return false;
	  }
	if (document.loginForm.verify.value=="")
	  {
		 //alert("验证码不能为空！");
		 loginForm.verify.focus();
		 //return false;
	  }
	  return true;
}

function checkSearch(){
	if (document.searchForm.keyword.value=="")
	{
		alert("关键字不能为空！");
		searchForm.keyword.focus();
		return false;
	}
	return true;
}

function checkComment(){
	if (document.commentForm.username.value=="")
	{
		alert("用户名不能为空！");
		commentForm.username.focus();
		return false;
	}
	if (document.commentForm.note.value=="")
	{
		alert("评论内容不能为空！");
		commentForm.note.focus();
		return false;
	}
	return true;
}
