function gE(id) {
	return document.getElementById(id);
}

//-------------kopie php funkci co v JS chybí---------------------
function in_array(needle, haystack, argStrict) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // *     example 1: in_array('van', ['Kevin', 'van', 'Zonneveld']);
    // *     returns 1: true
 
    var found = false, key, strict = !!argStrict;
 
    for (key in haystack) {
        if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
            found = true;
            break;
        }
    }
 
    return found;
}

function number_format(a, b, c, d) {
	// number_format(number, decimals, comma, formatSeparator)
	a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
	e = a + '';
	f = e.split('.');
	if(!f[0]) f[0] = '0';
	if(!f[1]) f[1] = '';
	if(f[1].length < b){
		g = f[1];
		for(i = f[1].length + 1; i <= b; i++) {
			g += '0';
		}
		f[1] = g;
	}
	if(d != '' && f[0].length > 3) {
		h = f[0];
		f[0] = '';
		for(j = 3; j < h.length; j += 3) {
			i = h.slice(h.length - j, h.length - j + 3);
			f[0] = d + i +  f[0] + '';
		}
		j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
		f[0] = j + f[0];
	}
	c = (b <= 0) ? '': c;
	return f[0] + c + f[1];
}
//-------------kopie php funkci co v JS chybí---------------------end

var CisloUploadIframe='';
var MenRozmer='';
//multi upload
function MultiUpload(soubor,cislo) {
	gE('soubor').value+='--- '+soubor+' !nahravam!';
	gE('soubor'+cislo).value=soubor+' !nahravam!';
}

function RozniDalsiUpload(cislo) {
	var PocetUploadu = gE('maxpocetiframu').value;
	if(cislo==CisloUploadIframe&&cislo<(PocetUploadu-1)) {
		CisloUploadIframe++;
		gE('idupload'+CisloUploadIframe).style.display='';

		if (PocetUploadu<5)
			var PrvniAktivator=PocetUploadu;
		else
			var PrvniAktivator=5;
		if (cislo==0){ //naplni dalši 4 uploady
			for (var i=1;i<PrvniAktivator;i++) {
				gE('idupload'+i).src='upload.php?'+gE('iframepromenne').value+'&cisloframu='+i; //alert('1-'+i);
			}
		}
		if (cislo==1){ //naplní zbytek uploadu
			for (var i=5;i<PocetUploadu;i++) {
				gE('idupload'+i).src='upload.php?'+gE('iframepromenne').value+'&cisloframu='+i; //alert('2-'+i);
			}
		}
		if (MenRozmer!='') ZmenaRozmeru(MenRozmer);
	}
}

function MultiUploadSoubor(soubor,soubor_size,cislo) {
	gE('soubor'+cislo).value=soubor;
	gE('soubor_size'+cislo).value=soubor_size;
	try {ResizeJPG(soubor);} catch(e)	{} //ResizeJPG je jenom u spravce
	var celkovysoubor='';
	var celkovavelikost=0;
	for (var i=0;i<=CisloUploadIframe;i++) {
		if (gE('soubor'+i).value!='') {
			celkovysoubor+='--- '+gE('soubor'+i).value;
			celkovavelikost+=parseInt(gE('soubor_size'+i).value);
		}
	}
	if (celkovavelikost>gE('maxvelikostsouboru').value&&gE('maxvelikostsouboru').value!='') {
		alert(TextJS[14]);
		parent.window.eval('upload'+cislo).gE('formmazani').submit();
		MultiUploadSoubor('','',cislo);
		return false;
	}
	else
		gE('soubor').value=celkovysoubor;

	try {
		if (gE('soubor').value!="" && gE('soubor').value.indexOf("!nahravam!")==-1) {
			gE('upload_img').src="html/pic/upload2.jpg";
			gE('upload_but').disabled=false;
			gE('upload_but_tab').style.border='2px solid #009900';
		}
		else {
			gE('upload_img').src="html/pic/upload1.jpg";
			gE('upload_but').disabled=true;
			gE('upload_but_tab').style.border='2px solid #E8E5DE';
		}
	}
	catch(e) {}
}
function UzJeUpload(nazevsouboru) {
	return gE('soubor').value.indexOf(nazevsouboru);
}
//simple upload
function SimpleUpload(soubor,dodatekknazvu) {
	gE('soubor'+dodatekknazvu).value=soubor;
	try {
		if (gE('soubor'+dodatekknazvu).value!="" && gE('soubor'+dodatekknazvu).value.indexOf("!nahravam!")==-1) {
			gE('upload_img').src="html/pic/upload2.jpg";
			gE('upload_but').disabled=false;
			gE('upload_but_tab').style.border='2px solid #009900';
		}
		else {
			gE('upload_img').src="html/pic/upload1.jpg";
			gE('upload_but').disabled=true;
			gE('upload_but_tab').style.border='2px solid #E8E5DE';
		}
	}
	catch(e) {}
}
function Uploaduje() {
	if (arguments.length>0)
		var dodatekknazvu=arguments[0];
	else
		var dodatekknazvu='';

	if (gE('soubor'+dodatekknazvu).value.indexOf("!nahravam!")!=-1) {
		alert(TextJS[0]);
		return true;
	}
	else
		return false;
}
function RadioButton(kde,hodnota) {
	gE(kde).value=hodnota;
}
function CheckBox(kde,hodnota) {
	if (hodnota)
		gE(kde).value=1;
	else
		gE(kde).value=0;
}
function CheckBoxValue(kde,hodnota,vloz) {
	if (hodnota)
		gE(kde).value=vloz;
	else
		gE(kde).value='';
}


function PrepinacOnOff(name) {
	if (gE(name).value=='1') {
		gE('prepinac_zap_'+name).style.display='none';
		gE('prepinac_vyp_'+name).style.display='';
		gE(name).value='0';
		return false;
	}
	else {
		gE('prepinac_vyp_'+name).style.display='none';
		gE('prepinac_zap_'+name).style.display='';
		gE(name).value='1';
		return true;
	}
}

function FaktStornoSmaz(cislotxt) {
	return confirm(TextJS[cislotxt]);
}

function htmlSpecialChars(tmp) {
	var iStringLength = tmp.length;
    var sModifiedString = '';
    for (var i = 0; i < iStringLength; i++) {
        switch (tmp.charCodeAt(i)) {
            case 34 :sModifiedString += '&quot;';break;
            case 38 :sModifiedString += '&amp;' ;break;
            case 39 :sModifiedString += '&#39;' ;break;
            case 60 :sModifiedString += '&lt;'  ;break;
            case 62 :sModifiedString += '&gt;'  ;break;
            default :sModifiedString += tmp.charAt(i);
        }
    }
    return sModifiedString;
}

function RychlaNavigace(tmp) {
	if (tmp!="") {
		document.location.href=tmp;
	}
}

var zobrazenMalyAlert='';

function Alert(text) {
	var cil=arguments[1];
	var scroll=arguments[2];

	//vypnu zobrazeny maly alert nebo velky alert
	//trochu me to mate, teoreticky nemusi byt: if (zobrazenMalyAlert!='' || !cil) 
	AlertOff(); 
	
	//zkusim vypsat chybu v cily nebo nahore
	if (cil) {
		gE("A_"+cil).innerHTML=text;
		zobrazenMalyAlert=cil;
		$('#A_'+cil).fadeIn('slow');

		if(scroll==true) {			
			var s = ($('#A_'+cil).offset().top)-8;
			$('html, body').animate({scrollTop:s}, 'fast');
		}
	}
	//roznu horni chybu
	else {		
		gE('obal_chyba_js').style.display='';
		gE('obal_chyba_js_text').innerHTML=text;
	}

	return false;
}
function AlertOff() {
	//zhasnu stare chyby a zpravy nahore vygenerovane phpkem
	try { 
		gE('ChybaVypis').style.display='none';
	} catch(e) {}
	
	//zhasnu horni chybu
	try { 
		gE('obal_chyba_js_text').innerHTML='';
		gE('obal_chyba_js').style.display='none';		
	} catch(e) {}

	//pokusi se zhasnout predchozi maly Alert (uz nemusi byt)
	try { 
		gE("A_"+zobrazenMalyAlert).innerHTML='';
		gE("A_"+zobrazenMalyAlert).style.display='none';		
	} catch(e) {}
	
	zobrazenMalyAlert='';
}

var generovat_okno;
function Generovat(cas) {
	generovat_okno='';
	try {
		generovat_okno=window.open('generovat.php','generovat_okno');
		//alert("volani java");
		Generovat_focus();
		Generovat_cyklus(cas);
		return false;
	}
	catch(e) {}		
	if (generovat_okno=='') {
		Generovat_cyklus(cas);
		//alert("volani klasika");
		return true;
	}
	else
		return false;
}
function Generovat_cyklus(i) {
	try {			
		gE('generovat_fake').innerHTML=TextJS[1]+" "+i+"s";
		gE('generovat_fake').style.display='';
		gE('generovat').style.display='none';
		i--;
		if(i>0) {		
			setTimeout(function() {
				Generovat_cyklus(i);
			}, 1000);
		}	
		else {
			gE('generovat_fake').style.display='none';
			gE('generovat').style.display='';
		}
	}
	catch(e) {}
}
function Generovat_focus() {
	try {		
		generovat_okno.focus();	
	}
	catch(e) {}	
}

function SpustFlash(doID,dir,flash,width,height,bg,bgalt,borderalt) {
	if (!bg) bg='E8E5DE';
	if (!bgalt) bgalt='efece5';
	if (!borderalt) borderalt='ccc';
	var hasRightVersion = DetectFlashVer(9, 0, 124);
	if(hasRightVersion) {  // if we've detected an acceptable version
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0',
			'width', width,
			'height', height,
			'src', dir+flash,
			'quality', 'best',
			'pluginspage', 'http://www.adobe.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', flash,
			'bgcolor', '#'+bg,
			'name', 'stats_banner',
			'menu', 'false',
			'allowFullScreen', 'true',
			'allowScriptAccess','sameDomain',
			'movie', dir+flash,
			'salign', '',
			'doID',doID
		); //end AC code
	} else {  // flash is too old or we can't detect the plugin
		NespustilFlash(doID,width,height,bgalt,borderalt);
	}
	return false;
}
function NespustilFlash(doID,width,height,bgalt,borderalt) {
	gE(doID).innerHTML="<div class='textchyba' align='center' style='width:"+(width-2)+"px;height:"+(height-2)+"px;border:1px solid #"+borderalt+";background-color:#"+bgalt+";'><div style='padding:"+((height/2)-50)+"px 0px 0px 0px;'>"+TextJS[56]+"</div><a href=\"http://get.adobe.com/flashplayer/\" target=\"_self\"><img src=\"html/pic/alternate.gif\" alt=\"flashplayer\" width=\"88\" height=\"31\" vspace=\"5\" border=\"0\"></a><br/>("+TextJS[57]+")</div>";
}

function KontrolaDatFormulare(typ,hodnota)
{
	if(typ=="mail")
	{
		var regObj= new RegExp('^([a-zA-Z0-9_-]+[.])*[a-zA-Z0-9_-]+@([a-zA-Z0-9_-]+[.])*[a-zA-Z0-9_-]+[.][a-zA-Z0-9]{2,4}$');
	  if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="mail_multi") 
	{
		var regObj= new RegExp('^(([a-zA-Z0-9_-]+[.])*[a-zA-Z0-9_-]+@([a-zA-Z0-9_-]+[.])*[a-zA-Z0-9_-]+[.][a-zA-Z0-9]{2,4}([ ]*,[ ]*)?)+$');
	  if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="mail_prefix")
	{
		var regObj= new RegExp('^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*$');
	  if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="subdomena")                                                                     //kontrola casti domenoveho jmena urcujici domenu tretiho radu (tzn.: KONTROLOVANE.neco.cz)
	{
		var regObj= new RegExp('^([a-z0-9]+[-]?)*[a-z0-9]+$');
	  if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="domena")
	{
		var regObj= new RegExp('^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$');
	  if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="domena2r")
	{
		var regObj= new RegExp('^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+$');
	 if (! hodnota.match(regObj))  
	    return false;
	}
	if(typ=="domena2r_bezKoncovky")
	{
	  	var regObj= new RegExp('^[a-z0-9]+([-][a-z0-9]+)*$','i');
	    if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="heslo")
	{
		var regObj= new RegExp('^[a-zA-Z0-9@_]{5,30}$');
	  if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="telefon")
	{
		var regObj= new RegExp('^[+][0-9]{3}[ ]?[0-9]{3}[ ]?[0-9]{3}[ ]?[0-9]{3}$');
	 if (! hodnota.match(regObj))
	    return false;
	}
	if(typ=="vyplneno")
	{
	  if (hodnota.length<3)
	    return false;
	}
	if(typ=="cislo")
	{
		var regObj= new RegExp('^[0-9]+$');
	 if (! hodnota.match(regObj))  
	    return false;
	}
	return true;
}

function NactiText(cislo) {
	try {
		var tmp=gE("textyProJS").value;
		tmp = tmp.split("~");
		
		if(tmp[cislo-1000]!="") 
			return tmp[cislo-1000];
		else 
			return TextJS[999];
	}
	catch(e) {return TextJS[999];}
}

function hexdec(hex_string) {
	hex_string = (hex_string+'').replace(/[^a-f0-9]/gi, '');
	return parseInt(hex_string, 16);
}
function OpacnaBarva(tmp) {
	tmp = tmp.replace(/#/gi, '');
	tmp = (hexdec(tmp.substr(0,2))+hexdec(tmp.substr(2,2))+hexdec(tmp.substr(4,2)))/3;
 	if (tmp>127.5) 
  		tmp="000000";
	else
    	tmp="ffffff";
	return tmp;
}

function ZakazEnter(e)
{
    var k = (navigator.appName=="Netscape") ? e : event.keyCode;
    if(k == 13)
		return false;
    else 
    	return true;
}

function str_replace(strFind, strReplace, strChk)
{
  var strOut = strChk;
  while (strOut.indexOf(strFind) > -1) {
    strOut = strOut.replace(strFind, strReplace);
  }
  return strOut;
}

String.prototype.trim = function()
{
    a = this.replace(/^\s+/, '');
    return a.replace(/\s+$/, '');
};

var Utf8 = {
 
	// public method for url encoding
	encode : function (string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	},
 
	// public method for url decoding
	decode : function (utftext) {
		var string = "";
		var i = 0;
		var c = c1 = c2 = 0;
 
		while ( i < utftext.length ) {
 
			c = utftext.charCodeAt(i);
 
			if (c < 128) {
				string += String.fromCharCode(c);
				i++;
			}
			else if((c > 191) && (c < 224)) {
				c2 = utftext.charCodeAt(i+1);
				string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
				i += 2;
			}
			else {
				c2 = utftext.charCodeAt(i+1);
				c3 = utftext.charCodeAt(i+2);
				string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
				i += 3;
			}
 
		}
 
		return string;
	},
	
	decodeArray : function (pole) {
		for(var key in pole)
		{
			try
			{
				if(key!='toJSONString')
					if (pole[key].constructor.toString().indexOf("Array") == -1)
					{
						if (pole[key].constructor.toString().indexOf("String") != -1)
							pole[key]=this.decode(pole[key]);
					}
					else
						pole[key]=this.decodeArray(pole[key]);
			}
			catch(e){}
		}
		return pole;
	}
 
};

function intval(mixed_var, base) {
	var tmp;
	var type = typeof( mixed_var );

	if (type === 'boolean') {
		return (mixed_var) ? 1 : 0;
	} else if (type === 'string') {
		tmp = parseInt(mixed_var, base || 10);
		return (isNaN(tmp) || !isFinite(tmp)) ? 0 : tmp;
	} else if (type === 'number' && isFinite(mixed_var) ) {
		return Math.floor(mixed_var);
	} else {
		return 0;
	}
}

function GenerovatScroll(korekce,mezera,rychlost) {
	var odsazeni = $(window).scrollTop();

	if(odsazeni>mezera)
		korekce = korekce + odsazeni;
	else
		korekce = korekce + mezera;

	$('#generovat_float').animate({top:korekce+'px'},{queue: false, duration: rychlost});
}

function preloader(preloaderid,containerid,odsazeni) {
	try
	{
		switch (preloaderid) {
			case 1 :
				odsazeni = $('#'+containerid).height();
				document.getElementById(containerid).innerHTML="<table width='100%' height='"+odsazeni+"' border='0' cellspacing='0' cellpadding='0'><tr><td align='center'><img src='html/pic/loading.gif' width='50' height='50'></td></tr></table>";
				break;
			//to same jak 1 ale s odsazenim zhora a zdola
			case 2 :
				if(!odsazeni)
					odsazeni=164;
				document.getElementById(containerid).innerHTML="<div align='center' style='margin-top:"+odsazeni+"px;margin-bottom:"+odsazeni+"px'><img src='html/pic/loading.gif' width='50' height='50'></div>";
				break;
				
			//direct ajax - vraci pouze cestu k obrazku - nepracuje s odsazenim
			case 3 :
				return "html/pic/preloader_napoveda.gif";
				break;
			case 4 :
				return "html/pic/preloader.gif";
				break;
			case 5 :
				return "html/pic/preloader_stranky.gif";
				break;
		}
	}
	catch (e){
		alert(e);
	}
}
//-----------------video----------------------------
function VideoTutorialOtevri(video,PZ) {

	if($("#tut_video_box").html() != "" && $("#tut_video_box").length > 0)
		return false;

	AlertOff();
	$("#tut_video_box").html("");

	$(document).keypress(function(e){
		if(e.keyCode==27){
			 VideoClose();
		}
	});

	if(PZ) {
		popupID="tut_video_box_popup"; //kontejner v kterm se bude zobrazovat popUP
		
		if($("#"+popupID).length == 0) //vytvořím kontejner na začatku PZ_obsah 
			$('body').prepend('<div id="'+popupID+'" class="'+popupID+'"><div id="tut_video_box"></div></div>');

		centerPopup();
		loadPopup();		

		$("#tut_video_box").css("display","block");
		$("#tut_video_box").animate({"height" : "517"},'fast');

		DirectAjax(
			AJAX_DIRECT,
			"tut_video_box",
			"",
			"idetifier=11",
			"video="+video,
			"jazyk="+JAZYK,
			"js_preloader="+preloader(5),
			"js_preheight=517",
			function() {				
				VideoTutorialSpust($("#tut_video_flash").val(),$("#tut_video_title").val(),$("#tut_video_detail").val());
			}
		);
	}
	else {
        
        $("#tut_video_box").css("display","block");
        $("#tut_video_box").animate({"height" : "250"},'fast');
        
		DirectAjax(
			AJAX_DIRECT,
			"tut_video_box",
			"",
			"idetifier=11",
			"video="+video,
			"jazyk="+JAZYK,
			"js_preloader="+preloader(4),
			"js_preheight=250",
			function() {
				$("#tut_video_box").animate({"height": "517"},'fast',function() {                   
					VideoTutorialSpust($("#tut_video_flash").val(),$("#tut_video_title").val(),$("#tut_video_detail").val());
				});
			}
		);
	}
}
function VideoTutorialSpust(flash,title,detail) {
    
	$("#tut_video").html("");
	SpustFlash("tut_video","html/video/",flash,600,480,'000000');
	$("#tut_video_js_title").text(title);
	$("#tut_video_js_title_detail").text("("+detail+")");

	try {
		DirectAjax(
			AJAX_DIRECT,
			"",
			"",
			"idetifier=11",
			"flash="+flash,
			"location="+document.location,
			"stat=1"
		);
	}
	catch(e){}
}
function VideoClose() {
	$("#tut_video").html("");
	$("#tut_video_box").animate({height: '0'},function(){
		$("#tut_video_box").html("");
		$("#tut_video_box").css({
			"display": "none"
		});
	});

	//pz popup
	try {
		if(popupID)
			disablePopup();
	}
	catch(e){}

	return false;
}
//-----------------video----------------------------end

//-----------------PopUp----------------------------
//0 means disabled; 1 means enabled;
var popupID = 0;
//loading popup with jQuery magic!
function loadPopup(){
	//vytvořím bg
	if($("#PopupBG").length == 0)
		$("body").append("<div id='PopupBG'></div>");

	//loads popup only if it is disabled
	$("#PopupBG").css({
		"opacity": "0.7"
	});
	
	//only need force for IE6
	$("#PopupBG").css({
		"height": document.documentElement.clientHeight
	});
	$("#PopupBG").fadeIn("slow");
	$("#"+popupID).fadeIn("slow");
}
//disabling popup with jQuery magic!
function disablePopup(){
	//disables popup only if it is enabled
	if(popupID){
		$("#PopupBG").fadeOut("slow");
		$("#"+popupID).fadeOut("slow");
		popupID = 0;
	}
}
//centering popup
function centerPopup(){
	//request data for centering
	var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
	var popupHeight = $("#"+popupID).height();
	var popupWidth = $("#"+popupID).width();
	//centering
	$("#"+popupID).css({
		"position": "absolute",
		"top": windowHeight/2-popupHeight/2,
		"left": windowWidth/2-popupWidth/2
	});
}
//-----------------PopUp----------------------------end


function LupaOn(file) {
	gE('lupaokno').style.display='block';
	if (gE('lupasrc').src!=file) {
		gE('lupasrc').src="";
		gE('lupasrc').src=file;
	}
}
function LupaOff() {
	gE('lupaokno').style.display='none';
}

var datepickerLoaderNacten=0;  //nenacteno
function datepickerLoader(obj,format) {
	if(datepickerLoaderNacten==1) //nacitano
		return false;
	else if(datepickerLoaderNacten==0) {
		datepickerLoaderNacten=1;
		var href="html/jQuery/css/custom-theme/jquery-ui-1.8.custom.css";
		$.ajax({
			url: href,
			//dataType: 'css', delal problem v 1.5.
			success: function(){
				var $link = $('<link href="'+href+'" rel="stylesheet" type="text/css" />').appendTo("head");
				$link.attr({
					href : href,
					rel  : "stylesheet",
					type : "text/css"
				});
				$.getScript('html/jQuery/jquery-ui-1.8.12.custom.min.js', function() {
					$(obj).datepicker({
					monthNames: TextJS["kalendarMesice"].split(','),
					dayNamesMin: TextJS["kalendarDnyMin"].split(','),
					dayNames: TextJS["kalendarDny"].split(','),
					dateFormat: format,
					firstDay: 1,
					minDate: 0});
					datepickerLoaderNacten=2;
				});
			}
		});
	}
	else {
		$(obj).datepicker({
			monthNames: TextJS["kalendarMesice"].split(','),
			dayNamesMin: TextJS["kalendarDnyMin"].split(','),
			dayNames: TextJS["kalendarDny"].split(','),
			dateFormat: format,
			firstDay: 1,
			minDate: 0});
	}

	$(obj).attr("onmouseover","");
}

var fancyBoxLoaderNacten=0; //nenacteno
function fancyBoxLoader(fce) {
	if(fancyBoxLoaderNacten==1) //nacitano
		return false;
	else if(fancyBoxLoaderNacten==0) {
		fancyBoxLoaderNacten=1;
		var href="html/jQuery/css/fancybox/fancybox-1.3.4.css";
		$.ajax({
			url: href,
			//dataType: 'css', delal problem v 1.5.
			success: function(){
				var $link = $('<link href="'+href+'" rel="stylesheet" type="text/css" />').appendTo("head");
				$link.attr({
					href : href,
					rel  : "stylesheet",
					type : "text/css"
				});
				$.getScript('html/jQuery/fancybox-1.3.4.js', function() {
					fce();
					fancyBoxLoaderNacten=2; //nacteno
				});
			}
		});
	}
	else {
		fce();
	}
}
