

//菜单循环显示
 function itemOut(itParam){

     var itemParam=decodeURI(itParam);
	     if(itemParam!="undefined" && itemParam!="2" && itemParam!=""){
	    	 var citName={itemParam:itemParam};
	    	 
	    $.ajax( {
			type :"POST",
			url :projectName()+"servlet/QueryMenuItem",
			data :citName,
			success :function (str){ 
					$("#accordions").html(str);
			          		xx();//添加菜单展开样式		          		   
							if(getParameter("index")!=""){							
								var index=getParameter("index");
					                      var endIndex="";
								if(index.indexOf("#")!=-1){
										endIndex=index.substring(index.indexOf("#")+1,index.length);
									index=index.substring(0,index.indexOf("#"));
                               	}	
								var datax=new Array();
								var acount=0;
								if(index.indexOf("-")!=-1){
									datax=index.split('-');
								      index=datax[0];
								      acount=datax[1];
					           	}	
								var p=$('#accordions>.accordion').eq(index).find("p").eq(0);
								p.addClass('accor-title-selected1').parent().siblings().find('.accor-title1').removeClass('accor-title-selected1');	
								var v2=p.attr("c2");
						
								p.attr("style","background-image: url(../pic/infoType/"+v2+")");
						    	var links = $('#accordions>.accordion').eq(index).find('li').find("a").eq(acount).attr("onclick")+"";
								var temp=links.substring(links.indexOf('{')+1,links.indexOf('}'));		
								var array=temp.substring(temp.indexOf('(')+1,temp.indexOf(')')).split(',');
							    var citID=array[0].replace(/\'/g, "");
							    		if(endIndex!=""){
							    			citID=endIndex;		    			
							    			array[0]="1";
							    			array[1]="";
							    		}
							       pk(citID,array[1],array[2]);
							 }}	
		   })
	     }
}  
 //首页新闻浏览
 function  newsItemOut(itParam,st){ 
	             var itemParam=decodeURI(itParam);
	     if(typeof(itemParam)!=undefined && itemParam!=""){
	    	 var citName={itemParam:itemParam};		
	    $.ajax( {
			type :"POST",
			url :projectName()+"servlet/NewsInfoPageServlet",
			data :citName,
			success :function (str){

	             var div="#right_box"+st;
            	$(div).html(str);
            	  $(div).find("table").eq(0).find("tr").each(function(){    		  
            		  $(this).children("td").eq(0).find("a").eq(0).click(function(){	
            			           
            			  var param={citID:$(this).attr("id"),itemParam:itemParam};
                 		var aIndex=$(this).parent().attr("id");
                 	
                		  $.ajax( {
            		   			type :"POST",
            		   			url :projectName()+"servlet/ForwordServlet",
            		   			data :param,
            		   			success :function (str){                
            				         var index=str;
            				 window.location.href ="javascript:this.window.location=gotoSecondUrl('about','about.html',"+index+",'"+aIndex+"','关于八方')";   		     		
            		        }
            		    }) 
            		  })
            	  })
				}		    
		   })
	     }
 }	 
 function pk(cID,citfj,citParent){

	 var citID=cID;
	 var param={citID:citID,citParent:citParent,type:'0'};
       if(citfj=="0"){
    	   $.ajax( {
   			type :"POST",
   			url :projectName()+"servlet/MoreNewsInfoServlet",
   			data :param,
   			success :function (str){
     		   $("#line").attr("src","../createHtml/"+citID+".html");
        }
    	   })
       }
       else{
	  if(citID!=null&& citID!=""){
		  $("#line").attr("src","../createHtml/"+citID+".html");
	  }
       } 
}
 function showTitle()
 {	 
	 $('#title4',parent.document).html(" ");
	 var title3=$('#title3',parent.document).text();
	 $('#title4',parent.document).html(title3+" &gt; <span class='red'>"+$(this).text()+"</span>");		
 }
 $(document).ready(function() {
	// 任何需要执行的js特效
	itemOut(getParameter("ff"));
		newsItemOut($("#ul_id").find("li").eq(0).text(),1);
	});
