function findElements () {
//alert('findElements');
	showAvatarLink = document.getElementById( 'showAvatar');
	avatarElement = document.getElementById( 'avatarDiv' );
}
function setNormal () {
//alert('setNormal');
	// Add Mouseover/Mouseout effect
	showAvatarLink.onmouseover = new Function ( "this.firstChild.src='/images/avatar/showAvatar-over.gif'; this.style.backgroundColor='#2893FF';" );
	showAvatarLink.onmouseout = new Function ( "this.firstChild.src='/images/avatar/showAvatar.gif'; this.style.backgroundColor='transparent';" );
	showAvatarLink.onclick = new Function ( "invokeAvatar(); return false;" );
	showAvatarLink.style.backgroundColor = 'transparent';
	showAvatarLink.firstChild.src='/images/avatar/showAvatar.gif';
}function setActive () {
	// Add Mouseover/Mouseout effect
	showAvatarLink.onmouseover = new Function ( "this.firstChild.src='/images/avatar/showAvatar-active.gif';" );
	showAvatarLink.onmouseout = new Function ( "this.firstChild.src='/images/avatar/showAvatar-active.gif';" );
	showAvatarLink.onclick = new Function ( "return false;" );
	showAvatarLink.style.backgroundColor = '#93C9FF';
	showAvatarLink.firstChild.src='/images/avatar/showAvatar-active.gif';
	showAvatarLink.blur();
}
function setAvatar () {
	avatar = flashembed( avatarElement, {
			src:'/flash/avatar.swf',
			width:895,  
			height:595,
			bgcolor:'#ffffff',
			wmode: 'transparent',
			id: 'avatarSWF',
			version: [9,45]
	});
}
function invokeAvatar () {
//alert( 'invokeAvatar.' );
	if ( $('demoReel')) resetDemoReel();
	setActive();
	avatarElement.style.zIndex='100';
	avatar.TGotoLabel( '/', 'showAvatar' );
	avatar.Play();
}
function hideAvatar () {
//alert( 'hideAvatar.' );
	//avatar.TGotoLabel( '/', 'readyState' );
	//avatar.Stop();
	avatarElement.style.zIndex='-1';
	setNormal();
}
var showAvatarLink;
var avatarElement;
var avatar;
window.addEvent('load', function(){
	findElements();
	setNormal();
	setAvatar();
});