
function updatePlayerStyle() {

	var player = grabElement( "playerControls" );
	if( player ) {
		if( parent.frames.length ) {
			addClass( grabEleByNameAndClass( "li", "start", player )[0], "active" );
		} else {
			addClass( grabEleByNameAndClass( "li", "stop", player )[0],  "active" );
		}
	}
}

function emailMike() {
	username = "mmerkur";
	domain = "gmail.com";
	location.href = "mailto:" + username + "@" + domain;
}

function emailClaire() {
	username = "claire.merkur";
	domain = "gmail.com";
	location.href = "mailto:" + username + "@" + domain;
}

var currentVideoEle = null;
function initVideos() { 
	var brightCoveSwf = "http://www.brightcove.com/playerswf?allowFullScreen=true&brightcove.com&autoStart=true&servicesURL=http://www.brightcove.com&viewerSecureGatewayURL=https://www.brightcove.com&cdnURL=http://admin.brightcove.com&initVideoId=";

	var videoListEle = grabElement("videoSwitcher");
	var videoContainerEle = grabElement("videoContainer");
	if( videoListEle && videoContainerEle ) {
		var videoEles = videoListEle.getElementsByTagName("a");
		for( var i = 0; i < videoEles.length; i++ ) {
			videoEles[i].href = "javascript:void(0);";
			videoEles[i].onclick = function() {
				var movieSwitcher = new ObjectRewrite( brightCoveSwf + this.rel, 486, 412 );
				movieSwitcher.prepForFlash( {'base':'admin.brightcove.com'} );
				videoContainerEle.innerHTML = movieSwitcher.getHTML();
				if( currentVideoEle ) {
					removeClass( currentVideoEle, "selected" );
				}
				addClass( this, "selected" );
				currentVideoEle = this;
				this.blur();
			};
		}
	}
}

windowObject.addLoadFunction( updatePlayerStyle, initVideos );
