var xmlhttp = null;
 var DD_now_currpage = 0;
 var DD_page_total=0;
 var DD_scoll_downEnd= 0;

function DD_show_next(DD_total,DD_pagesize,DD_currpage,tourl,pagetype){  
	
 
 	 DD_page_total = parseInt(DD_total);
 	 var pagesize = parseInt(DD_pagesize);
 	 var currpage =  parseInt(DD_currpage);
 	
 	 
 	 if (DD_now_currpage==0){
 	 	
 	 	   DD_now_currpage=currpage + 1 ;
 	 	 
 	 }else{
 	 	
 	    DD_now_currpage = DD_now_currpage + 1;  	 
 	 } 
    
   document.getElementById('DD_show_loadimg').innerHTML = '<span id=\"loadimg\">&nbsp;</span>';
 	 document.getElementById('DD_show_tip').innerHTML = '正在努力加载('+DD_now_currpage+'/'+DD_page_total+')中'; 
     	
     
    	
    	
    	
    if( (DD_now_currpage) > DD_page_total){
    	
       document.getElementById('DD_show_loadimg').innerHTML = '';
       document.getElementById('DD_show_tip').innerHTML = '没有更多了';
      	    	
    }else{    	
    	tourl=tourl + '&' + pagetype + '=' + DD_now_currpage;    	
    	LoadXML_YiBu(tourl);
    	
    	
    }   
    
}


function LoadXML_YiBu(tourl) {  	
        try { 
            if (window.XMLHttpRequest) {           
            xmlhttp = new XMLHttpRequest();           
            if (xmlhttp.overrideMimeType) {
                xmlhttp.overrideMimeType("text/xml");
            }
            } else if (window.ActiveXObject) {           
            var activexName = ["MSXML2.XMLHTTP", "Microsoft.XMLHTTP", ""];
            for (var i = 0; i < activexName.length; i++) {
                try {                   
                    xmlhttp = new ActiveXObject(activexName[i]);
                    break;
                } catch (e) { }
            }
            }
            
            xmlhttp.onreadystatechange = DD_CallBack;
            xmlhttp.open("GET", tourl, true); 
            xmlhttp.send(null);
            //xmlhttp.Charset = "UTF-8";
        } catch (e) {        	
          document.getElementById('DD_show_loadimg').innerHTML = '<span id=\"loadimg\">&nbsp;</span>';
          document.getElementById('DD_show_tip').innerHTML = '加载出错了！';            
        }
    }    
    
function DD_CallBack() {
	
        if (xmlhttp == null) {
            return;
        }       
        if (xmlhttp.readyState == 4) {           
            if (xmlhttp.status == 200) {
                var responseText = xmlhttp.responseText;                
                //alert(responseText);
                //var a=document.createElement("DD_b");
                //a.appendChild(document.createTextNode(responseText));
                 //a.innerHTML(responseText);                      
                //document.getElementById('DD_show_next_list').appendChild(a);
                var st=responseText.indexOf("<!--listS-->");
                var et=responseText.indexOf("<!--listE-->");
                if(st < 0 || et < 0){
                	                	
                	document.getElementById('DD_show_loadimg').innerHTML = '';
                  document.getElementById('DD_show_tip').innerHTML = '加载完全部了！';
                  
                }else{  
                responseText = responseText.substring(st + 12,et);
                document.getElementById('DD_show_next_list').style.display = 'block';                
                document.getElementById('DD_show_next_list').innerHTML +=responseText;   //查看列表
                
                if(DD_now_currpage==DD_page_total){
    		           document.getElementById('DD_show_loadimg').innerHTML = '';
                   document.getElementById('DD_show_tip').innerHTML = '没有更多了';
    	         }else{
    	             document.getElementById('DD_show_loadimg').innerHTML = '';
                   document.getElementById('DD_show_tip').innerHTML = '加载更多('+(DD_now_currpage)+'/'+DD_page_total+')';
               }
                
              }
            }
        }
    }


