var e = document;
var mX=0;
var mY=0;

document.onmousemove=function(e) 
{
    
    e=e||event;
    
    mX=document.body.scrollLeft+e.clientX;
    
    mY=document.body.scrollTop+e.clientY; 
}

function getScrollXY() 
{
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) 
  {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } 
  else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
  {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } 
  else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
  {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}


function show_help( cols, help_text )
{

   var scrollxy;
   var x; 
   var y;

  if ( navigator.appName == 'Opera')
  {
    x = mX;
    y = mY;
  }
  else if ( navigator.appName == 'Konqueror' ) 
  {
    x = mX;
    y = mY;
  }
  else
  {
    scrollxy = getScrollXY();
    x = scrollxy[0]+mX;
    y = scrollxy[1]+mY;
  }



 if (document.getElementById)
 {
    // this is the way the standards work
    var help_box = document.getElementById('help');
  
    help_box.innerHTML   = help_text;
    help_box.style.left = x+'px';
    help_box.style.top  = y+'px';
    help_box.style.display = "";
  }
  else
  {
    alert(help_text);
  }
  
}


function hide_on_start()
{
  if (document.getElementById)
  {
    // this is the way the standards work
    var style2 = document.getElementById('help').style;
    style2.display = "none";
  }
  else if (document.all)
  {
   // this is the way old msie versions work
    var style2 = document.all['help'].style;
    style2.display = "none";
  }
  else if (document.layers)
  {
    // this is the way nn4 works
    var style2 = document.layers['help'].style;
    style2.display = "none";
  }
}
function blank()
{
  var a;
  a = 1;
}

function hide_help()
{
  if (document.getElementById)
  {
    // this is the way the standards work
    var style2 = document.getElementById('help').style;
    style2.display = "none";
  }
  else if (document.all)
  {
   // this is the way old msie versions work
    var style2 = document.all['help'].style;
    style2.display = "none";
  }
  else if (document.layers)
  {
    // this is the way nn4 works
    var style2 = document.layers['help'].style;
    style2.display = "none";
  }
}

function checkcheckbox()
{
  if ( document.regulamin.elements[1].checked != true )
    alert( 'Musisz zaakceptowaĉ regulamin.' );

  return document.regulamin.elements[1].checked;
}


function switchform( form_type )
{
  el_person = document.getElementById('person');
  el_firm   = document.getElementById('firm');
  

  if ( form_type == 'person')
  {   
    el_person.style.display = '';
    el_firm.style.display   = 'none';
  }

  if ( form_type == 'firm')
  {   
    el_person.style.display = 'none';
    el_firm.style.display   = '';
  }
}


function NewWindow(mypage, myname, w, h) 
{
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+', width='+w+', top='+wint+', left='+winl;
  win = window.open(mypage, myname, winprops);
}

function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}



