var active_player;
jQuery(document).ready(function(){

	//Show the player
	jQuery("div.work_block").mouseover(function(){
		var player = jQuery(this).find("div.player");
		if(!player.length){
			return;
		}
		var h = player.hasClass("video")? 144: 51;		
		player.stop().animate({height:h}, 200);
	});
	
	//Hide the player
	jQuery("div.work_block").mouseout(function(){
		var player = jQuery(this).find("div.player");
		if(!player.length){
			return;
		}else if(player.hasClass("video") && player.attr("id") == active_player){
			return;
		}
		player.stop().animate({height:1}, 200);
	});
});

function onMyPlayerStart(id){
	if(id == active_player){
		return;
	}
	if(active_player){
		thisMovie("player" + active_player).stopMe();
		jQuery("div.player#"+active_player+":not(div.static)").stop().animate({height:1}, 200);;
	}
	active_player = id;
}

//Get flash by ID or name
function thisMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
};
