
// Czy pole jest niepuste
function niepuste(x){return x>''}

function liczba(x)
{
var re = /^[0-9]*$/;
/**popr rybasso 2005-06-24
if (!re.test(str)) return false
*/
if (!re.test(x)) return false
else return true;
}


// Czy pole jest emailem
function ismail(e){return /^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e)}

function mail2(e){
if (e>'') return /^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e)
else
return true;
}


// Czy dobrze wpisana data

function dobradata(d){
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
function isDate (day,month,year) {
// checks if date passed is valid
// will accept dates in following format:
// isDate(dd,mm,ccyy), or
// isDate(dd,mm) - which defaults to the current year, or
// isDate(dd) - which defaults to the current month and year.
// Note, if passed the month must be between 1 and 12, and the
// year in ccyy format.

    var today = new Date();
    year = ((!year) ? y2k(today.getYear()):year);
    month = ((!month) ? today.getMonth():month-1);
    if (!day) return false
    var test = new Date(year,month,day);
    if ( (y2k(test.getYear()) == year) &&
         (month == test.getMonth()) &&
         (day == test.getDate()) )
        return true;
    else
        return false
}


var dat = d.split("-");
return isDate(dat[2],dat[1],dat[0]);}

function validate(F,v,a,x,b,l,t,q){
 q='Blednie wypelnione pole, w ktorym aktualnie znajduje sie kursor'
 for(a=0;x=F[a++];)
 for(l=0;(t=x[b='getAttribute']('valid'))&&(t=t.split('|')[l]);l++)
  if((v=eval(t))&&!v(x.value))
  {
  x.className = 'bladform';
   return!x.focus(alert((t=x[b]('alert'))?(t=t.split('|')[l])?t:q:q))
   }
   else   x.className = '';
}