function initNav( m ){ document.oneChan=true; var nf=null;nf=new NavFolder(m,true, 0, 1,"Home","null"); nf.setSite('www.independent.co.uk'); nf.setHostId(1); m.add(1, nf) nf=new NavFolder(m,true, 0, 45,"News","null"); nf.setSite('news.independent.co.uk'); nf.setHostId(3); m.add(45, nf) nf=new NavFolder(m,true, 0, 48,"Sport","null"); nf.setSite('sport.independent.co.uk'); nf.setHostId(18); m.add(48, nf) nf=new NavFolder(m,true, 0, 54,"Comment","null"); nf.setSite('comment.independent.co.uk'); nf.setHostId(6); m.add(54, nf) nf=new NavFolder(m,true, 0, 364,"Education","null"); nf.setSite('education.independent.co.uk'); nf.setHostId(16); m.add(364, nf) nf=new NavFolder(m,true, 0, 1090,"Motoring","null"); nf.setSite('motoring.independent.co.uk'); nf.setHostId(32); m.add(1090, nf) nf=new NavFolder(m,true, 0, 351,"Money","null"); nf.setSite('money.independent.co.uk'); nf.setHostId(14); m.add(351, nf) nf=new NavFolder(m,true, 0, 753,"Jobs","null"); nf.setSite('jobs.independent.co.uk'); nf.setHostId(29); m.add(753, nf) nf=new NavFolder(m,true, 0, 2,"Travel","null"); nf.setSite('travel.independent.co.uk'); nf.setHostId(2); m.add(2, nf) nf=new NavFolder(m,true, 0, 53,"Enjoyment","null",193,"Books","books",270,"Crosswords","crosswords",742,"Dating","dating",194,"Film","film",195,"Food & Drink","food_and_drink",196,"Music","music",264,"Photography","photography",197,"Theatre","theatre"); nf.setSite('enjoyment.independent.co.uk'); nf.setHostId(5); m.add(53, nf) m.add(193,new NavFolder(m,false,15,193,"Books","books",205,"News","news",207,"Reviews","reviews",497,"Features","features",204,"Interviews","interviews")); m.add(270,new NavFolder(m,false,77,270,"Crosswords","crosswords",493,"Cryptic","cryptic",494,"e-break","e-break")); m.add(742,new NavFolder(m,false,171,742,"Dating","dating")); m.add(194,new NavFolder(m,false,222,194,"Film","film",215,"News","news",216,"Reviews","reviews",211,"Features","features",213,"Interviews","interviews")); m.add(195,new NavFolder(m,false,272,195,"Food & Drink","food_and_drink",223,"News","news",499,"Reviews","reviews",222,"Features","features",224,"Recipes","recipes")); m.add(196,new NavFolder(m,false,373,196,"Music","music",231,"News","news",230,"Reviews","reviews",227,"Features","features",229,"Interviews","interviews")); m.add(264,new NavFolder(m,false,431,264,"Photography","photography")); m.add(197,new NavFolder(m,false,531,197,"Theatre","theatre",500,"News","news",263,"Reviews","reviews",235,"Features","features",501,"Interviews","interviews")); var vals = m.getValues(); for( var n=0; n 0 ){ var expandNd = document.createElement("img"); expandNd.setAttribute("src", "http://www.independent.co.uk/img/newsite/furniture/navi_expandit.gif"); expandNd.setAttribute("width", 13 ); expandNd.setAttribute("height", 11 ); sectionFdr.appendChild( expandNd ); }//if sectionFdr.appendChild( sectionFdr.subSectionsContainer ); this.appendChild( sectionFdr.displayContainer ); }else{ var linkNd = this.getLinkNode( c ); this.subSectionsContainer.appendChild( linkNd ); this.subSectionsContainer.appendChild( document.createElement("br") ); }//if }//for this.createChildNodes=false; }; NavFolder.prototype.setSite = function(s){ this.siteUrl = s; } NavFolder.prototype.setChannelRef = function(ref){ this.channelRef = ref; } NavFolder.prototype.getChannelRef = function(){ return this.channelRef; } NavFolder.prototype.setOpenChild = function(ch){ this.openChild=ch; } NavFolder.prototype.getOpenChild = function(){ return this.openChild; } NavFolder.prototype.getLink = function(){ var isSS= this.clickedChildHref != null; var reDir = isSS ? this.lkUp.get( "rdf_"+ this.clickedChildId ) : this.lkUp.get( "rdf_"+ this.folderId ); if( reDir ) return reDir; var link = this.isRoot ? this.siteUrl : this.getChannelRef().siteUrl; if( ! this.isRoot ) link += ("/"+ this.folderUrl +"/"); link = "http://"+link; if( this.clickedChildHref != null ) link += ( this.clickedChildHref +"/"); return link; }//fn NavFolder.prototype.appendChild = function( childNode ){ if( childNode ) this.displayContainer.appendChild( childNode ); }; NavFolder.prototype.getLinkNode = function( f ){ var sectionRef = this, id=this.folderIds[f]; var linkNd = document.createElement("a"); linkNd.href = "#"; linkNd.id="lnk"+id; var relUrl=this.relUrls[f]; linkNd.onclick = function(){ sectionRef.clickedChildHref=relUrl; sectionRef.clickedChildId=id; return false; } linkNd.appendChild( document.createTextNode( this.navNames[f] ) ); if( ! this.isRoot ) linkNd.getNF=function(){ return sectionRef; }; return linkNd; }; NavFolder.prototype.setDisplayContent = function(sectsEl){ this.displayContent = sectsEl; this.displayContainer.appendChild( this.displayContent ); }; NavFolder.prototype.clearDisplayContent = function(){ if( this.displayContent ){ this.displayContainer.removeChild( this.displayContent ); this.displayContent = null; }//if }; NavFolder.prototype.showChildren = function( displayNd ){ if( (this.numChildren < 1) && (this.displayContent==null) ) return; if( this.isRoot ){ this.displayNd = displayNd; if( this.displayContent==null ){ for( var s=1; s<= this.numChildren; s++ ){ var nf = this.lkUp.get( this.folderIds[s] ); if( nf && nf.subSectionsContainer ) nf.subSectionsContainer.style.display="none"; }//for }//if this.displayNd.appendChild( this.displayContainer ); }else{ this.getChannelRef().setOpenChild( this ); this.subSectionsContainer.style.display="block"; }//else }; NavFolder.prototype.hideChildren = function(){ if( this.isRoot ){ if( this.displayNd ){ this.displayNd.removeChild( this.displayContainer ); this.displayNd=null; }//if }else{ this.clickedChildHref=null; this.clickedChildId=null; var openChild = this.getChannelRef().getOpenChild(); if( openChild != null ) this.subSectionsContainer.style.display="none"; this.getChannelRef().setOpenChild( null ); }//else }; function getEventSource( evt, cancelPropogation){ evt=(evt)? evt:window.event; if( ! evt ) return null; if( cancelPropogation ){ if( evt.stopPropogation ) evt.stopPropogation(); else evt.cancelBubble=true; }//if var el= evt.srcElement ? evt.srcElement : evt.target; while(! el.getNF ) el = el.parentNode; if( el.getNF ) return el.getNF(); return null; }//fn function nvContainerMouseOver(evt){ var channelNF = document.indyNavLookup.get( channelFolderId ); var oc = channelNF.getOpenChild(); if( oc ) oc.hideChildren(); }//fn function doSectionMouseover( evt ){ var nf=getEventSource( evt, true ); if( ! nf ) return; if( nf.getChannelRef() == null ) return; var oc = nf.getChannelRef().getOpenChild(); if( oc && ( oc != nf ) ) oc.hideChildren(); nf.showChildren(); }//fn function handleNavClick( evt ){ var nf=getEventSource( evt, true ); if( nf == null ) return; var loc=nf.getLink(); if( loc != null ) location.href=loc; }//fn function doChannelClick( fdrId ){ var nf = document.indyNavLookup.get( fdrId ); if( nf == null ) return false; var loc=nf.getLink(); if( loc != null ) location.href=loc; return false; }//fn function chanNav(id){ if( (id!=channelFolderId) && ! document.oneChan) setNav( id ); }//fn function setNav(id){ showChannel( id ); var nvSects=getNode("nvSections"); nvSects.style.visibility="hidden"; var nf=document.indyNavLookup.get( channelFolderId ); nf.hideChildren(); nf = document.indyNavLookup.get(id); nf.showChildren( nvSects ); nvSects.style.visibility="visible"; channelFolderId = id; }//fn function showChannel( folderId ){ var tblNd = getNode("navTbl"); tblNd.style.visibility="hidden"; var nvNd = getNode( "nvf"+ channelFolderId ); if( nvNd != null ) nvNd.className="off"; var bdrNd = getNode("nvsp"+ channelFolderId ); if( bdrNd != null ) bdrNd.className="offBdr"; bdrNode = getNode("nvsp"+ folderId ); bdrNode.className = "onBdr"; nvNd = getNode( "nvf"+folderId ); nvNd.className="on"; tblNd.style.visibility="visible"; }//fn function eNav(chFdrId,url,storyId){ var linkNd=getNode("indyNavigator"); setLinkNode(linkNd,chFdrId,url,storyId); window.status = "Loading ... "+ linkNd.href; window.location.href=linkNd.href; return false; }//fn function setLinkNode(linkNd,chFdrId,url,storyId){ var rf=document.indyNavLookup.get( chFdrId ); if(rf==null) return false; var loc; if( document.udsLowResMode ){ loc = "/low_res/"; if( storyId ){ loc+="story.jsp?story="+storyId+"&"; }else loc+= "index.jsp?"; loc+= "host="+ rf.getHostId() +"&folder="+ escape( url ); linkNd.href=loc; } loc= rf.getLink(); if( url ) loc+=url; if( storyId ) loc+= "story.jsp?story="+storyId; linkNd.href=loc; }//fn