addLoadEvent(init);

function init() {
	var blinkTimer;
  	var squares     = $('nav').getElementsByTagName('a');
  	var destination = $('destination');
  	var allblinker  = Animator.apply(squares, "lightBox");
  	var blinkers    = {
    	square01: Animator.apply($('square01'), "lightBox"),
    	square02: Animator.apply($('square02'), "lightBox"),
    	square03: Animator.apply($('square03'), "lightBox"),
    	square04: Animator.apply($('square04'), "lightBox"),
    	square05: Animator.apply($('square05'), "lightBox"),
    	square06: Animator.apply($('square06'), "lightBox"),
    	square07: Animator.apply($('square07'), "lightBox"),
    	square08: Animator.apply($('square08'), "lightBox"),
    	square09: Animator.apply($('square09'), "lightBox"),
		square10: Animator.apply($('square10'), "lightBox")
  	}
  
  	for (var i=0; i<squares.length; i++) {
    	squares[i].onmouseover = function() {
    		blinkers[this.id].play();
      		destination.src = "/img/layout/" + this.id + "dest.gif";
    	}
    	squares[i].onmouseout = function() {
      		destination.src = "/img/layout/square00dest.gif";
      		blinkers[this.id].reverse();
    	}
  	}

  	blinkTimer = setInterval(function() {
    	allblinker.play();
    	setTimeout(function() { allblinker.reverse(); }, 1000);
  	}, 4000);

  	if ($('videoplayer'))
	{
		loadvideo("http://www.youtube.com/cp/vjVQa1PpcFNkTedJOFhaKPG_HwYhTy8v7ighH5gVgJ4=", 500, 430, "contenttxt");
	}

}
 
