﻿var divnode=document.getElementById("page_pagebom");
var anodelist=divnode.getElementsByTagName("a");
var link_herebom=new Object;
var flagb=true;        
for (var i=2;i<anodelist.length-2;i++) 
{
    if (anodelist[i].href==window.location.href) 
    {
        link_herebom=anodelist[i];        
        flagb=false;
        var span=document.createElement("span");        
        var spantext=document.createTextNode(i-1);
        span.appendChild(spantext);        
        span.setAttribute("className","choose");
        span.setAttribute("class","choose");
        divnode.replaceChild(span,anodelist[i]);             
    }
}
if(flagb==true)
{
    if(anodelist.length>4)
    {
        anodelist[0].removeAttribute("href");                
        anodelist[0].style.cursor="default"; 
        anodelist[1].removeAttribute("href");                
        anodelist[1].style.cursor="default";
        
        var span=document.createElement("span");        
        var spantext=document.createTextNode(1);
        span.appendChild(spantext);
        span.setAttribute("className","choose");
        span.setAttribute("class","choose");
        divnode.replaceChild(span,anodelist[2]);
        
        if(anodelist.length==5)
        {
            anodelist[3].removeAttribute("href");                
            anodelist[3].style.cursor="default";       
            anodelist[4].removeAttribute("href");                
            anodelist[4].style.cursor="default";
        }
    }   
}
if(anodelist.length>4)
{
    if(anodelist[anodelist.length-1].href==window.location.href)
    {
        anodelist[anodelist.length-1].removeAttribute("href");                
        anodelist[anodelist.length-1].style.cursor="default";  
        anodelist[anodelist.length-2].removeAttribute("href");                
        anodelist[anodelist.length-2].style.cursor="default"; 
    }
    if(anodelist[0].href==window.location.href)
    {
        anodelist[0].removeAttribute("href");                
        anodelist[0].style.cursor="default";     
        anodelist[1].removeAttribute("href"); 
        anodelist[1].style.cursor="default";
    }
    else
    { 
    }            
}
