var topimages = new Array(2);
var links = new Array(2);

topimages[0] = new Image();
topimages[0].src = "images/top_20yr.jpg";
topimages[1] = new Image();
topimages[1].src = "images/topimage.jpg";
//topimages[0] = new Image();
//topimages[0].src = "images/top_sd2010.jpg";
//topimages[0] = new Image();
//topimages[0].src = "images/top_iyalogo.png";
//topimages[1] = new Image();
//topimages[1].src = "images/top_sd09.png";

links[0] = "http://www.nhao.jp/nhao/researches/symposium/nhao20yr.html";
links[1] = "http://www.nhao.jp/event/kanbokai_index.html";
//links[0] = "http://www.nhao.jp/event/event_aug.html#sd";
//links[0] = "http://www.astronomy2009.jp/";
//links[1] = "http://www.nhao.jp/event/event_aug.html#sd";

count = 0;

function changeImg(){
  count = count % 2;
  document.getElementById("imtop").src = topimages[count].src;
  document.getElementById("toplink").href = links[count];
  count = count + 1;

  setTimeout("changeImg()",5120);
}

function Blink(){
  if ( !document.all ){ return; }
  for ( i = 0; i < document.all.length; i++ ){
    obj = document.all(i);
    if ( obj.className == "blink2" ){
      if ( obj.style.visibility == "visible" ) {
        obj.style.visibility = "hidden";
      } else{
        obj.style.visibility = "visible";
      }
    }
  }
  setTimeout( "Blink()", 800 );
}

function portfolio(){
  $(document).ready(
    function(){
      $('#imtop').innerfade({
        speed: 4096,
        timeout: 8192,
        type: 'sequence',
        containerheight: '300px'
      });
    }
  );
}

