//
//  Main functions
//  LightStorage - Simple MP3 search engine
//  (P) 2010
//  Pou Le Serg
//

function PlayerCode (InTrURL) {
  return GetPlayerCode (InTrURL, '', 5);
}

function HideOrShow (Obj2Do, TActType) {
  $ (Obj2Do).style.opacity = 1;
  $ (Obj2Do).style.display = TActType;
}

// ---

function AddThisTrackToUserStatistic (TThisObject) {
  // playmp3.org.ua stat
}

function PlayTrack (TrURL, TCNum) {
  $ ('PlayerRightHere' + TCNum).innerHTML = PlayerCode (TrURL);
  HideOrShow ('TPlayerContainer' + TCNum, 'block');
}

function ShowPlayerCode (TrURL, TCNum) {
  $ ('htmlcode' + TCNum).value = PlayerCode (TrURL);
  HideOrShow ('codeSource' + TCNum, 'block');
}

function HideInput (WhatHide) {
  FadeAndHideBlock (WhatHide);
}

// ---

function PutFocusIntoForm () {
  if ($ ('getmp3') == null) return 0;
  $ ('getmp3').focus ();
}

// --- Languages ---

var LanguagesContainerID = "LanguagesContainer";

function HideLangBox () {
  FadeAndHideBlock (LanguagesContainerID);
}

function ShowLanguageForm (InObject) {
  $ (LanguagesContainerID).style.display = 'block';
  $ (LanguagesContainerID).style.opacity = 1;
  $ (LanguagesContainerID).style.top = (GetThisObject (InObject).clientHeight + getXYOffset (GetThisObject (InObject)) ['y'] + 3) + 'px';
  $ (LanguagesContainerID).style.right = '10px';
}

function ReloadThisPage () {
  window.location.reload (true);
}

function ChangeUserLang (NewLang) {
  TransferAJAXData ('language.change.php?l=' + trim (NewLang), 'ReloadThisPage');
}

//
//  DByte64
//
