// JavaScript Document

function playerInitMove(id,wrapperId,filename)
{
	if($.browser.msie)
	{
		$(window).scroll(function(){ movePlayer(id,wrapperId)});
	}
	else
	{
		$(document).scroll(function(){ movePlayer(id,wrapperId)});
	}
}

function movePlayer(id,wrapperId)
{
	if($("#"+wrapperId).position().top + 30 <= $(document).scrollTop() )
	{
		if($(document).scrollTop() > $("#player-bottom-stop").position().top - 350)
		{
			$("#"+id).stop();
			$("#"+id).animate({"top":($("#player-bottom-stop").position().top - 350)+"px"}, "slow");
		}
		else
		{
			$("#"+id).stop();
			$("#"+id).animate({"top":$(this).scrollTop()+"px"}, "slow");
		}
	}
	else
	{
		$("#"+id).stop();
		$("#"+id).animate({"top":($("#"+wrapperId).position().top + 30)+"px"}, "slow");	
	}
}

function fixHeight(divId)
{
	var divCollect = $("#"+divId+" div");
	var headerCollect = $("#"+divId+" h3");
	
	jQuery.each(divCollect, function(){
	//$(this).css({'height':'auto','padding':'10px 50px 10px 75px','margin-bottom':'20px'});
	$(this).css({'height':'auto','margin-bottom':'20px'});
	}
	);
	
	jQuery.each(headerCollect, function(){
	$(this).bind('click',function(){ $(this).blur(); });
	}
	);
}
