/*rep.js
 * Mark Huppert, SIS Library WDC
 * 23/10/2008
 */

//mouseovers for library links
addLoadListener(yeah);
function yeah() {
if(!document.getElementById('lslinks')) {return;}
    var l=document.getElementById('lslinks').getElementsByTagName('LI');
for(var i=0;i<l.length;i++) {
     if(l[i].className!='sel') {
         l[i].onmouseover=function() {this.className='sel';}
         l[i].onmouseout=function() {this.className='nonsel';}
     }
}
}

//suppress home link on home page
addLoadListener(function() {
var h=document.getElementById('homelink');
if(/services\/repository\/$/.test(location.href)) {h.className='hideboard';}
});


//change icons
addLoadListener(function() {
    var r=document.getElementById('repnavrow').getElementsByTagName('A');
    for(var i=0;i<r.length;i++) {
        if(/Learning Space/.test(r[i].innerHTML)&& /stage3/.test(location.href)) { r[i].firstChild.src='/services/repository/images/footer12on.gif';break;}
        if(/About the Print/.test(r[i].innerHTML)&&/repository.html/.test(location.href)) {r[i].firstChild.src='/services/repository/images/footer07on.gif';break;}
        if(/Moving/.test(r[i].innerHTML)&&/Moving.html/.test(location.href)) { r[i].firstChild.src='/services/repository/images/footer04on.gif';break;}
        if(/Accessing/.test(r[i].innerHTML)&&/accessing.html/.test(location.href)) { r[i].firstChild.src='/services/repository/images/footer05on.gif';break;}
        if(/Contacts/.test(r[i].innerHTML)&&/contacts.html/.test(location.href)) { r[i].firstChild.src='/services/repository/images/footer11on.gif';break;}
        if(/About the Project/.test(r[i].innerHTML)&&/aboutTheProject/.test(location.href)) {r[i].firstChild.src='/services/repository/images/footer03on.gif';break;}
    }
});
