/*
  GetCode module
  DByte64
  (P) Pou Le Serg, 2009 - 2010
  http://pouleserg.com/, http://playmp3.org.ua
*/

function GPD (PlayerNum) {
  if (PlayerNum == 1) {
    return { "n" : "rafrimini", "w" : 300, "h" : 65};
  } else if (PlayerNum == 2) {
    return { "n" : "rafrisimpleblue", "w" : 250, "h" : 40};
  } else if (PlayerNum == 3) {
    return { "n" : "rafrisimpledirty", "w" : 250, "h" : 40};
  } else if (PlayerNum == 4) {
    return { "n" : "rafrisimplegreen", "w" : 250, "h" : 40};
  } else if (PlayerNum == 5) {
    return { "n" : "rafrisimplelightblue", "w" : 250, "h" : 40};
  } else if (PlayerNum == 6) {
    return { "n" : "rafrisimplelightgreen", "w" : 250, "h" : 40};
  } else if (PlayerNum == 7) {
    return { "n" : "rafrisimplered", "w" : 250, "h" : 40};
  } else if (PlayerNum == 8) {
    return { "n" : "rafrisimple", "w" : 250, "h" : 40};
  } else if (PlayerNum == 9) {
    return { "n" : "rafrisimplewhite", "w" : 250, "h" : 40};
  } else if (PlayerNum == 10) {
    return { "n" : "rafrisimpleblack", "w" : 250, "h" : 40};
  }
}

function GetPlayerCode (mp3URL, mp3Title, PN) {
  var URLStart = '<object width="' + GPD(PN)['w'] + '" height="' + GPD(PN)['h'] + '" align="middle"><param name="movie" value="http://playmp3.org.ua/playmp3/' + GPD(PN)['n'] + '.swf" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><param name="quality" value="best" /><param name="flashvars" value="';
  var URLMiddle = '"><embed src="http://playmp3.org.ua/playmp3/' + GPD(PN)['n'] + '.swf" width="' + GPD(PN)['w'] + '" height="' + GPD(PN)['h'] + '" menu="false" quality="best" align="middle" type="application/x-shockwave-flash" allowscriptaccess="always" flashvars="';
  var URLFinish = '" wmode="transparent"></embed></object>';
  
  var paramSets = 'filename=' + encodeURIComponent (trim (mp3URL)) + '&tracktitle=' + encodeURIComponent (trim (mp3Title));
  return URLStart + paramSets + URLMiddle + paramSets + URLFinish;
}

//
//  DByte64
//
