function popup(url, nr, width, height) 
{
        var Win = window.open(url, nr,'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no,menubar=no,left=50,top=100' );
}
function lookAfter(element)
{
	element.className="active";
}
function standBy(element)
{
	element.className="";
}

function obsluga_warstw()
 {
  if (document.layers) return true;
  if (document.all) return false;
  if (document.getElementById) return true;
  return true;
 }

function get_elem(co)
 {
  if (!obsluga_warstw()) return document.all[co];
  else return document.getElementById(co);
 }


function set_pic(gdzie, patch, patchbig ,x, y)
 {
  get_elem(gdzie).src = patch;
	get_elem(gdzie).style.cursor="pointer"
	 get_elem("pop").href = "javascript:popup(\"/popup/pop.php?url="+patchbig+"\", 1,"+x+","+y+")"
	//get_elem(gdzie).setAttribute("onclick","popup(\"/popup/pop.php?url="+patchbig+"\", 1,"+x+","+y+")")
 }
 
function set_txt(gdzie, text)
 {
  get_elem(gdzie).innerHTML = text;
 }
 
function chColor(element)
{
	ahref = get_elem('newsLinki').getElementsByTagName("a");
	for (var i = 0; i < ahref.length; i++)
	{ 

     ahref[i].className=""; 
	}
	element.className="active"; 
	
}
function sendRezervation(elm){
getPageSize();


 advAJAX.submit
 (
	document.getElementById(elm), 
	{
		
		onInitialization : function(obj)
		{
			document.getElementById("preloader").style.display="block";
			document.getElementById("preloader").style.width=arrayPageSize[0]+'px'
			document.getElementById("preloader").style.height=arrayPageSize[1]+'px';
			document.getElementById("preloader").innerHTML='<img style="top:50%; left:50%; position:absolute;background-color:#000000;"  src="/images/ajax-loader.gif" />';
		},
		onComplete : function()
		{

		},

		onSuccess : function(obj) 
		{ 
			document.getElementById("preloader").style.display = "none";
			// jesli ni bedzie zadnego alertu czyli wszystk Ìdz?okej
			//alert(obj.responseText);
			document.getElementById("captchaImgRezerv").src='/captchaDisplay.php?data='+Math.round(1000*Math.random());
			//obj.disableForm=false;
			var word=obj.responseText.split("|")
			if(word[1]==1)
			{
				alert(word[0]);
				obj.disableForm=false;
			}
			else
			{
				alert(obj.responseText)
			}

		}
		
	}
 );
}
