var tryNumber = 1;
var tableObj = new Object();
var playerObj = new Object();
playerObj.obj = null;


function PlayerVInit(sid, perms)
{ for (var i=0; i < perms.length; i++)
  {   if (!perms[i])
    {     return false;    }
  }
 if (tryNumber > 5)
  {   return false;
  }
 if (top.window.frames['PLAYER'].player != null && top.window.frames['PLAYER'].player.loaded)
  {   var hid = top.window.frames['PLAYER'].player.status;
   playerObj.obj = document.getElementById('Player');
   playerObj.obj.innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" width="225" height="100" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+langPath+'_gfx/player_v.swf?sid='+sid+'&hid='+hid+'" /><param name="quality" value="best" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="bgcolor" value="#070707" /><param name="wmode" value="transparent" /><embed src="'+langPath+'_gfx/player_v.swf?sid='+sid+'&hid='+hid+'" wmode="transparent" quality="best" loop="false" menu="false" bgcolor="#070707" width="225" height="100" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>';
   playerObj.top = 45;
   playerObj.speed = 2000;
   playerObj.moving = false;
   playerObj.to = false;
   playerObj.from = false;
   playerObj.time = false;
   tableObj = document.getElementById('Table');
   playerObj.obj.style.top = top.window.frames['PLAYER'].player.top + 'px';
   PlayerRelease();
  }
 else
  {   tryNumber++;
   setTimeout("PlayerVInit('"+sid+"', Array("+perms+"))", 1000);
  }
}


function PlayerSetPos()
{
 if (!playerObj.moving)
  {
   return false;
  }
 var now, s, t, newY;
 now = new Date();
 t = now.getTime() - playerObj.time;
 if (t < playerObj.speed)
  {
   setTimeout("PlayerSetPos()", 15);
   s = Math.sin((Math.PI / (2 * playerObj.speed) * t));
   newY = Math.round((playerObj.to - playerObj.from) * s + playerObj.from);
   top.window.frames['PLAYER'].player.top = newY;
   playerObj.obj.style.top = newY + 'px';
  }
 else
  {
   playerObj.moving = false;
  }
}


function PlayerRelease()
{ if (!playerObj.obj)
  {   return false;
  }
 playerObj.from = top.window.frames['PLAYER'].player.top;
 playerObj.to = document.body.scrollTop + playerObj.top;
 var d = new Date();
 playerObj.time = d.getTime();
 if (!playerObj.moving)
  {   playerObj.moving = true;
   PlayerSetPos();
  }
}


function PlayerSetStatus(status)
{
 top.window.frames['PLAYER'].player.status = status;
}


function PlayerHide()
{
 if (playerObj.obj)
  {
   if (ie)
    {
     playerObj.obj.style.zIndex = -1;
    }
   else
    {
     playerObj.obj.style.zIndex = 0;
    }
  }
 if (tableObj)
  {   tableObj.style.zIndex = 1;
  }
}


function PlayerShow()
{
 if (tableObj)
  {   if (ie)
    {
     tableObj.style.zIndex = -1;
    }
   else
    {     tableObj.style.zIndex = 0;
    }
  }
 if (playerObj.obj)
  {
   playerObj.obj.style.zIndex = 1;
  }
}