/* generated javascript */ var skin = 'monobook'; var stylepath = '/skins-1.5'; /* MediaWiki:Common.js */ /*
*/

/********************************\
|* Nová položka v menu nástroje *|
|*  "Načíst soubor na Commons"  *|
\********************************/

function AddCommonsUpload ()
  {
  nodUpload = document.getElementById ("t-upload");

  if (nodUpload)
    {
    var nodToolsList = nodUpload.parentNode;
    var nodUploadCommons_li = document.createElement ("li");
    var nodUploadCommons_a = document.createElement ("a");

    nodUploadCommons_li.id = "t-upload-commons";
    nodUploadCommons_a.href = "http://commons.wikimedia.org/wiki/Special:Upload?uselang=cs";

    nodUploadCommons_a.appendChild (document.createTextNode ("Načíst na Commons"));
    nodUploadCommons_li.appendChild (nodUploadCommons_a);

    nodToolsList.insertBefore (nodUploadCommons_li, nodUpload.nextSibling);
    }
  }

/********************************\
|* Nový nahrávací formulář      *|
\********************************/

function EasyUpload()
 {
   uploadLink = document.getElementById("t-upload");
   if (!uploadLink) return;

   a = uploadLink.firstChild;
   a.setAttribute('href', '/wiki/Nápověda:Načíst_soubor');
 }


/*******************************\
|* Předvyplnění popisu souboru *|
\*******************************/

function PrefillUploadDescription ()
  {
  if (wgPageName == "Speciální:Upload")
    document.getElementById ("wpUploadDescription").value="{{Popis souboru\n  | popis =\n  | zdroj =\n  | datum =\n  | autor =\n  | povolení =\n  | jiné verze =\n}}";
  }


/* hvězdičky pro featured articles v jiných jazycích */
function LinkFA() 
{
    var langbox = document.getElementById("p-lang");
    if (!langbox) return;
    var interwiki = langbox.getElementsByTagName("li");
    // iterace přes všechny mezijazykové odkazy
    for (var i = 0; i < interwiki.length; ++i)
    {
        var link = interwiki[i];
        var language = link.className.substring(10); // smazat "interwiki-"
        // zkusit najít odpovídající FA element
        var falink = document.getElementById("fa-link-" + language);
        if (falink)
        {
            link.className += " featured";
            link.title = "Tento článek patří mezi nejlepší";
        }
    }
}


/*
 * Zajistí, aby kvůli našemu .changedCSS indikátoru (viz [[MediaWiki:ChangedCSS]]) nahoře trvale neopruzovalo tlačítko [zavřít].
 * Pokud [[MediaWiki:Sitenotice]] obsahuje jen tento indikátor, je tlačítko [zavřít] přesunuto do něj (a tím skryto).
 */
function fixSiteNoticeCloseButton() {
	var siteNotice = document.getElementById('siteNotice');
	if (!siteNotice) return;

	var tds = siteNotice.getElementsByTagName('td');
	if (tds.length < 2) return;

	var contentTd = tds[0];
	if (contentTd.hasChildNodes())
	{
		var children = contentTd.childNodes;
		var cssNotice = null;
		var hasRealContent = false;
		for (var i = 0; i < children.length; ++i)
		{
			switch(children[i].nodeType)
			{
				case 1:		// Node.ELEMENT_NODE
					if (children[i].className == 'changedCSS') cssNotice = children[i];
						else hasRealContent = true;
					break;
				case 3:		// Node.TEXT_NODE
				case 4:		// Node.CDATA_SECTION_NODE
					if (children[i].textContent.match(/[^\s]/)) hasRealContent = true;
					break;
				case 5:		// Node.ENTITY_REFERENCE_NODE
					hasRealContent = true;
				default:
					break;
			}
			if (hasRealContent) break;
		}
		if (!hasRealContent && cssNotice != null) {
			var cssId = cssNotice.id;
			cssNotice.id = cssId + '_inner';
			siteNotice.id = cssId;
		}
	}
}



/*****************\
|*  csWikipedia  *|
|* customization *|
\*****************/

function CustomizeCsWikipedia ()
  {
  AddCommonsUpload ();
  fixSiteNoticeCloseButton ();
  PrefillUploadDescription ();
  EasyUpload ();
  LinkFA();
  }

if (window.addEventListener)
  {
  window.addEventListener ("load", CustomizeCsWikipedia, false)
  }
else if (window.attachEvent)
  {
  window.attachEvent ("onload", CustomizeCsWikipedia)
  };

/*
*/ /* MediaWiki:Monobook.js */ /*
 */
/* tooltips and access keys */
ta = new Object();
ta['ca-unprotect'] = new Array('','Odemknout tuto stránku');
ta['ca-nomove'] = new Array('','Nemáte oprávnění přesunout tuto stránku'); 
ta['ca-nstab-portál'] = new Array('c','Zobrazit portál.');

/* přidat menu pro speciální znaky */
/* Musí odpovídat MediaWiki:Edittools! **/
/* podle en:wiktionary */
function addCharSubsetMenu() {
  var copywarn = document.getElementById('specialchars');

  if (copywarn) {
    var menu = "";
    copywarn.innerHTML = menu + copywarn.innerHTML;

    /* implicitní sada */
    chooseCharSubset(0);

    /*********************************\
    |* umožnění vkládání entity nbsp *|
    |* vytvořil Danny B.             *|
    \*********************************/
    ndlCharinserts = document.getElementById ("specialchars").getElementsByTagName ("p") [0].getElementsByTagName ("a");
    for (intCyc = 0; intCyc < ndlCharinserts.length; intCyc++)
      if (ndlCharinserts [intCyc].childNodes [0].nodeValue == " ")
        ndlCharinserts [intCyc].onclick = function () { insertTags('\x26nbsp;','',''); return false } ;
    
  }
}

/* volba speciálních znaků */
function chooseCharSubset(s) {
  var l = document.getElementById('specialchars').getElementsByTagName('p');
  for (var i = 0; i < l.length ; i++) {
    l[i].style.display = i == s ? 'inline' : 'none';
    l[i].style.visibility = i == s ? 'visible' : 'hidden';
  }
}

/* přidaná tlačítka na edit toolbar pro všechny */
function commonCustomizeEditToolbar()
  {
  if (!mwCustomEditButtons)
    return;
//Přesměrování
  mwCustomEditButtons[mwCustomEditButtons.length] =
    {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
    "speedTip": "Přesměrování",
    "tagOpen": "#REDIRECT [[",
    "tagClose": "]]",
    "sampleText": "cíl"
    };
//Horní index
  mwCustomEditButtons[mwCustomEditButtons.length] =
    {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png",
    "speedTip": "Horní index",
    "tagOpen": "",
    "tagClose": "",
    "sampleText": "horní index"
    };
//Dolní index
  mwCustomEditButtons[mwCustomEditButtons.length] =
    {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png",
    "speedTip": "Dolní index",
    "tagOpen": "",
    "tagClose": "",
    "sampleText": "dolní index"
    };
//Přeškrtnutí
  mwCustomEditButtons[mwCustomEditButtons.length] =
    {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png",
    "speedTip": "Přeškrtnutí",
    "tagOpen": "",
    "tagClose": "",
    "sampleText": "přeškrtnutý text"
    };
//Odřádkování
  mwCustomEditButtons[mwCustomEditButtons.length] =
    {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png",
    "speedTip": "Odřádkování",
    "tagOpen": "
", "tagClose": "", "sampleText": "" } } /***********************************\ |* Uživatelský prostor pro anonymy *| |* vytvořil Danny B. *| \***********************************/ function AddAnonUserSpace () { var nodLogin = document.getElementById ("pt-login"); if (nodLogin) { var nodLinksList = nodLogin.parentNode; //var nodUserPage_li = document.createElement ("li"); var nodUserTalk_li = document.createElement ("li"); //var nodUserPage_a = document.createElement ("a"); var nodUserTalk_a = document.createElement ("a"); //nodUserPage_li.id = "pt-anonuserpage"; nodUserTalk_li.id = "pt-anontalk"; //nodUserPage_a.href = "/wiki/Speci%C3%A1ln%C3%AD:Mypage"; nodUserTalk_a.href = "/wiki/Speci%C3%A1ln%C3%AD:Mytalk"; //nodUserPage_a.appendChild (document.createTextNode ("Moje stránka")); nodUserTalk_a.appendChild (document.createTextNode ("Moje diskuse")); //nodUserPage_li.appendChild (nodUserPage_a); nodUserTalk_li.appendChild (nodUserTalk_a); //nodLinksList.insertBefore (nodUserPage_li, nodLogin); nodLinksList.insertBefore (nodUserTalk_li, nodLogin); } } /**********************\ |* Změna názvu článku *| |* vytvořil Danny B. *| \**********************/ function SpravnyNazev () { var nodSpravnyNazev = document.getElementById ("Sablona__Nazev_Spravny-nazev"); if (nodSpravnyNazev) { var nodSablonaNazev = document.getElementById ("Sablona__Nazev"); var nodNadpis = document.getElementsByTagName ("h1") [0]; var anodNadpisObsah = nodNadpis.childNodes; var nodPuvodniNazev = null; for (var i = 0; i < anodNadpisObsah.length; ++i) { var n = anodNadpisObsah[i]; if (n.nodeType == 3) // Node.TEXT_NODE { nodPuvodniNazev = n; break; } } if (nodPuvodniNazev == null) return; nodNadpis.replaceChild (nodSpravnyNazev, nodPuvodniNazev); nodSablonaNazev.parentNode.removeChild (nodSablonaNazev); } } /* úpravy české Wikipedie */ function customize() { commonCustomizeEditToolbar(); addCharSubsetMenu(); AddAnonUserSpace (); SpravnyNazev (); } addOnloadHook(customize); // ============================================================ // BEGIN pageview counter // Please talk to User:LeonWeber before changing anything or // if there are any issues with that. // this should be adjusted to a good value. // BE CAREFULL, you will break zedler if it's too low! // And then DaB. will kill Leon :-( var disable_counter = 0; var counter_factor = 30; function pgcounter_setup() { if(disable_counter == 0) { var url = window.location.href; if(Math.floor(Math.random()*counter_factor)==4) // the probability thing { if(wgIsArticle==true) // do not count history pages etc. { var pgcountNs = wgCanonicalNamespace; if(wgCanonicalNamespace=="") { pgcountNs = "0"; } var cnt_url = "http://pgcount.wikimedia.de/index.png?ns=" + pgcountNs + "&title=" + encodeURI(wgTitle) + "&factor=" + counter_factor + "&wiki=cswiki"; var img = new Image(); img.src = cnt_url; } } } } // Do not use aOnloadFunctions[aOnloadFunctions.length] = pgcounter_setup;, some browsers don't like that. pgcounter_setup(); // END pageview counter // ============================================================ /*
*/ /* ==== funkce insertTagsTo_ ==== ; Author: phpBB Team, WikiMedia, Maciej Jaros [[:pl:User:Nux]] ; Licence: [http://opensource.org/licenses/gpl-license.php GNU General Public License v2] ; Description: Apply tagOpen/tagClose to selection in given textarea/input, use sampleText instead of selection if there is none. Copied and adapted from phpBB
*/
// outputid = 'some_id_of_a_textarea_or_a_text_input'
function insertTagsTo_(tagOpen, tagClose, sampleText, outputid) {
	var txtarea = document.getElementById(outputid);
	if (!txtarea)
		return
	;

	// IE
	if (document.selection  && !is_gecko) {
		var theSelection = document.selection.createRange().text;
		if (!theSelection)
			theSelection=sampleText;
		txtarea.focus();
		if (theSelection.charAt(theSelection.length - 1) == " ") { // exclude ending space char, if any
			theSelection = theSelection.substring(0, theSelection.length - 1);
			document.selection.createRange().text = tagOpen + theSelection + tagClose + " ";
		} else {
			document.selection.createRange().text = tagOpen + theSelection + tagClose;
		}

	// Mozilla
	} else if(txtarea.selectionStart || txtarea.selectionStart == '0') {
		var replaced = false;
		var startPos = txtarea.selectionStart;
		var endPos = txtarea.selectionEnd;
		if (endPos-startPos)
			replaced = true;
		var scrollTop = txtarea.scrollTop;
		var myText = (txtarea.value).substring(startPos, endPos);
		if (!myText)
			myText=sampleText;
		if (myText.charAt(myText.length - 1) == " ") { // exclude ending space char, if any
			subst = tagOpen + myText.substring(0, (myText.length - 1)) + tagClose + " ";
		} else {
			subst = tagOpen + myText + tagClose;
		}
		txtarea.value = txtarea.value.substring(0, startPos) + subst +
			txtarea.value.substring(endPos, txtarea.value.length);
		txtarea.focus();
		//set new selection
		if (replaced) {
			var cPos = startPos+(tagOpen.length+myText.length+tagClose.length);
			txtarea.selectionStart = cPos;
			txtarea.selectionEnd = cPos;
		} else {
			txtarea.selectionStart = startPos+tagOpen.length;
			txtarea.selectionEnd = startPos+tagOpen.length+myText.length;
		}
		txtarea.scrollTop = scrollTop;
	}
	// reposition cursor if possible
	if (txtarea.createTextRange)
		txtarea.caretPos = document.selection.createRange().duplicate();
}
/*
== Small search keyboard == ; Author: Maciej Jaros [[:pl:User:Nux]] ; Licence: CC-BY or [http://opensource.org/licenses/gpl-license.php GNU General Public License v2]
*/
if (wgNamespaceNumber == -1 && wgPageName=="Speciální:Search")
{
	addOnloadHook(addSearchKeyboard);
}

function addSearchKeyboard() {
	var subEl = document.getElementById('results');
	var newEl = document.createElement('div');
	newEl.className = 'search_keyboard';
	newEl.innerHTML = "\
Znaky:\
č\
š\
ř\
ž\
ť\
ď\
ň\
ě\
á\
í\
é\
ó\
ú\
ý\
ů\
ö\
ü\
ä\\
";
	newEl.style.cssText = 'margin-left:25%; width:50%; font-size:small;';
	subEl.parentNode.insertBefore(newEl, subEl);
}

/*
*/
// START Meziprojektova navigace (z de:wikt:Mediawiki:monobook.js)

 document.write('