// JavaScript Document

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url) {

  if (window.sidebar) // firefox

    window.sidebar.addPanel(title, url, "");

  else if(window.opera && window.print){ // opera

    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();

  }

  else if(document.all)// ie
  window.external.AddFavorite(url, title);

}

// Zobrazovanie a skryvanie obsahu
document.write('<style>.hidden-js { display: none; }<' + '/style>');

function toggle(el) {

	el.className = (el.className == '' ? 'hidden-js' : '');
	return true;

}

//Skrolovanie stranky
var skrolid, div_height;
function init() {

  div_height = document.getElementById('body').scrollHeight;

  if (document.all) objekt = document.body.clientHeight;
  else objekt = window.innerHeight;

  if(div_height > objekt) skroluj();
}

function skroluj() {

  var pom_p=0;
  for(i=0;i<3;i++) pom_p+=div_height=Math.floor(div_height/2);
  window.scrollTo(0,pom_p); 
  skrolid = setTimeout('skroluj()',20); 
  if(pom_p <= 0) clearTimeout(skrolid); div_height = pom_p;

}

/*------------------------------------------------------------
	Document Text Sizer- Copyright 2003 - Taewook Kang.  All rights reserved.
	Coded by: Taewook Kang (txkang.REMOVETHIS@hotmail.com)
	Web Site: http://txkang.com
	Script featured on Dynamic Drive (http://www.dynamicdrive.com)
	
	Please retain this copyright notice in the script.
	License is granted to user to reuse this code on 
	their own website if, and only if, 
	this entire copyright notice is included.
--------------------------------------------------------------*/

//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
}
//<a href="javascript:ts('body',1)">+ Larger Font</a> | <a href="javascript:ts('body',-1)">+ Smaller Font</a>
//------------------------------------------------------------------------------

//kontrola registracneho contact_forma
//podlieha atributu name='' ktory je zakazany v XHTML 1.1
/*
function Kontrola ()
{

   if (document.contact_form.contact_name.value == "")
   {
      document.contact_form.contact_name.focus();
      alert ("Nezadali ste Vaše prihlasovacie meno");
      return false;
   }
   if (document.contact_form.login.value.length < 6)
   {
      document.contact_form.login.focus();
      alert ("Prihlasovacie meno musí mať minimálne 6 znakov");
      return false;
   }   
   if (document.contact_form.heslo.value == "")
   {
      document.contact_form.heslo.focus();
      alert ("Nezadali ste Vaše prihlasovacie heslo");
      return false;
   }
   if (document.contact_form.hesloznova.value == "")
   {
      document.contact_form.hesloznova.focus();
      alert ("Nezadali ste znova Vaše prihlasovacie heslo");
      return false;
   }
   if (document.contact_form.heslo.value != document.contact_form.hesloznova.value)
   {
      document.contact_form.hesloznova.focus();
      alert ("Vami zadané prihlasovacie heslá sa nezhodujú");
      return false;
   }
   if (document.contact_form.nazov.value != "" || document.contact_form.ico.value != "")
   {
      if (document.contact_form.ico.value == "")
      {
        document.contact_form.ico.focus();
        alert ("Nezadali ste IČO firmy");
        return false;        
      } else {
        if (isNaN(document.contact_form.ico.value))
        {
          document.contact_form.ico.focus();
          alert ("IČO firmy je nesprávne");
          return false;
        }     
      }       
   }   
   if (document.contact_form.meno.value == "")
   {
      document.contact_form.meno.focus();
      alert ("Nezadali ste Vaše meno");
      return false;
   } 
   if (document.contact_form.adresa.value == "")
   {
      document.contact_form.adresa.focus();
      alert ("Nezadali ste Vašu adresu");
      return false;
   } 
   if (document.contact_form.email.value == "")
   {
      document.contact_form.email.focus();
      alert ("Nezadali ste váš e-mail");
      return false;
   }
   if (document.contact_form.email.value.indexOf("@") == -1)
   {
      document.contact_form.email.focus();
      alert ("Chybný formát e-mailu");
      return false;
   }
   if (document.contact_form.rok.value == "")
   {
      document.contact_form.rok.focus();
      alert ("Nezadali jste váš rok narození");
      return false;
   }
   if (isNaN(parseInt(document.contact_form.rok.value)))
   {
      document.contact_form.rok.focus();
      alert ("Chybný formát roku narození");
      return false;
   }
   if ((parseInt(document.contact_form.rok.value) < 1900)||(parseInt(document.contact_form.rok.value) > 2001))
   {
      document.contact_form.rok.focus();
      alert ("Chybný rok narození, rozmezí 1900-2001");
      return false;
   }
}
*/
