function zamknij(){
document.getElementById('toplayer').style.display='none';
}

function redirect(url)
{
  document.location.href=url;
}

function back()
{
  history.go(-1);
}

function ulubione()
{
  var title = 'Lecce Pen Polska';
  var url = 'http://www.leccepen.com.pl';

    if (window.sidebar) window.sidebar.addPanel(title, url,"");

    else if( window.opera && window.print )
    {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();
    }

    else if( document.all ) window.external.AddFavorite( url, title);
} 


function polec()
{
  window.open('?page=polec','','width=368px, height=210px');
}

function isInt (str)
{
  var i = parseInt (str);

  if (isNaN (i))
    return false;

  i = i . toString ();
  if (i != str)
    return false;

  return true;
}

// ============================================
// make currency format
// ============================================
function FormatCurrency ( fPrice )
{
   // convert to string, and round up 2 dp
   var sCurrency = "" + ( fPrice + 0.00500000001 );

   // find .
   var nPos = sCurrency.indexOf ( '.' );

   if ( nPos < 0 )
   {
      sCurrency += '.00';
   }
   else
   {
      // hack off 3rd dp
      sCurrency = sCurrency.slice ( 0, nPos + 3 );

      // add up to 2 trailing zeroes if necessary
      var nZero = 3 - ( sCurrency.length - nPos );

      for ( var i=0; i<nZero; i++ )
         sCurrency += '0';
   }

   return sCurrency;
} 