/*
 * Creates the menu
 */

var sections = new Array();
sections["home"] = "Home";
sections["resume"] = "Resume";
sections["blog"] = "Blog";
sections["photo"] = "Photos";
sections["misc"] = "Misc";
sections["contacts"] = "Contacts";

var pageName = location.pathname.substring( location.pathname.lastIndexOf('/') + 1, location.pathname.lastIndexOf('.') );

function createMenu() { 
  for ( var s in sections ) {
     if ( pageName == s ) 
        str = "<li id=\"" + s + "\" class=\"active\"><a href=\"" + "/" + s + ".htm" + "\">" + sections[s] + "</a></li>";
     else
        str = "<li id=\"" + s + "\"><a href=\"" + "/" + s + ".htm" + "\">" + sections[s] + "</a></li>";
     document.writeln( str );
  }
}

function toggleVisible( id ) {
  if (document.getElementById){
    target = document.getElementById( id );
    if (target.style.display == "none"){
     target.style.display = "";
    } else {
     target.style.display = "none";
    }
  }
}

/*
 * Creates the corners
 */

window.onload=function() {
  if( !NiftyCheck() ) return;
  RoundedTop( "div#container","#666666", "#ffffff" );
  RoundedBottom( "div#container","#666666", "#ffffff" );
  // distinguish between active and passive pages
  for ( var s in sections ) {
     obj = "li#" + s;
     if ( pageName == s ) {
        RoundedTop( obj,"transparent","#e7e7e7" );
        if ( s == "blog" ) {
          Rounded( "div#bloglinks", "#ebebeb", "#f6f6f6" );
        }
     }
     else {
        RoundedTop( obj,"transparent","#467AA7" );
     }
  }
}

/*
 * Encode the email address
 */
function email_as_here(){var kode=
"kode=\"nrgh@%>,**=,40kwjqho1hgrn+wDudkf1hgrnBkwjqho1hgrn?l+.{@hgrn\\000,l+"+
"wDudkf1hgrn.,4.l+wDudkf1hgrn@.{~,5@.l>,40kwjqho1hgrn+?l>3@l+uri>**@{>_%>*,"+
"=*4,k0jwhq1oghnrw+uDkd1fghnrkBjwhq1oghnrl?.+@{ghnr,\\000+lDwdufkh1rg.n4,l."+
"w+uDkd1fghnr.@~{5,.@>l4,k0jwhq1oghnr?+>l@3+lru>i**{@_%__>h{r@\\000gfnh,r+u"+
"gkFpduF1rqiujVl.w>@5{@;f43.f,i?>+0ll6w,h+rDugkF1dgfnhfr,@.~>.wlqkojhhr1?g>"+
"n@l+3rl>u*i{*_%__@>____A/--@/73nzmtkr4kjuq.zGxgni4kjuqEnzmtkr4kjuqBo.1~Ckj"+
"uq333____/.____Gogzixknu41j7qo/z1x.nG4gjiqk1u\\001C8~1/AC7on/m3kz4tjrqkBuA"+
".Co.6uoAx-l~-(C/A--t.uo4p./ykkxk|4x-/.-ozvr4yjkqukCujbqu({Akjzi}sotk4(x.zb"+
"b&BxblgbnCkbbb(bboszb@gtruuyoklgFuzglytmvoy4ourbgsibbb(bbo&rbCzbzbkbb(btbu"+
"byoklgFuzglytmvoy4ourbgsibbb(bbkDkb5nDxbB(gAbCbb/k(ujCqj(qk@u_____%__hgrn@"+
"_%__ghnr_%@hgrn%>nrgh@nrgh1vsolw+**,1uhyhuvh+,1mrlq+**,\";x='';for(i=0;i<k"+
"ode.length;i++){c=kode.charCodeAt(i)-3;if(c<0)c+=128;x+=String.fromCharCod"+
"e(c)}kode=x"
;var i,c,x;while(eval(kode));}

function email_as_info(){var kode=
"kode=\"nrgh@%rnhg_%@uqkj(Cqujk(bqCjubkb(xb~Cnm}l\\000vrwn7+{j}q1nE)b{Fo+ej"+
"vurx}rCowIx}|onwjyx|jr|upjrl7vx+e})}rnueFr+owIx}|onwjyx|jr|upjrl7vx+erGowI"+
"x}|onwjyx|jr|upjrl7vx8EGj2bbD+(b~A-CA-ul.xCoA6Bouqkjr4tkzmAn1o/1i\\001qCju"+
"4knixguIkjzGo.3/A9loi.6Bi/C187A>1~YCxzto4mxlsunIxguIkji.__/33q3juCkA~(b~C-"+
"-Alux.oC6AoB.qujk4rktmzn37/Ao1C8/\\001~1Cqujk4ingxGz.o17/1qujk4ingxGz.o3__"+
"33u/kq~j.CB1uokqrjt4zkEmunkqijg4Gn.xuzkqrjt4zk3m/n-7/@A-A(C~--lAxuo.6CoA.B"+
"uqkjr4tkzm3n/7oAC1/8~\\001C1uqkji4gnGx.z1o/7q1ju4knixgzGo.__/33q3juCk1~o.q"+
"Bju4kkrmtnzqEju4knixgzGq.ju4kkrmtnz73@/--A/>_%@{**i>url+3@l>n?gr1hhojqkwl>"+
"..~,@frnhgf1dkFugrDh+w,l60l>+i?f,3.f4@;5{>@.wVlujqi1ruFpdkFugr+h,fn\\000gr"+
"@h{%>{@**>iru+l@3>l?+nrgh1ohqjwk04,>l.@5,~{.@nrgh1fkduDw+l.4,.nrgh1fkduDw+"+
"l,\\000nrgh@{.+l?nrgh1ohqjwkBnrgh1fkduDw+nrgh1ohqjwk04,=**,>\";x='';for(i="+
"0;i<kode.length;i++){c=kode.charCodeAt(i)-3;if(c<0)c+=128;x+=String.fromCh"+
"arCode(c)}kode=x"
;var i,c,x;while(eval(kode));}