
var sourceName = "xml/footer.xml";
  var source ;   //创建一个MSXML解析器实例
   if (window.ActiveXObject) { 
                    try {
                    
                        source = new ActiveXObject("Msxml2.XMLDOM");
                         
                    } catch (e) {
                        try {
                            source = new ActiveXObject("Microsoft.XMLDOM");
                            
                        } catch (e) {
                        }
                    }
                }


  source.async = false;
  source.load(sourceName);   //装入XML文档
  root = source.documentElement;   //设置文档元素为根节点元素
  if(root!=null){

  }
  var url=document.URL;

  if(url.indexOf("@")==-1){
   url= url.substring(0,url.indexOf(".htm"))
  	}else{
	 url= url.substring(0,url.indexOf("@"))
  }
  
    
  if(url.indexOf(".com.cn/")!=-1)
	url=url.replace('.com.cn/','.com/')

if(url.indexOf(".net/")!=-1)
	url=url.replace('.net/','.com/')

if(url.indexOf("/baiyyy/")!=-1)
	url=url.replace('/baiyyy/','/')
  
  
  
  sortField=root.selectNodes("//page[@url='"+url+"']");   //搜索属性中含有page的所有节点

  
if(sortField.length>0){
  var total=sortField[0].getAttribute('page');//总共的页数

   document.getElementById('test').removeChild(document.getElementById('test').firstChild);
	var	 newText ;
	var harf_a;
	
	//首页链接
		harf_a=document.createElement("a");//首页
		harf_a.href=url+".html";
   		    newText=document.createTextNode("<<");       
   		    harf_a.appendChild(newText);
       		document.getElementById('test').appendChild(harf_a);
       		newText=document.createTextNode(" ");   
       		document.getElementById('test').appendChild(newText);//增加一个空格
		
	//循环显示多页
	for(var i=1;i<=total;i++){
		 harf_a=document.createElement("a");//增加一个链接
		 if(i==1){
			harf_a.href=url+".html";
		}else{
			harf_a.href=url+"@"+i+".html";
			}
   		    newText=document.createTextNode(i);       
   		    harf_a.appendChild(newText);
       		document.getElementById('test').appendChild(harf_a);
       		newText=document.createTextNode(" ");   
       		document.getElementById('test').appendChild(newText);//增加一个空格
		}
		//末页链接
			 harf_a=document.createElement("a");//末页
			harf_a.href=url+"@"+total+".html";
   		    newText=document.createTextNode(">>");       
   		    harf_a.appendChild(newText);
       		document.getElementById('test').appendChild(harf_a);
       		newText=document.createTextNode(" ");   
       		document.getElementById('test').appendChild(newText);//增加一个空格
		
       		}
