function register_submit() {
 if(document.getElementById('ok').checked)
 {
 document.getElementById('formularz').submit()
 }else{
        alert('proszę zapoznać się i zaznaczyć oświdczenie');

       }
}


function popup(url,w,h) {
		screenWidth =  w;
		screenHeight = h;
    	dx = 50 ;dy = 50;
       var Win = window.open(url,"displayWindow",'width='+screenWidth+',height='+(screenHeight+5)+',resizable=0,scrollbars=yes,menubar=no,left='+dx+',='+dy );
Win.focus();

}



function zmien(nazwa,plik) {
document.images.foto.src=plik;
document.images.foto.title=nazwa;
//warr(nazwa);
}


function warr(txt) { document.getElementById("opis_img").innerHTML = '&nbsp;&nbsp;<b>'+txt+'</b>'; }



function menu_over(co,plik)
{
var akcja=eval ('document.images.'+co);
akcja.src='gfx/menu/'+plik;
}



function getMouseXY(e) // works on IE6,FF,Moz,Opera7
{
  if (!e) e = window.event; // works on IE, but not NS (we rely on NS passing us the event)

  if (e)
  {
    if (e.pageX || e.pageY)
    { // this doesn't work on IE6!! (works on FF,Moz,Opera7)
      mousex = e.pageX;
      mousey = e.pageY;
     }
    else if (e.clientX || e.clientY)
    { // works on IE6,FF,Moz,Opera7
      mousex = e.clientX + document.body.scrollLeft;
      mousey = e.clientY + document.body.scrollTop;
    }
  }
}





function dymek(e,v){
  if(v.title){
    var t=document.createElement("div");
    t.className="dymek";
    t.innerHTML=v.title;v.title="";
    v.move=function(e){
      e=e||event;
      getMouseXY(e);

      t.style.left=mousex+20+"px";
      t.style.top=mousey+20+"px";
      //t.style.left=e.clientX+20+"px";
      //t.style.top=e.clientY+20+"px";


    }
    v.move(e);
    document.body.appendChild(t);
    v.onmousemove=function(e){v.move(e)}
    v.onmouseout=function(e){
      v.title=t.innerHTML;
      document.body.removeChild(t);
    }
  }
}


















function getHTTPObject() {

  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();

    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}













//pasek ruchomy*************************************************************************************************
var StartAfert=1000; //pauza na starceie
var MarqueeSpeed=2;
var pauseit=1;
var DeltaHeight=38;

var pausespeed=(pauseit==0)? MarqueeSpeed: 0
var ActualPos=''

//---przes
function ScrollMarquee()
{
 PosL=parseInt($('IdMarquee').style.left);

 if (PosL>(ActualPos*(-1)))
 $('IdMarquee').style.left=parseInt($('IdMarquee').style.left)-MarqueeSpeed+"px"
 else
 $('IdMarquee').style.left=parseInt(MarqueeContainerWidth)+5+"px";
}





//--
function InitializeMarquee()
{
MarqueeContainerWidth=$('MarqueeContainer').offsetWidth;
//ustaw na starceie
ScreenW=getWindowWidth();
$('MarqueeContainer').style.width=ScreenW-20+'px';



$('DivClose').style.left=ScreenW-143+'px';

Y=(getScrollXY());
ScreenH=getWindowHeight();
$('MarqueeContainer').style.top=ScreenH-DeltaHeight+parseInt(Y)+"px";//odleglosc paska od gory
//---


$('IdMarquee').style.left=MarqueeContainerWidth+25+'px';
$('IdMarquee').show();



MarqueeWidth=$('IdMarquee').offsetWidth;
ActualPos=$('IdMarquee').offsetWidth;
 if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1)
 {
 $('IdMarquee').style.width=MarqueeWidth+"px"
 $('IdMarquee').style.overflow="scroll"
  return
 }


//przewijaj pasek
Event.observe(window, 'scroll', function() { ScrollCheck(); })

//start
setTimeout('lefttime=setInterval("ScrollMarquee()",30)', StartAfert)
}









//---zamknij
function CloseMarquee()
{
$('MarqueeContainer').hide();
 new Ajax.Request('/inc/ajax_marquee.php', {
 parameters: { act: 'close'  },
 onComplete: function(transport){ }
 } );

}







//---
function ScrollCheck(){
Y=(getScrollXY());
ScreenH=getWindowHeight();

$('MarqueeContainer').style.top=ScreenH-DeltaHeight+parseInt(Y)+"px";
}




function getWindowHeight()
{
var windowHeight=0;
 if (typeof(window.innerHeight)=='number')
 {
 windowHeight=window.innerHeight;
 }else {
       if (document.documentElement&& document.documentElement.clientHeight)
	   {
	   windowHeight=document.documentElement.clientHeight;
	   }else {
             if (document.body&&document.body.clientHeight) { windowHeight=document.body.clientHeight; }
             }
  }
return windowHeight;
}






function getWindowWidth()
{
var windowWidth=0;
 if (typeof(window.innerWidth)=='number')
 {
 windowWidth=window.innerWidth;
 }else {
       if (document.documentElement&& document.documentElement.clientWidth)
	   {
	   windowWidth=document.documentElement.clientWidth;
	   }else {
             if (document.body&&document.body.clientWidth) { windowHeight=document.body.clientWidth; }
             }
  }
return windowWidth;
}




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 ];
  return scrOfY;

}

















function getWindowHeight()
{
var windowHeight=0;
 if (typeof(window.innerHeight)=='number')
 {
 windowHeight=window.innerHeight;
 }else {
       if (document.documentElement&& document.documentElement.clientHeight)
	   {
	   windowHeight=document.documentElement.clientHeight;
	   }else {
             if (document.body&&document.body.clientHeight) { windowHeight=document.body.clientHeight; }
             }
  }
return windowHeight;

}


//tylko do galerii
//--------------------------
function SetHeight()
{
var H=0;

H=getWindowHeight();
$('#flashcontent').height(H-1);
}

