function getlocation () {

    var w = window ;
        n = 0 ;

    while ( w != null ) {
       if ( w.location.href.indexOf ( "index.html" ) != -1 )
          return w.location.href ;
       w = w.parent ;
       n++ ;
       if ( n > 100 ) {
          //alert ( " deadlock in getlocation !" ) ;
          return null ;
          }
       }
    return null ;
    }

function getnav () {

    var w = window ;
    var w2 ;
    var n = 0 ;

    while ( w != null ) {
       if ( w.nav != null ) return w.nav ;
       w = w.parent ;
    /*   w2 = w.parent ;
       if ( w2 == w ) {
          alert ( "w2 == w : "+w ) ;
          return null ;
          }
       else {
          w = w2 ;
          } */
       n++ ;
       if ( n > 100 ) {
          // alert ( " deadlock in getnav !"+w ) ;
          return null ;
          }
       }
    return null ;
    }

function context () {


    var loc, nav ;

//alert ( "getloc" ) ;
    loc = getlocation () ;
//alert ( "getloc!" ) ;
    if ( loc == null ) {
       // alert ( "no location!" ) ;
       return ;
       }
    nav = getnav () ;
    if ( nav == null ) {
        // alert ( "nav == null" ) ;
	 return ;
         }
// alert ( "initcontext ..." ) ;
    nav.initContext ( loc ) ;
    }

function context1 () {

    window.setTimeout ( 'context0();', 100 ) ;
    }
     
