$(document).ready(function() {
	$("a.fancybox").fancybox({
        'zoomSpeedOut': 200
    });
});

function createUrl(id)
{
	var name = document.getElementById(id);
	var url = document.getElementById('url');
	
	var tablica = [[".","-"],
				   ["?","-"],
				   ["!","-"],
				   [";","-"],
				   ["\"","-"],
				   ["'","-"],
				   ["\\","-"],
				   ["/","-"],
				   ["_","-"],
				   [" ","-"],
				   ["ě","e"],
				   ["š","s"],
				   ["č","c"],
				   ["ř","r"],
				   ["ž","z"],
				   ["ý","y"],
				   ["á","a"],
				   ["í","i"],
				   ["é","e"],
				   ["ú","u"],
				   ["ů","u"],
				   ["ň","n"],
				   ["ť","t"],
				   ["ľ","l"],
				   ["ď","d"],
				   ["ó","o"]
				   ];
	
	var urlValue = name.value.toLowerCase();
	
	url.value = strtr(urlValue, tablica);
}

String.prototype.replaceAll = function(
  strTarget, // The substring you want to replace
  strSubString // The string you want to replace in.
)
{
  var strText = this;
  var intIndexOfMatch = strText.indexOf( strTarget );
 
  // Keep looping while an instance of the target string
  // still exists in the string.
  while (intIndexOfMatch != -1){
  // Relace out the current instance.
  strText = strText.replace( strTarget, strSubString )
 
  // Get the index of any next matching substring.
  intIndexOfMatch = strText.indexOf( strTarget );
  }
 
  // Return the updated string with ALL the target strings
  // replaced out with the new substring.
  return( strText );
}

function strtr(tekst, tablica, zmienna2){   
   if ((typeof(tablica)=="object") && (tablica.length)){
      for (i in tablica){
         tekst = tekst.replaceAll(tablica[i][0], tablica[i][1])
      }
      return tekst
   }
   else{
      tablica2 = new Array();
      for(i = 0; i < tablica.length; i++)
         tablica2[i] = [tablica.substr(i,1), zmienna2.substr(i,1)]
      return strtr(tekst, tablica2)
   }
}