function ChClass(divid,newclass)
{
 theobj= eval ('document.getElementById("'+divid+'")');
 theobj.className= newclass;
}







//Transery-----------------------------------------------------

function ShowTransfer(divid)
{
 theobjP= eval ('document.getElementById("personsT'+divid+'")');
 theobjC= eval ('document.getElementById("Cena'+divid+'")');
 theobjCh= eval ('document.getElementById("T'+divid+'")');
 theobj= eval ('document.getElementById("DivT'+divid+'")');

 if(theobjCh.checked==true)
 {
 theobj.style.display='block';
 }

 if(theobjCh.checked==false)
 {
 theobj.style.display='none';
 theobjC.innerHTML='';
 theobjP.value=0;
 }

}





function ValidateTransfer(max)
{

err=99; any=0;
for(i=1;i<=max;i++)
{
 theobjCh= eval ('document.getElementById("T'+i+'")');

 if(theobjCh.checked==true)
 {
 any=1;
 theobj_day= eval ('document.getElementById("dayT'+i+'")');
 theobj_month= eval ('document.getElementById("monthT'+i+'")');
 theobj_year= eval ('document.getElementById("yearT'+i+'")');
 theobj_hour= eval ('document.getElementById("hourT'+i+'")');
 theobj_minutes= eval ('document.getElementById("minutesT'+i+'")');
 theobj_persons= eval ('document.getElementById("personsT'+i+'")');
 //theobj_vehicle= eval ('document.getElementById("vehicleT'+i+'")');
 if(theobj_hour.value==100 || theobj_minutes.value==100 || theobj_persons.value==0 ) { err=0; }
 }
}

 if(err==99 && any==1)
 {
 document.getElementById('formularz').submit()
 }else{
       alert('fill the form')
       }

}










function setCena(id,ilosc)
{
 theobjC= eval ('document.getElementById("Cena'+id+'")');
 if(Cena[id+ilosc]>0)
 {
 theobjC.innerHTML='<b>'+Cena[id+ilosc]+' zł</b>';
 }else{
      theobjC.innerHTML='';
      }
}
//-----------------------------------------------------------------















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 order_submit(msg) {
err=99;


 if(document.getElementById('OImie').value=='') { err=1; }
 if(document.getElementById('ONazwisko').value=='') { err=1; }
 if(document.getElementById('OEmail').value=='') { err=1; }
 if(document.getElementById('OIlosc').value=='') { err=1; }


 if(err==99)
 {
 document.getElementById('formularz').submit()
 }else{
        alert(msg);

       }
}

//--------------------------------------------------------------












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;
}









var http = getHTTPObject(); // We create the HTTP Object








