/*function $(id) {
     return document.getElementById(id);
}*/

function showDiv(id)	{
	
	if(id != '')	{
		
		var d = "div_"+id;
	
		var current = (document.getElementById(d).style.display == 'none') ? 'block' : 'none';		
		document.getElementById(d).style.display = current;
	}
	return true;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function openWindow(str,features){
        window.name='windowOpener';
        window.open(str,'newWindow',features);
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=1,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function popUpWindowNS(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=0,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function CheckResForm()	{
	
	if($("res_name").value == '')	{
		
		alert('Prosimy podać imię i nazwisko.');
		$("res_name").focus();
		return false;
	}
	
	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;
	
	if (!emailRegExp.test($("res_email").value))	{
		
		alert("Prosimy podać prawidłowy adres email.");
		$("res_email").focus();
		return false;
	}
	
	if($("res_event").value == '0')	{
		
		alert('Prosimy wybrać wydarzenie.');
		$("res_event").focus();
		return false;
	}
	
	if($("res_ticket").value == '')	{
		
		alert('Prosimy podać ilość rezerwowanych biletów.');
		$("res_ticket").focus();
		return false;
	}
	
	
	return true;
}
