
function getnewslistdata(id,sortcode){
	//idvalue=51;//类型ID
	var htmlvalue=$('#producetab'+id).html();
	var num=1;
	if(htmlvalue==''){
		$('#progressbar').show();
		$.getJSON('jsonArticle.action?sortcode='+sortcode+'&handlingstate=1&limit=5&start=0', function(redata) {
			$('#progressbar').hide();
			var prohtml='';
			
			$.each(redata.data,function(idx,item){ 
					var newimg='';
					if(num<4){
						newimg='<img src="images/web/main/news.png"/>';
					}
					prohtml+='<li><span>'+item.checktime.substring(0,10)+'</span><a href="news/detail.jsp?id='+item.id+'" target="_blank">'+item.title.substring(0,20)+'...</a>'+newimg+'</li>';
				num++;
			}); 
			$('#producetab'+id).html('<div id="mainzxcontent"><ul>'+prohtml+'</ul></div>');
			
		});
		
	} 
	for(i=1;i<4;i++){
		if(i==id){
			$('#producetab'+i).css("display","block");
			$('#produce'+i).css("color","#fe6400");
		}else{
			$('#producetab'+i).css("display","none");
			$('#produce'+i).css("color","#626262");
		}
	}
}

var sortcode='';
function gomore(){
	window.location.href="mall/eshop.jsp?sortcode="+sortcode;
}

function getproducelistdata(id,sortcode){
	this.sortcode=sortcode;
	var htmlvalue=$('#producelist'+id).html();
	if(htmlvalue==''){
		$.getJSON('jsonGoods.action?sortcode='+sortcode+'&limit=3&start=0', function(redata){  //加载产品
		
			$('#producebar').show();
			var prohtml='';
			var prohtml1='';
			var num=1;
			$.each(redata.data,function(idx,item){ 
				var imgsrc="../images/shop/eshop/eshopmain.png";
				if(item.imgname!=null){
					imgsrc='../upload/UserFiles/min'+item.imgname;
				}
				//if(num==1){
				//	prohtml='<div class="produceimg"><a href="mall/ebuy.jsp?id='+item.id+'" target="_blank"><img src="'+imgsrc+'" width="200px" height="125px"/></a></div>';
				//}else{ 
					if(num==3){
						prohtml1+='<li style="background-image:none;"><a href="mall/ebuy.jsp?id='+item.id+'" target="_blank"><img src="'+imgsrc+'" width="90px" height="110px"/><br /><span class="profont1">'+item.pluname.substring(0,9)+' </span><span class="profont2"><font class="profont3">RMB:</font>'+item.price+'</span></a></li>';
					}else{
						prohtml1+='<li><a href="mall/ebuy.jsp?id='+item.id+'" target="_blank"><img src="'+imgsrc+'" width="90px" height="110px"/><br /><span class="profont1">'+item.pluname.substring(0,9)+' </span><span class="profont2"><font class="profont3">RMB:</font>'+item.price+'</span></a></li>';
					}
				//}
				num++;
			}); 
			$('#producebar').hide();
			$('#producelist'+id).html(prohtml+'<div class="produceinfo"><ul>'+prohtml1+'</ul></div>');
			
		});
	}
}

function changeimage(id){
	for(i=1;i<6;i++){
		if(i==id){
			$('#mainpictitle'+i+' a').css('color','#fff');
			$('#mainpictitle'+i).css('background','#666666');    
			$('#mainpic'+i).fadeIn();
		}
		else{
			$('#mainpictitle'+i+' a').css('color','#919191');
			$('#mainpictitle'+i).css('background','#f9f9f9');         
			$('#mainpic'+i).fadeOut();
		}
	}
}
function photo_e(){
	changeimage(5);
	setTimeout('photo_a()',5000);			
}				
function photo_d(){
	changeimage(4);
	setTimeout('photo_e()',5000);			
}
function photo_c(){
	changeimage(3);
	setTimeout('photo_d()',5000);			
}
function photo_b(){
	changeimage(2);
	setTimeout('photo_c()',5000);			
}
function photo_a(){
	changeimage(1);
	setTimeout('photo_b()',5000);			
}
$(function(){
	photo_a();
});
