function change_lang(x) {
 if(typeof(no_Cookie)==undef || no_Cookie==0) {
  x = (typeof(x)==undef ? lang : x);
  var today = new Date();
  var expires = new Date();
  expires.setTime(today.getTime() + 1000*60*60*24*365);
  document.cookie = "lang=" + x + "; expires=" + expires.toGMTString();
}}

function change_size(change, myReturn, myIndex) {
// POZOR : Pokud upravím tyto testy na <document.styleSheets[0].cssRules> a <document.styleSheets[0].rules>,
//         musím totéž udělat zde níže ve funkci <change_color()> a také
//         musím opravit i <odkazy.php> ve scriptu pod možností změny velikosti písma a barev
 if(document.styleSheets) {
 	var myRules = new Array();
	if(document.styleSheets[0].cssRules) {
	 myRules = document.styleSheets[0].cssRules
	} else {
	 if(document.styleSheets[0].rules) {
	  myRules = document.styleSheets[0].rules
 	 } else {
	  return;
  }}
  change = (typeof(change)==undef ? 0 : change);
  myIndex = (typeof(myIndex)==undef ? "" : myIndex);
  if(change>1) {
   fi = Math.min(14, Math.max(10, change));
  } else {
//   fi = parseInt(myRules[3].style.fontSize) + change;
   fi = parseInt(myRules[15].style.fontSize) + change;
   fi = (fi > 14 ? 10 : fi);
  }
  myRules[0].style.fontSize = fi + "px";
  myRules[15].style.fontSize = fi + "px";
  myRules[17].style.fontSize = fi + "px";
  if(typeof(no_Cookie)==undef || no_Cookie==0) {
   var today = new Date();
   var expires = new Date();
   expires.setTime(today.getTime() + 1000*60*60*24*365);
   document.cookie = "findex" + myIndex + "=" + fi + "; expires=" + expires.toGMTString();
 }}
 if(document.getElementById('main_table') && document.getElementById('cprght')) {
  document.getElementById('main_table').style.height=0;
  document.getElementById('cprght').style.top=0;
  document.getElementById('main_table').style.height=document.body.scrollHeight-90;
  document.getElementById('cprght').style.top=document.body.scrollHeight;
 }
 if(myReturn) {
  return fi;
}}

function change_color(posun, myReturn, myIndex) {
// POZOR : Pokud upravím tyto testy na <document.styleSheets[0].cssRules> a <document.styleSheets[0].rules>,
//         musím totéž udělat zde výše ve funkci <change_size()> a také
//         musím opravit i <odkazy.php> ve scriptu pod možností změny velikosti písma a barev
 if(document.styleSheets) {
 	var myRules = new Array();
	if(document.styleSheets[0].cssRules) {
   myRules = document.styleSheets[0].cssRules
	} else {
	 if(document.styleSheets[0].rules) {
	  myRules = document.styleSheets[0].rules
 	 } else {
	  return;
 	}}
	posun = (typeof(posun)==undef ? 0 : posun);
	myIndex = (typeof(myIndex)==undef ? "" : myIndex);
	pocet_barev = 5;
	ci = ((ci + posun > pocet_barev - 1) ? 0 : ci + posun)
	myBodyColor      = ["#F8F8FF", "#FFEF40", "#FFFF50", "#B0B0FF", "#B0FFB0"];
	myAColor         = ["#FFFF80", "#D8F8FF", "#FF4500", "#FFFF80", "#FFFF80"];
	myOdstLichyColor = ["#E9E9FF", "#FFFF80", "silver",  "#77BEFF", "#90EE90"];
	mySearchColor    = ["#E9E9FF", "#FFFF80", "#FFFF00", "#8080FF", "#90EE90"];
	myOdkazyColor    = ["#E9E9FF", "#FFD700", "#E0E0E0", "#D0FFFF", "#90EE90"];
	myPlochaColor    = ["#E9E9FF", "#FFD700", "#FFFF00", "#D0D0FF", "#90EE90"];
	myLichyColor     = ["#E9E9FF", "#FFD700", "#FFFF00", "#D0D0FF", "#90EE90"];
	myCprghtColor    = ["#E9E9FF", "#FFFF80", "silver",  "#D0FFFF", "#90EE90"];
	myQuestionColor  = ["#3000A0", "#A52A2A", "blue",    "#000080", "#006400"];
	myZahlaviColor   = ["#30A0A0", "#A52A2A", "blue",    "#000080", "#006400"];
	myRamOutColor    = ["#A0A0A0", "#A52A2A", "#A52A2A", "#000080", "#006400"];
	myRamInColor     = ["#FFFFFF", "#FFFF80", "#FFFFE0", "#D0FFFF", "#E0FFE0"];
	mySudyColor      = ["#FFFFEE", "#FFFF80", "#FFFFE0", "#D0FFFF", "#E0FFE0"];
  myRules[0].style.backgroundColor  = myBodyColor[ci];      // BODY
  myRules[1].style.backgroundColor  = myAColor[ci];         // A:hover
  myRules[2].style.backgroundColor = mySearchColor[ci];     // search
  myRules[3].style.backgroundColor = myZahlaviColor[ci];    // zahlavi
  myRules[4].style.backgroundColor = myRamOutColor[ci];     // ramecekout
  myRules[5].style.backgroundColor = myRamInColor[ci];      // ramecekin
  myRules[6].style.backgroundColor = myPlochaColor[ci];     // plocha
  myRules[7].style.borderColor     = myZahlaviColor[ci];    // tečkování pod class=odkaz (musí být definováno v CSS)
//  myRules[8].style.backgroundColor = myOdkazyColor[ci];   // odkazy
  myRules[8].style.borderColor     = myZahlaviColor[ci];    // tečkování pod class=odkazy
  myRules[9].style.backgroundColor = myQuestionColor[ci];   // question
  myRules[10].style.backgroundColor = mySudyColor[ci];      // sudy
  myRules[11].style.backgroundColor = myLichyColor[ci];     // lichy
  myRules[12].style.backgroundColor = myOdstLichyColor[ci]; // odstaveclichy
  myRules[13].style.backgroundColor = myCprghtColor[ci];    // copyright
  myRules[14].style.backgroundColor = myBodyColor[ci];      // okolí (login.php)
  myRules[16].style.borderColor = myRamOutColor[ci];        // ramecekout (div layout)
  if(document.getElementById("bckgimg")) {
   document.getElementById("bckgimg").style.backgroundImage = "URL('images/bckglogo" + ci + ".png')";
  }
  if(typeof(no_Cookie)==undef || no_Cookie==0) {
   var today = new Date();
   var expires = new Date();
   expires.setTime(today.getTime() + 1000*60*60*24*365);
   document.cookie = "cindex" + myIndex + "=" + ci + "; expires=" + expires.toGMTString();
 }}
 if(myReturn) {
	return ci;
}}
