version = navigator.appVersion.toLowerCase();
agent = navigator.userAgent.toLowerCase();
ie = (version.indexOf('msie')>-1);
win = (version.indexOf('windows')>-1);
opera = (agent.indexOf('opera')>-1);

function fav() {
if (!opera) document.write('\074a class="fav" href=\"javascript:CreateBookmarkLink();\"\076Přidat k oblíbeným\074/a\076 |');
}
function gofav() {
window.external.addFavorite('http://www.postovni-schranky.eu/','Poštovní schránky EU');
}
function CreateBookmarkLink() {
	title = "Poštovní schránky EU";
	url = "http://www.postovni-schranky.eu/";

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	}
	else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title);
	}
	else if(window.opera && window.print) { // Opera Hotlist
		return alert('Pro tento prohlížeč je potřeba změnit nastavení manuálně!');
	}
}

function getObj(name)
{
  if (document.getElementById)
    {this.obj = document.getElementById(name);
    this.style = document.getElementById(name).style;}
  else if (document.all)
    {this.obj = document.all[name];
    this.style = document.all[name].style;}
  else if (document.layers)
    {this.obj = document.layers[name];
    this.style = document.layers[name];}
}

function hidestyle(whichid)
{
  mainobject = new getObj(whichid);
  if (mainobject.style.display=='none')
    {mainobject.style.display='';}
  else
    {mainobject.style.display='none';}
}
function hidestyleON(whichid)
{
  mainobject = new getObj(whichid);
  mainobject.style.display='none';
}

function hidestyleOFF(whichid)
{
  mainobject = new getObj(whichid);
  mainobject.style.display='';
}
function DomWriteIn(whichid,str) {
  mainobject = new getObj(whichid);
  mainobject.obj.innerHTML = str;
}
function WindowOpen(uri,w,h) {
  window.open(uri,'','width='+w+',height='+h+',status=yes,resizable=yes,scrollbars=no');
}
function FotoOpen(uri,w,h) {
  window.open(uri,'','width='+(w+20)+',height='+(h+20)+',left='+(screen.width/2-w/2-10)+',top='+(screen.height/2-h/2-10)+',status=yes,resizable=yes,scrollbars=no');
}
function GetName(p) {
  var pole = p.split('\\');
  var file = pole[pole.length-1];
  var pole = file.split('.');
  if(pole.length>=2) return pole[pole.length-2];
  if(pole.length>=1) return pole[pole.length-1];
}

function CheckClubForm(f) {
  with(f) {
    if(login.value=='') {
      alert('Vyplňte prosím přihlašovací jméno tzv. login');
      login.focus();
      return false;
    }
    if(name.value=='') {
      alert('Vyplňte prosím jméno');
      name.focus();
      return false;
    }
    if(surname.value=='') {
      alert('Vyplňte prosím příjmení');
      surname.focus();
      return false;
    }
    if(address.value=='') {
      alert('Vyplňte prosím adresu');
      address.focus();
      return false;
    }
    if(city.value=='') {
      alert('Vyplňte prosím město');
      city.focus();
      return false;
    }
    if(zipcode.value=='') {
      alert('Vyplňte prosím PSČ');
      zipcode.focus();
      return false;
    }
    if(email.value=='') {
      alert('Vyplňte prosím email');
      email.focus();
      return false;
    }
    if(souhlas.checked != true) {
      alert('Musíte souhlasit s podmínkami Klubu');
      souhlas.focus();
      return false;
    }
  }
}