function trimAll(pstr_Input)
{
  var ls_RetValue= "";
  var li_len = pstr_Input.length;
  if (li_len > 0)
  {
    for(var i = 0; i < li_len; i++)
    {
      if (pstr_Input.charAt(i) != " ")
      ls_RetValue += pstr_Input.charAt(i);
    }
  }
  return ls_RetValue;
}

function change(co, tekst) {
  document.all[co].innerHTML = tekst;
}

function change2(co, tekst) {
  zdjecieHTML = '<img src="'+tekst+'" alt="" />';
  document.getElementById(co).innerHTML = zdjecieHTML;
}


function winopen(url,x,y) {
  var options = "toolbar=no,menubar=no,scrollbars=no,resizable=no,width=" + x + ",height=" + y;
//  if (msgWindow != "mutex") {
//    msgWindow.close();
//  }
  msgWindow=window.open(url,"WinOpen",options);
  msgWindow.focus();
}

function winopen2(url,x,y) {
  var options = "toolbar=no,menubar=no,scrollbars=yes,resizable=no,width=" + x + ",height=" + y;
//  if (msgWindow != "mutex") {
//    msgWindow.close();
//  }
  msgWindow=window.open(url,"WinOpen",options);
  msgWindow.focus();
}

function writeFlash(nazwa,x,y,kolor) {

  t = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ';
  t = t + 'width="';
  t = t + x;
  t = t + '" height="';
  t = t + y;
  t = t + '" align="middle">\n';
  
  t = t + '<param name="allowScriptAccess" value="sameDomain" />\n';
  t = t + '<param name="movie" value="' + nazwa + '" />\n';
  t = t + '<param name="quality" value="high" />\n';

  if (kolor) {
    t = t + '<param name="bgcolor" value="' + kolor + '" />\n';
  } else {
    t = t + '<param name="wmode" value="transparent" />\n';  
  }

  t = t + '<embed src="' + nazwa + '" quality="high" width="';
  t = t + x +'" height="' + y + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"';
  
  if (kolor) {
    t = t + ' bgcolor="' + kolor + '"';
  } else {
    t = t + ' wmode="transparent"';
  }  
  
  t = t + '/>\n';
  
  t = t + '</object>';
    
  document.write (t);

}
