
	function AddFavorite(linkObj, addUrl, addTitle)
    	{
      		if(document.all && !window.opera)
      		{
        		window.external.AddFavorite(addUrl, addTitle);
        		return false;
      		}
      		else if(window.opera && window.print)
      		{
        		linkObj.title=addTitle;
        		return true;
      		}
      		else if((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
      		{
        		if(window.confirm('Přidat oblíbenou stránku jako nový panel?'))
        		{
          			window.sidebar.addPanel(addTitle, addUrl, '');
          			return false;
        		}
      		}

      		window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
      		return false;
    	}



	function Search()
	{
		var elem;

		elem=GO('search');

		if(elem.value == 'hledejte...')
		{
			elem.value='';
		}
	}



	function Cart(input, mode)
	{
		var elem, val;

		elem=GO(input);

		val=Math.abs(elem.value);

		if(mode == 2)
		{
			val-=1;
		}
		else
		{
			val+=1;
		}

		if(val < 0) val=0;

		elem.value=val;
	}



	function JN(id, yesno)
	{
		if(yesno)
		{
			CCS('jni-' + id, 'display', 'block');
		}
		else
		{
			CCS('jni-' + id, 'display', 'none');
		}
	}



	function Cart_Descr()
	{
		var v=GO('cart-descr').value;

		v=v.replace(/&/g, '**am**');
		v=v.replace(/=/g, '**eq**');
		v=v.replace(/\+/g, '**pl**');

		head=document.getElementsByTagName('head')[0];
	    	loader=document.getElementById('loader');

	    	if(loader)
	    	{
	    		head.removeChild(loader);
	    	}

		script=document.createElement('script');
	    	script.id='loader';

	    	script.src='/cart/descr/?random=' + Math.random() + '&cdescr=' + v;

	    	//alert(script.src);
		//window.open(script.src);

		cache=document.getElementsByTagName('head')[0];
	    	cache.appendChild(script);

	    	return false;
	}



	function CartUC(msg)
	{
		msg=msg.replace('*', "\n\n");
		alert(msg);

		location.reload();
	}



	var TocA;

	function Toc(id, max)
	{
		if(TocA == id) return;

		for(i=1; i<=max; i++)
		{
			if(i == id)
			{
				TocA=id;
				CCS('toc-' + i, 'background', 'rgb(255,214,133)');
				GO('toci-' + i).checked='checked';
				setTimeout("GO('toci-" + i + "').blur();", 1);
			}
			else
			{
				CCS('toc-' + i, 'background', 'none');
			}
		}
	}


	function TocB(id, out)
	{
		if(!TocA && (id == 1)) return;
		if(TocA && (TocA == id)) return;

		if(out)
		{
			CCS('toc-' + id, 'background', 'none');
		}
		else
		{
			CCS('toc-' + id, 'background', '#FFEBC1');
		}
	}
	
	function VlozOdpoved(IDnumber){
		document.getElementById('cm[text_dotazu]').value='['+IDnumber+']';
		if(IDnumber){
			document.getElementById('VymazReakci').disabled = false;
			document.getElementById("input_reakce").style.display = 1;			
		}else{
			document.getElementById('VymazReakci').disabled = true;	
				
		}
		
	}
	
    //zobrazi informaci o vlozeni komentare
		$(document).ready(function()
		{
      setTimeout(function() {
          $('#successMessage').fadeOut('fast');
      }, 2500);
		});

