		/* PROCEDURA, ktera narve do asociativniho pole httpGetVars hodntoty z adresy za otaznikem */

    var pole = window.location.search.substr(1).split("&"); 
         /* location.search je ta zajímavava cast adresy za otaznikem  
          substr(1) odebere nulty znak (otaznik), split("&") to rozseká podle & */
    
    var httpGetVars = new Array(); 
    for(i = 0; i < pole.length; i++){
         httpGetVars[pole[i].split("=")[0]] = unescape(pole[i].split("=")[1]); 
              /* v pole[i] je treba jidlo=ryby, rozsekam to splitem podle rovnitka. 
               Poli httpGetVars do [indexu] pridam to, co je pred rovnitkem [0], do hodnoty to, co je za rovnitkem [1]
               takze pak treba httpGetVars["jidlo"] = "ryby"
               unescape pochopi znaky procent */
               
    }

  switch (httpGetVars['rstema']) 
	{
		case '14':
		obrazek = 'logosekce_centrum-regukce-nadvahy.jpg';
			break;
		case '18':
		obrazek = 'logosekce_lecebna-vyziva.jpg';
			break;
		case '15':
		obrazek = 'logosekce_pro-odborniky.jpg';
			break;			
		case '16':
		obrazek = 'logosekce_zdrava_vyziva.jpg	';
			break;			
		default:
      obrazek = 'logosekce1.jpg';
     break;
      	
	}     


myurl = location.href;
mySub1 = "/";
mySub2 = ".php";

//Returns everything right of the last instance of the subString to the end of the fullString
function rightFromSubStringToEndOfFullString(fullString, subString) {
if (fullString.lastIndexOf(subString) == -1) {
return "";
} else {
return fullString.substring(fullString.lastIndexOf(subString)+1, fullString.length);
}
}

//Returns everything left of the last instance of the subString to the start of the fullString
function leftFromSubStringToBeginningOfFullString(fullString, subString) {
if (fullString.lastIndexOf(subString) == -1) {
return "";
} else {
return fullString.substring(0, fullString.lastIndexOf(subString));
}
}

//Strip out everything before the last "/"
myVar = rightFromSubStringToEndOfFullString(myurl, mySub1);

//Strip out the .html
myText = leftFromSubStringToBeginningOfFullString(myVar, mySub2);

if(myText == ('poradna') )  document.write('<style>#hlavicka {	background: #fff url(./image/iocomp/'+ obrazek +') no-repeat;	background-position: right top; }		 #obsah {	background-image: none;}		 </style>');
else document.write('<style>#hlavicka {	background: #fff url(./image/iocomp/'+ obrazek +') no-repeat;	background-position: right top; }	</style>');



