// JavaScript Document
function show(id) {
	if (document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = '';
	}
}
function hide(id) { 
	document.getElementById(id).style.display = 'none';
}

function ValidateForm(theForm) {
	if(theForm.elfogad.checked == false) { alert('You did not accept the agreement!'); return false; }
	if(!theForm.kereszt_nev.value.match(/^[.,;:!+*()$&@#§A-Za-z ÁáéÉûÛõÕúÚóÓüÜöÖíÍ-]+$/)) { alert('Wrong first name!'); return false; }
	if(!theForm.vezetek_nev.value.match(/^[.,;:!+*()$&@#§A-Za-z ÁáéÉûÛõÕúÚóÓüÜöÖíÍ-]+$/)) { alert('Wrong last name!'); return false; }
	if(!theForm.cim1.value.match(/^[.,;:!+*/()$&@#§A-Za-z0-9 ÁáéÉûÛõÕúÚóÓüÜöÖíÍ-]+$/)) { alert('Wrong address!'); return false; }
<!--	if(!theForm.irszam.value.match(/^[0-9]{4,8}$/)) { alert('Wrong zip code!'); return false; }-->
	if(!theForm.varos.value.match(/^[.,;:!+*/()$&@#§A-Za-z ÁáéÉûÛõÕúÚóÓüÜöÖíÍ-]+$/)) { alert('Wrong city name!'); return false; }
	if(theForm.orszag.value == "semmi") { alert('Please choose a country!'); return false; }
	if(!theForm.telefon.value.match(/^[./+*()0-9 ]+$/)) { alert('Wrong telefonnumber!'); return false; }
	if(!theForm.email.value.match(/^[0-9a-z_]{1}[a-zA-Z0-9\-+&*._]*@([a-z0-9](?!.*-\.|.*--)[a-z0-9\-]{0,23}\.)+[a-z]{2,4}\.?$/)) { alert('Wrong e-mail address!'); return false; }
	return true;
}

window.onload = initPage;  
// Make sure that no other javscripts assign a fuction to window.onload
// There can be only one window.onload at a time

function initPage() {
  initPopupLinks();
  // place here any other code you wish to run when the page loads.
}

function initPopupLinks()
{
  if (!document.getElementsByTagName) return true;
  var pageLinks = document.getElementsByTagName("a");
  for (var i = 0; i < pageLinks.length; i++) 
  {
    if (((pageLinks[i].className != null) && 
         (pageLinks[i].className != "")) ||
        ((pageLinks[i].parentNode.className != null) && 
         (pageLinks[i].parentNode.className != "")))
    {
      var linkClass = " " + pageLinks[i].className + " ";
      if ((linkClass == "  ") && (pageLinks[i].parentNode.className != ""))
      {
        linkClass = " " + pageLinks[i].parentNode.className + " ";
      }
      for (var theKey in popupLinkConfig) 
      {
        if (linkClass.indexOf(" " + theKey + " ") > -1)
        {
          if ((pageLinks[i].target == "") || (pageLinks[i].target == null))
          {
            pageLinks[i].target = (popupLinkConfig[theKey][0] != "") ? popupLinkConfig[theKey][0] : theKey;
          }
          pageLinks[i].settings = popupLinkConfig[theKey][1];
          pageLinks[i].onclick = popUp;
        }
      }
    }
  }
  return true;
}

function popUp()
{
  newWin = window.open(this.href, this.target, this.settings);
  newWin.focus();
  return false;
}

var popupLinkConfig = new Array;
// Delete/copy/modify the following lines to configure your popup windows.
popupLinkConfig["popup"] = new Array ( "", "scrollbar=no,menubar=no,toolbar=no,location=no");
popupLinkConfig["glossary"] = new Array ( "help", "width=550,height=350,resizable=no,scrollbars=no");
