
	function handlerIframe(){
		ymPrompt.close();
	}
	function insertSubscription(megW0032)
	{
		
		
		var ret = isEmail(dwr.util.getValue("txtsubsEmail"));
		if (isNull(dwr.util.getValue("txtsubsEmail")))
		{
			dwr.util.setValue("subsEmailErr","");
			if (/MSIE 6.0/ig.test(navigator.appVersion)) {
			ymPrompt.win({message:'freeSubs.do?method=modify',width:335,height:315,title:'申请订阅',handler:handlerIframe,autoClose:false,iframe:true})
			
			}
			else{
			ymPrompt.win({message:'freeSubs.do?method=modify',width:335,height:305,title:'申请订阅',handler:handlerIframe,autoClose:false,iframe:true})
			//window.navigate("freeSubs.do?method=modify");
			}
		}
		else if (ret) 
		{
			dwr.util.setValue("subsEmailErr","");
			//window.open("freeSubs.do?method=modify",'newwindow','height=340,width=330,top=200,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')
			ymPrompt.win({message:'freeSubs.do?method=subs&subsEmail='+ dwr.util.getValue("txtsubsEmail"),width:335,height:315,title:'申请订阅',handler:handlerIframe,autoClose:false,iframe:true})
		}
		else
		{
			dwr.util.setValue("subsEmailErr",megW0032);
			document.getElementById('txtsubsEmail').focus();
		}
	}	
		
	function userBG(){
		document.getElementById('j_username').className="userChangeCls";
	}
	
	function userBG2(){
		var useridTextBox=document.getElementById('j_username');
		if(useridTextBox.value==""){
			useridTextBox.className="userCls";}
		else{
			useridTextBox.className="userChangeCls";
		}
	}
	
	function passwordBG(){
		document.getElementById('j_password').className="passwordChangeCls";
	}
	
	function passwordBG2(){
		var useridTextBox=document.getElementById('j_password');
		if(useridTextBox.value==""){
			useridTextBox.className="passwordCls";}
		else{
			useridTextBox.className="passwordChangeCls";
		}
	}
	
	function showMerchandiseList(data)
	{	
		var number=0;
		var cartHTML = "";
		for(var i=0;i<data.searchListTemp.length;i++)
		{
			if(data.searchListTemp[i].mediaMerchandisePriceWithTax!=null){
				 cartHTML+="<ul style='list-style-type:none; background-color:#FFFFFF;margin-bottom:0px;margin-left:2px; margin-top:2px;width: 162px;padding-left:0;float:left;'><li style='float:left;width:60px; padding:2px 5px;'><a href="+"viewCommodInfo.do?method=viewCommodInfo&commodNo="+data.searchListTemp[i].mediaMerchandiseCode+">"
				 +data.searchListTemp[i].mediaMerchandiseName+"</a></li><li style='float:left;text-align:right; width:16px;padding:2px 5px 2px 0px;'>"+data.searchListTemp[i].saleCount+"</li><li class=fontprice12px style='float:left;text-align:right;width:61px;padding:2px 5px;'>¥"+data.searchListTemp[i].mediaMerchandisePriceWithTax+"</li></ul>";
				 number+=data.searchListTemp[i].saleCount;
			 }
		}
		for(var i=0;i<data.searchListTemp.length;i++)
		{
			if(data.searchListTemp[i].mediaMerchandisePriceWithTax==null){//"+data.searchListTemp[i].saleCount+"
			   	 cartHTML+="<ul style='list-style-type:none; background-color:#FFFFFF;margin-bottom:0px;margin-left:2px; margin-top:2px;width: 162px;padding-left:0;float:left;'><li style='float:left;width:60px; padding:2px 5px;'><a href="+"pointsDetail.do?method=doPointsSearch&merchanId="+data.searchListTemp[i].mediaMerchandiseId+"&count=0>"
				 +data.searchListTemp[i].mediaMerchandiseName+"</a></li><li style='float:left;text-align:right; width:16px;padding:2px 5px 2px 0px;'>"+data.searchListTemp[i].saleCount+"</li><li class=fontprice12px style='float:left;text-align:right;width:61px;padding:2px 5px;'>积分"+data.searchListTemp[i].pointPrice+"点</li></ul>";
				 number+=data.searchListTemp[i].saleCount;
			 }
		}
		document.getElementById("dd").innerHTML = cartHTML;
		if(navigator.appName.indexOf("Explorer") >-1){
			document.getElementById("totalPrice").innerText="¥"+data.totalPrice;
		    document.getElementById("totalPoint").innerText=data.totalPoint+"点";
			document.getElementById("number").innerText="(共有"+i+"种商品，合计"+number+"件)";
		}else{
			document.getElementById("totalPrice").textContent="¥"+data.totalPrice;
		    document.getElementById("totalPoint").textContent=data.totalPoint+"点";
			document.getElementById("number").textContent="(共有"+i+"种商品，合计"+number+"件)";
		}	
	}
	
	function showGs()
	{
	var showGs = getCookie("sideBody_showGs");
		if(showGs==null||showGs!="true")
		{
		setCookie("sideBody_showGs","true");
		document.getElementById("gs").style.display="block";
		if(navigator.appName.indexOf("Explorer") >-1){
		document.getElementById("link").innerText="隐藏商品";}
		else{
		document.getElementById("link").textContent="隐藏商品";
		}
		}
		else
		{
		setCookie("sideBody_showGs","flase");
		document.getElementById("gs").style.display="none";
		if(navigator.appName.indexOf("Explorer") >-1){
		document.getElementById("link").innerText="显示所有商品";}
		else{
		document.getElementById("link").textContent="显示所有商品";
		}
		}
	}
	
	function next(){
		var userid = document.getElementById("userId").innerHTML;
		if(isNull(userid)){
			document.cookie="URL=/showMerchandiseForCart.do?method=searchCookie";
			window.location.href="./jump.do?method=next";
		}else {
			window.location.href="./showMerchandiseForCart.do?method=searchCookie";
		}

	}
	//change news status
	function changeShowHideNews()
	{
		var showNews = getCookie("sideBody_showNews");
		if(showNews==null||showNews!="true")
		{
			setCookie("sideBody_showNews","true");
		}
		else
		{
			setCookie("sideBody_showNews","flase");
		}
		
		if(document.getElementById('newsContain').style.display=='none')
		{
			document.getElementById('newsContain').style.display='block';
			document.getElementById('newsInfoImg').src="./images/sideBody/sideBody/askulquicknews_down.png";
		}
		else
		{
			document.getElementById('newsContain').style.display='none';
			document.getElementById('newsInfoImg').src="./images/sideBody/sideBody/askulquicknews.png";
		}
	}
	
	function changeShowHideCart()
	{
		var showCart = getCookie("sideBody_showCart");
		
		if(showCart==null||showCart!="true")
		{
			setCookie("sideBody_showCart","true");	
		}
		else
		{
			setCookie("sideBody_showCart","flase");	
		}
		
		if(document.getElementById('shoppingcar').style.display=='none')
		{
			document.getElementById('shoppingcar').style.display='block';
			document.getElementById('cartInfoImg').src="./images/sideBody/sideBody/cart_down.jpg";
		}
		else
		{
			document.getElementById('shoppingcar').style.display='none';
			document.getElementById('cartInfoImg').src="./images/sideBody/sideBody/cart.jpg";
		}
		
		
		
	}
	
	//回车事件
function buttonSubmitForSidebody(event){
	if(event.keyCode==13){
		
			loginSubmitForSidebody();
	}
}
	
	function showHideNews()
	{
		
		var showNews = getCookie("sideBody_showNews");
		if(showNews==null||showNews!="true")
		{
			document.getElementById('newsContain').style.display='none';
			document.getElementById('newsInfoImg').src="./images/sideBody/sideBody/askulquicknews.jpg";
		}
		else
		{
			document.getElementById('newsContain').style.display='block';
			document.getElementById('newsInfoImg').src="./images/sideBody/sideBody/askulquicknews_down.jpg";
		}
	}
	
	function showHideCart()
	{
	
		var showCart = getCookie("sideBody_showCart");
		
		if(showCart==null||showCart!="true")
		{
			document.getElementById('shoppingcar').style.display='none';
			document.getElementById('cartInfoImg').src="./images/sideBody/sideBody/cart.jpg";
		}
		else
		{
			document.getElementById('shoppingcar').style.display='block';
			document.getElementById('cartInfoImg').src="./images/sideBody/sideBody/cart_down.jpg";
		}
	}
	
	//显示子菜单
	function showRecentMenu(subMenuID) {
		if(document.getElementById(subMenuID).style.display == 'none') {
			document.getElementById(subMenuID).style.display = 'block';
		}
		else{
			document.getElementById(subMenuID).style.display = 'none';
		}
		
	}

