function popup_image(url,width,height,title,webroot_relative)
{
  popuwindow=window.open('','','resizable=1,width='+width+',height='+height+'');
  popuwindow.document.write("<html>");
  popuwindow.document.write("<head>");
  popuwindow.document.write("<title>"+title+"</title>");
  popuwindow.document.write("<link href=\""+webroot_relative+"/css/photo_popup_page.css\" type=\"text/css\" rel=\"stylesheet\" />");
  popuwindow.document.write("</head>");
  popuwindow.document.write("<body>");
  popuwindow.document.write("<a title='Close photo' href='javascript: self.close()'><img style='border:none' src='"+url+"'></a><br />");
  popuwindow.document.write("</body>");
  popuwindow.document.write("</html>");
  popuwindow.document.close();
}
function popup_comp_details(id,webroot_relative)
{
  popuwindow=window.open(''+webroot_relative+'/index.php?page_name=comp_details&id='+id+'','','resizable=0,width=400,height=600');
  popuwindow.document.close();
}
//Kontrola správnosti emailové adresy

function check_and_submit_email_form(lang)
{

 //Testování správnosti emailové adresy

 var s = document.email_form.email.value;
 var a = false;
 var res = false;
 if(typeof(RegExp) == 'function')
 {
  var b = new RegExp('abc');
  if(b.test('abc') == true){a = true;}
  }

 if(a == true)
 {
  reg = new RegExp('^([a-zA-Z0-9\\-\\.\\_]+)'+
                   '(\\@)([a-zA-Z0-9\\-\\.]+)'+
                   '(\\.)([a-zA-Z]{2,4})$');
  res = (reg.test(s));
 }
 else
 {
  res = (s.search('@') >= 1 &&
         s.lastIndexOf('.') > s.search('@') &&
         s.lastIndexOf('.') >= s.length-5)
 }


 //Pokud je tvar adresy správně, odešle se formulář ke zpracování

 if (res==true)
 {
  document.email_form.submit();
  if (lang == "cz") {
		document.email_form.send_button.value = 'Odesílá se...';
	}
	if (lang == "en") {
		document.email_form.send_button.value = 'Submitting...';
	}
  document.email_form.send_button.disabled = true;
 }
 else
 {
	if (lang == "cz") {
		window.alert('Neplatná emailová adresa');
	}
	if (lang == "en") {
		window.alert('Invalid email address');
	}
 }
}
function HideInfoMessage()
{
  document.getElementById("info_message").style.visibility = "hidden";
}
//-->